Skip to content
MCP server

knock

Code map and memory for coding agents: key functions, line ranges, callers, findings

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, self-hosted
Runs
Locally
Version
0.2.0
Listing updated
today

Similar MCP servers

About knock

knock is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

knock gives an agent a skeleton of the relevant code before it starts searching: signatures, exact line ranges, what each function calls and who calls it, plus the history behind it and the docs that matter. Notes are stored in SQLite on your machine, it needs no API key, and it reads the repo without running anything in it. Python and JavaScript/TypeScript get a full code map, and Go, Rust, Java and others get functions and classes.

Agents can save findings with remember, and every answer says whether its notes are fresh or stale, because notes are flagged when the files they cite change. Decisions and their rationale from docs or ADRs come back alongside the code.

The README reports a benchmark on a 4,776-file repository: median cost fell from $0.42 to $0.25 over eight runs, and Claude spawned a sub-agent in five of eight runs without knock and none with it. It also says the difference was within noise on a small, well-known repo and that knock added a small cost to quick edits. Sharing notes across a team is not supported yet.

Install

Run in a terminal

claude mcp add knock -- uvx knock-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "knock": {
      "command": "uvx",
      "args": [
        "knock-mcp"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "knock": {
      "command": "uvx",
      "args": [
        "knock-mcp"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "knock": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "knock-mcp"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "knock": {
      "command": "uvx",
      "args": [
        "knock-mcp"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "knock": {
      "command": "uvx",
      "args": [
        "knock-mcp"
      ]
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Tools this server provides (4)

Taken from the project documentation; the running server may differ.

map
Relevant code for a task as a skeleton with line ranges, callers and history
open
Line-numbered code for a function, class, range or file skeleton
remember
Save a finding for future sessions
get_context
Ranked package of notes, functions and files for a task

What it does

Code map
Returns relevant code as a skeleton with line ranges and callers.
Open by symbol
Shows line-numbered code for a function or class with callers and callees.
Remember findings
Saves discoveries for future sessions.
Freshness flags
Marks notes stale when the cited files change.
Local storage
Keeps notes in SQLite on your machine, with no API key.
Terminal commands
Offers map, open, search, status and index commands for manual use.

Good for

  • Investigate how a feature works in a large repo
  • Trace why a decision was made from docs and commits
  • Locate the right file before making a cross-module change
  • Carry a bug finding from one session to the next

Pricing

Open source

Free, open source

knock FAQ

Does it need an API key?

No. It runs on your machine and needs no key.

How do I install it?

Run claude mcp add knock -- uvx knock-mcp serve --repo . --toolset map, or install knock-mcp with pipx or pip.

Which languages get a full code map?

Python and JavaScript/TypeScript; Go, Rust, Java and more get functions and classes.

Can a team share notes?

Not yet. Each person's notes live on their own machine.

Is knock free?

Yes. knock is open source, so you can use and self-host it for free.

How do I add knock to Claude Code?

Run this command in your terminal: claude mcp add knock -- uvx knock-mcp

What are the best alternatives to knock?

The closest alternatives to knock are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers