Code MCP Server

Local semantic code search with Git history. Works offline, no API key needed.

Local serverstdioPython

What is the Code MCP server?

Code MCP server exists for a simple reason — assistants are far more useful when they can act on Code directly instead of describing what you should do. Local semantic code search with Git history. Works offline, no API key needed.

What you get

A deterministic, high-precision code intelligence layer exposed as a Model Context Protocol (MCP) server.

What the assistant can call

Once Code is connected, these are the calls the assistant has available:

  • Prerequisites — The Prerequisites tool exposed by this server
  • Development — The Development tool exposed by this server
  • index_codebase — Indexes or re-indexes source files and documentation in the given directory. Run this before using search_code or search_docs to ensure the database
  • search_code — Perform semantic search and find structural code definitions, locate where functions/classes are defined, or map out dependency references (call
  • search_docs — Understand the codebase conceptually — how things work, architectural patterns, SOPs. Searches markdown documentation, READMEs, and docstrings
  • search_history — Debug regressions and understand developer intent through Git history

Setting it up

code-memory on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Configuration and credentials

You will need one environment variable: EMBEDDING_MODEL. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Python ≥ 3.13 - uv package manager (recommended) or pip Install uv if you don't have it:

Choosing this one

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Code's toolset — Prerequisites, Development, index_codebase and 3 more — is a fair guide to whether it matches your workflow. It is maintained by kapillamba4; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the code mcp server does with a few real requests.

Available tools

ToolWhat it does
PrerequisitesThe Prerequisites tool exposed by this server.
DevelopmentThe Development tool exposed by this server.
index_codebaseIndexes or re-indexes source files and documentation in the given directory. Run this before using search_code or search_docs to ensure the database is up to date. Uses tree-sitter for language-agnostic structural extrac
search_codePerform semantic search and find structural code definitions, locate where functions/classes are defined, or map out dependency references (call graphs). Uses hybrid retrieval (BM25 + vector embeddings) to find exact mat
search_docsUnderstand the codebase conceptually — how things work, architectural patterns, SOPs. Searches markdown documentation, READMEs, and docstrings extracted from code.
search_historyDebug regressions and understand developer intent through Git history.

How to install the Code MCP server

For Windows:
```json
{
  "mcpServers": {
    "code-memory": {
      "command": "C:\\path\\to\\code-memory-windows-x86_64.exe"
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Python ≥ 3.13 - uv package manager (recommended) or pip Install uv if you don't have it:
VariableDescriptionRequired
EMBEDDING_MODELConfiguration value read at startup.Optional

Example prompts to try

  • Use Code to Prerequisites.
  • Use Code to Development.
  • Use Code to index codebase.

Frequently asked questions

It connects Code to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (Prerequisites, Development, index_codebase, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Code directly.