Also called Model Context Protocol server, Codebase MCP server
In depth What is MCP (Model Context Protocol)?: the protocol itself: hosts, clients, servers, tools, resources and prompts.
How an MCP server works
The Model Context Protocol has three roles. A host is the application the user runs (Claude Code, an IDE). It starts one client per server, and each client keeps a connection to one server. A server exposes three kinds of capability:
| Capability | What it is | Example for a codebase |
|---|---|---|
| Tools | Functions the model can call | search_codebase, "who calls this?" |
| Resources | Data the client can read | A wiki page or file summary |
| Prompts | Reusable prompt templates | "Review this change" |
Messages are JSON-RPC. The two standard transports are stdio (the host launches the server as a child process) and streamable HTTP (a URL, for remote or shared servers). The agent reads the tool list, decides when a tool applies, and calls it.
Why a codebase MCP server matters
Without one, an agent explores by opening files and grepping, and does it again every session. That costs tokens and time, and it misses facts that are not in the files: who owns a module, which files change together, why a choice was made. A codebase MCP server precomputes those facts and returns an answer with file paths in one call. Quality depends on what the server indexes and how it ranks results, so test it on your own questions.
How to set up an MCP server yourself
Most clients take a small config entry. For Claude Code: claude mcp add <name> -- <command>. Other clients use a JSON file (Cursor's .cursor/mcp.json, VS Code's .vscode/mcp.json) or a TOML table (Codex). If you only need file access or text search, a general filesystem or grep-style MCP server is enough and simpler. For code-aware answers you need a server that parses the repository. See setting up MCP in Claude Code, Cursor and Cline.
How repowise works as an MCP server
repowise mcp starts the server for an indexed repository (run repowise init first). Transports are stdio (default), streamable-http and sse, chosen with --transport. HTTP listens on port 7338 by default on 127.0.0.1, and sse is deprecated in favour of streamable HTTP.
repowise serves 10 MCP tools: get_answer, get_context, get_symbol, search_codebase, get_risk, get_change_risk, get_why, get_overview, get_health and get_dead_code. repowise mcp --tools takes a comma-separated list of tools to narrow the set for a small context window. No tool edits your code: the agent reads the answer and makes the change.
repowise init can write the client config for Claude Code and Codex (full support, with hooks and instructions), and for Cursor, VS Code/Copilot, Copilot CLI, OpenCode and Kiro. It works with any MCP client: for Cline, Windsurf, Gemini CLI and Zed, repowise agents print-config <id> prints a snippet to paste. The hosted product adds a remote MCP endpoint. See AI context and the MCP guide.