MCP Integration

larkx MCP Server for Claude Code

Connect once, get 6 instant code navigation tools - no file reading required.

What is MCP?The Model Context Protocol (MCP) is an open standard that lets AI clients like Claude Code connect to external tool servers. larkx implements MCP so Claude Code, Cursor, Continue, and any MCP-compatible client can query your codebase index without reading source files.

How it works

Claude Code's VS Code extension reads a file called .mcp.json in your project root. Each entry tells the extension how to spawn an MCP server. When you open the project, Claude Code asks for approval, then connects.

  1. 1

    Make sure larkx is installed

    bash
    npm install -g larkx
    larkx --version
  2. 2

    Create .mcp.json (or let init do it)

    If you ran larkx init, this file already exists. Otherwise create it manually in the project root:

    .mcp.json
    {
      "mcpServers": {
        "larkx": {
          "command": "larkx",
          "args": ["mcp"]
        }
      }
    }

    If larkx is not on your PATH, point at the bin directly:

    json
    {
      "mcpServers": {
        "larkx": {
          "command": "node",
          "args": ["C:\\path\\to\\larkx\\bin\\larkx.js", "mcp"]
        }
      }
    }
  3. 3

    Reload VS Code

    bash
    Ctrl+Shift+P → Developer: Reload Window

    (macOS: Cmd+Shift+P)

  4. 4

    Approve the server

    Claude Code will show a prompt asking you to approve the larkx MCP server for this project. Click Allow. Once approved it auto-connects in future sessions.

  5. 5

    Verify

    Check the CLI

    bash
    larkx --version
    # → larkx v0.1.0

    If the command is not found, make sure your Node global bin is on PATH.

    Check the index

    bash
    larkx stats

    Should print file counts, detected frameworks, and per-level token estimates.

    If the index is empty, run larkx index first.

    Check the MCP server

    bash
    larkx mcp --check
    # → ✓ MCP server responding correctly

    This confirms the MCP server can start and answer basic JSON-RPC health checks.

    Check inside your AI agent

    Open the Claude Code chat and ask:

    "Which MCP servers do you have?"

    The response should include larkx with 6 tools listed.

    Ask a follow-up question such as:

    • "Show me the project index."
    • "Where is the indexProject function defined?"

    If Claude opens source files directly, the MCP hook is not being used.

    Not working?
    • Confirm .mcp.json exists in the project root.
    • Reload VS Code: Ctrl+Shift+P → Developer: Reload Window.
    • Check that larkx is on PATH or use the full node path in .mcp.json.
    • Run larkx index --force to rebuild the graph.
Troubleshooting

If the server is not listed or is unresponsive:

  • Confirm .mcp.json exists in the project root.
  • Reload VS Code with Ctrl+Shift+P → Developer: Reload Window.
  • Check that larkx is on PATH or use the full node path in .mcp.json.
  • Run larkx index --force to rebuild the graph.

Common scopes

ScopeFileWhen to use
Per project.mcp.json in repo rootDifferent MCP servers per project (recommended)
Global (CLI only)claude mcp addTerminal Claude Code, all projects
Global (VS Code)Not supported as of v0.1Use per-project .mcp.json instead

Next steps