knock — Claude Code MCP server: what it does, how to install
The knock MCP server provides a code map and memory for AI coding agents locally without an API key.
Apache-2.0 ★ 5 updated 2026-11-04
claude mcp add knock -- uvx knock-mcpWhat knock does
The server gives the agent a skeleton of the codebase with exact line ranges and callers to reduce token consumption during investigations. It indexes files on your machine and updates notes when code changes.
Running it requires uv or Python, plus the CLI registration command for your tool. It tracks whether notes are fresh or stale and stores findings between sessions.
Setup is done via claude mcp add knock -- uvx knock-mcp inside the repository directory.
What it helps with
- map code structure for AI agents
- retain memory between coding sessions
- reduce file reading overhead
- track stale notes in the repository
Example prompts for the agent
- Add rate limiting to the login endpoint
- Where are expired checkouts cleaned up?
- Why do tests fail with a Redis error?
How to install knock
Platform CLI
claude mcp add knock -- uvx knock-mcpuvx runs the command named after the package; if the README names another one, use uvx --from knock-mcp <command>
Platform CLI
codex mcp add knock -- uvx knock-mcpuvx runs the command named after the package; if the README names another one, use uvx --from knock-mcp <command>
Config file
{
"mcpServers": {
"knock": {
"command": "uvx",
"args": [
"knock-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from knock-mcp <command>
Config file
{
"servers": {
"knock": {
"type": "stdio",
"command": "uvx",
"args": [
"knock-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from knock-mcp <command>
Platform CLI
gemini mcp add knock uvx knock-mcpuvx runs the command named after the package; if the README names another one, use uvx --from knock-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about knock
How to install knock in Claude Code?
Run claude mcp add knock -- uvx knock-mcp in your project terminal.
What does knock do?
It feeds a concise code map and persistent memory to your AI coding agent, reducing token usage.
What is required to run knock?
It runs 100% locally and requires uv or Python along with the knock-mcp package.