mcp-memory-server-surgery

Guides safe modification of MCP servers exposing repo memory with protocol guardrails and validation steps.

1|Updated Sep 12, 2025
One-click install
npx skills add https://github.com/metabench/copilot-dl-news --skill mcp-memory-server-surgery-metabench
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mcp-memory-server-surgery
Source: https://github.com/metabench/copilot-dl-news/tree/main/docs/agi/skills/mcp-memory-server-surgery
Command: npx skills add https://github.com/metabench/copilot-dl-news --skill mcp-memory-server-surgery-metabench

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Modifying MCP servers that expose repository memory (like docs-memory) risks breaking stdio framing, headerless parsing, and the tools/list contract that agents depend on. This Skill provides a disciplined procedure so changes stay backward-compatible and verifiable. ## Core Features & Use Cases - Mandatory prior-art retrieval: Search existing Skills and sessions in docs-memory before coding, so you reuse known solutions instead of re-learning painful protocol details. - Contract-first tool design: Define tool names, JSON input/output schemas, and error modes before implementation, favoring small composable tools. - Validation ladder: Run mcp-check, the docs-memory stdio compatibility check, and focused Jest tests in order, stopping at the first failure. - Use Case: When adding a new docs_memory tool to tools/mcp/docs-memory/mcp-server.js, follow this Skill to keep tools/list additive, preserve headerless stdio support, and record the new capability as a Skill for future agents. ## Quick Start Ask the agent to add a new tool to the docs-memory MCP server while following the mcp-memory-server-surgery procedure and running its validation ladder.

Frequently Asked Questions about mcp-memory-server-surgery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely add a new tool to an MCP server?▼

Define the tool contract first: name it docs_memory_<verbNoun>, specify JSON input and output schemas, and document error modes. Keep tools/list stable and additive, then validate with mcp-check, the stdio compatibility check, and a focused Jest test.

How do I test MCP stdio compatibility after changes?▼

Run node tools/mcp/docs-memory/check-stdio.js to verify headerless stdio framing still works. Combine it with node tools/dev/mcp-check.js --quick --json for server health and a focused Jest test for the new tool.

What MCP protocol details break when editing a memory server?▼

Common breakage points are stdio framing, headerless JSON-RPC parsing, and changes to the tools/list or tools/call registry shape. Agents and tools may rely on headerless support, so it must be preserved.

When should I not use this MCP modification procedure?▼

Do not use it for unrelated business logic or for rewriting MCP protocol handling from scratch. It is scoped to servers that expose or mutate repo memory, especially docs-memory.

What should I do if MCP memory tools are unavailable?▼

Fall back to the md-scan utility: run node tools/dev/md-scan.js against docs/agi and docs/sessions with search terms like docs-memory and check-stdio to retrieve prior art manually.