# knock

The knock MCP server provides a code map and memory for AI coding agents locally without an API key.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5 repo stars
- Author: HasanGilani
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/HasanGilani/knock
- Updated: 2026-11-04
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/knock

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

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add knock -- uvx knock-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from knock-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add knock -- uvx knock-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from knock-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add knock uvx knock-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from knock-mcp <command>

## When to use it
- map code structure for AI agents
- retain memory between coding sessions
- reduce file reading overhead
- track stale notes in the repository

## Example prompts
- Add rate limiting to the login endpoint
- Where are expired checkouts cleaned up?
- Why do tests fail with a Redis error?

## Similar
- [three.ws Knock](https://affpapa.org/en/nevibecode/mcp/threews-knock.md) — MCP server · ★ 284 repo stars
- [knock-cli](https://affpapa.org/en/nevibecode/skills/knock-cli.md) — skill · 521 installs
- [knock-in-app-ui](https://affpapa.org/en/nevibecode/skills/knock-in-app-ui.md) — skill · 158 installs
- [research-implement-feature](https://affpapa.org/en/nevibecode/skills/research-implement-feature.md) — skill · 140 installs
- [knock-webhooks](https://affpapa.org/en/nevibecode/skills/knock-webhooks.md) — skill · 119 installs
- [i-have-adhd](https://affpapa.org/en/nevibecode/skills/i-have-adhd.md) — skill · 35200 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
