MCP server
codemap can run as a Model Context Protocol (MCP) server. MCP clients start it as a child process and talk to it over stdio.
codemap mcpThe transport is newline-delimited JSON-RPC 2.0 on stdin and stdout.
Tool
The server exposes one tool, pack_codebase.
| Argument | Type | Description |
|---|---|---|
directory | string | Repository root to pack. Required, and must exist. |
include | string | Comma-separated include patterns. |
exclude | string | Comma-separated exclude patterns. |
format | string | markdown, xml, json, or plain. |
removeComments | boolean | Remove comments. |
removeEmptyLines | boolean | Remove empty lines. |
truncateBase64 | boolean | Truncate base64 runs. |
instructionPath | string | Instruction file to prepend. |
headerText | string | Header text to add. |
The tool returns the packed content as text. It does not write files. If the call fails, the result has isError set to true.
Client configuration
Add the server to your MCP client’s configuration. For example:
{
"mcpServers": {
"codemap": {
"command": "codemap",
"args": ["mcp"]
}
}
}Protocol notes
initialize,tools/list, andtools/callare supported.- Notifications receive no response.
- Unknown methods return error code
-32601.