MCP Servers

Single source of truth for Coding Friend's two MCP servers: Learn MCP and Memory MCP.

Coding Friend provides two Model Context Protocol (MCP) servers that let Claude Code (and other LLM clients) interact with your learning docs and project memory.

ServerNameScopePurpose
Learn MCPcoding-friend-learnUser (global)Search, read, and write learning docs in ~/.coding-friend/learn/
Memory MCPcoding-friend-memoryUser (global)Store, search, and manage project memories in docs/memory/

Learn MCP

Auto-registration (Learn MCP)

Run cf mcp or cf init to auto-register the Learn MCP into Claude Code at user scope:

cf mcp

This runs the equivalent of:

claude mcp add --scope user coding-friend-learn -- npx -y coding-friend-cli mcp-serve-learn ~/.coding-friend/learn

User-scoped means it's available in all your projects automatically — no per-project setup.

Config for non-Claude-Code clients (Learn MCP)

For other MCP clients (Claude Desktop, Cursor, ChatGPT, etc.), run cf mcp to get the config with the correct path filled in, then add it manually:

{
  "mcpServers": {
    "coding-friend-learn": {
      "command": "npx",
      "args": [
        "-y",
        "coding-friend-cli",
        "mcp-serve-learn",
        "~/.coding-friend/learn"
      ]
    }
  }
}

The path is always your global learn folder. To use a custom path, configure it first: cf config → Learn settings → Output dir.

Disabling

To disable the Learn MCP: cf config → Learn settings → Disable CF Learn. This unregisters the server from Claude Code automatically.

Available tools (Learn MCP)

Read:

ToolDescription
list-categoriesList all categories with doc counts
list-docsList docs, filter by category/tag
read-docRead full content of a doc
search-docsFull-text search across all docs
get-review-listDocs that need review

Write:

ToolDescription
create-docCreate new learning doc
update-docAppend content or update tags
improve-docGet improvement suggestions
track-knowledgeRecord understanding level (remembered/needs-review/new)

Memory MCP

Auto-registration (Memory MCP)

Run cf mcp, cf init, or cf memory init to auto-register the Memory MCP at user scope:

cf mcp

This runs the equivalent of:

claude mcp add --scope user coding-friend-memory -- npx -y coding-friend-cli mcp-serve

No path argument is stored at registration. The server resolves the current project's memory directory at runtime from the CLAUDE_PROJECT_DIR environment variable set by Claude Code, then applies git worktree logic to find the main repo root, reads docsDir from .coding-friend/config.json, and resolves <root>/docs/memory.

User-scoped means the server is available in all your projects automatically — no per-project .mcp.json setup. Per-project isolation is preserved because the path is resolved per-session, not baked in at registration time.

Config for non-Claude-Code clients (Memory MCP)

For other MCP clients (Claude Desktop, Cursor, ChatGPT, etc.) that do not set CLAUDE_PROJECT_DIR, an explicit path is required. Run cf memory mcp to get the correct path for the current project, then add it to your client:

{
  "mcpServers": {
    "coding-friend-memory": {
      "command": "npx",
      "args": [
        "-y",
        "coding-friend-cli",
        "mcp-serve",
        "/path/to/your/project/docs/memory"
      ]
    }
  }
}

Replace the path with the absolute path to your project's docs/memory/ directory. Run cf memory mcp to get the correct path printed.

Important: For non-Claude-Code clients, use a per-client config entry with an explicit path. The no-arg user-scope registration only works correctly in Claude Code (which sets CLAUDE_PROJECT_DIR).

Available tools (Memory MCP)

ToolDescription
memory_storeStore a new memory
memory_searchSearch memories (keyword/semantic/hybrid)
memory_retrieveGet a specific memory by ID
memory_listList memories with filtering
memory_updateUpdate existing memory
memory_deleteDelete a memory

Available resources

ResourceDescription
memory://indexBrowse all memories
memory://statsStorage statistics

Health Checks

cf mcp and cf status both run health checks for both MCP servers:

  • Learn MCP: checks registration (claude mcp get coding-friend-learn), package built, and docs present
  • Memory MCP: checks user-scope registration (claude mcp get coding-friend-memory), package built, and daemon status (for Tier 1/2)

Fix hints are printed inline when a check fails.

Stale Registration

If you previously had coding-friend-learn registered pointing to an old path (e.g., from a per-project setup before v0.9), the health check will show "already registered" but it may point to the wrong folder. Fix it:

claude mcp remove --scope user coding-friend-learn
cf mcp

See Also