# knock

> knock is an open-source MCP server for developer tools. Code map and memory for coding agents: key functions, line ranges, callers, findings. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Repository:** https://github.com/hasangilani/knock
- **MCP Registry name:** io.github.HasanGilani/knock
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools), [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-11-18

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
claude mcp add knock -- uvx knock-mcp
```

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

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

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

- `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

## 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.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/knock
