mcp_server/

The Model Context Protocol server uses MCPServer from the Python SDK. It exposes analysis tools, playbook prompts, and case resources. See the MCP reference for the catalog.

  • server.py — registers @mcp.tool handlers, delegating to the surface-agnostic producers in the app/ layer.

  • presenters.py — the MCP presenter: turns a producer’s ServiceResult into the MCP tool response (inlining any lock diagnostic with the MCP parameter names).

  • session.py — re-exports memdiver.app.session.ToolSession (dataset root, scan cache, protocol version).

  • tools.py, tools_inspect.py, tools_xref.py, tools_pipeline.py — aliases for the corresponding modules in memdiver.app. They preserve existing imports. Use memdiver.app or the public memdiver.services interface in new code.

  • Transport: stdio by default; --sse --port for Server-Sent Events (listener bound to 127.0.0.1; host/port are passed to MCPServer.run()).

  • No authentication (local-only). SSE port must not be exposed publicly.

  • Shares the process-wide dump and Memory Slice reader cache in app.reader_cache. The API also exposes it through api.services.reader_cache.

Tool catalogue: see MCP tool reference.