MCP server that gives AI agents instant codebase understanding via the Supermodel API. Two tools — overview and symbol_context — backed by pre-computed code graphs for sub-second responses.
curl -sSL https://raw.githubusercontent.com/supermodeltools/mcp/main/setup.sh | bashPrefer to inspect before running? (Click to expand)
Download, review, then execute:
curl -sSL https://raw.githubusercontent.com/supermodeltools/mcp/main/setup.sh -o setup.sh
cat setup.sh
chmod +x setup.sh
./setup.shOr clone the entire repo:
git clone https://github.com/supermodeltools/mcp.git
cd mcp
./setup.shnpm install -g @supermodeltools/mcp-serverOr run directly:
npx @supermodeltools/mcp-serverGet your API key from the Supermodel Dashboard.
| Variable | Description |
|---|---|
SUPERMODEL_API_KEY |
Your Supermodel API key (required) |
SUPERMODEL_BASE_URL |
Override API base URL (optional) |
SUPERMODEL_CACHE_DIR |
Directory for pre-computed graph cache files (optional) |
SUPERMODEL_TIMEOUT_MS |
API request timeout in ms (default: 900000 / 15 min) |
SUPERMODEL_NO_API_FALLBACK |
Set to disable on-demand API calls; cache-only mode (optional) |
Set your API key globally in your shell profile so it's available to all MCP clients:
# Add to ~/.zshrc (macOS) or ~/.bashrc (Linux)
export SUPERMODEL_API_KEY="your-api-key"With the API key set globally, you can omit the env block from your MCP configs:
{
"mcpServers": {
"supermodel": {
"command": "npx",
"args": ["-y", "@supermodeltools/mcp-server"]
}
}
}claude mcp add supermodel --env SUPERMODEL_API_KEY=your-api-key -- npx -y @supermodeltools/mcp-serverOr if SUPERMODEL_API_KEY is already set in your shell environment:
claude mcp add supermodel -- npx -y @supermodeltools/mcp-serverVerify installation:
claude mcp listAdd to ~/.cursor/mcp.json:
{
"mcpServers": {
"supermodel": {
"command": "npx",
"args": ["-y", "@supermodeltools/mcp-server"],
"env": {
"SUPERMODEL_API_KEY": "your-api-key"
}
}
}
}For benchmarking tools or batch processing, pass a default working directory as a CLI argument:
npx @supermodeltools/mcp-server /path/to/repositoryTools will use this directory automatically if no explicit directory parameter is given.
Returns a pre-computed architectural map of the codebase in sub-second time. Call this first on any new task.
Output includes:
- Top architectural domains and their key files
- Most-called hub functions (call graph centrality)
- File, function, and class counts
- Primary language and graph statistics
Parameters:
| Argument | Type | Required | Description |
|---|---|---|---|
directory |
string | No | Path to repository directory. Omit if server was started with a default workdir. |
Example prompts:
- "Give me an overview of this codebase"
- "What's the architecture of this project?"
Deep dive on a specific function, class, or method. Given a symbol name, instantly returns its definition location, all callers, all callees, domain membership, and related symbols in the same file.
Output includes:
- Definition location (file, line range)
- Callers (who calls this symbol)
- Callees (what this symbol calls)
- Architectural domain membership
- Related symbols in the same file
- File import statistics
Parameters:
| Argument | Type | Required | Description |
|---|---|---|---|
symbol |
string | Yes | Name of the function, class, or method. Supports ClassName.method syntax and partial matching. |
directory |
string | No | Path to repository directory. Omit if server was started with a default workdir. |
Example prompts:
- "Look up the symbol
filter_querysetin this codebase" - "What calls
QuerySet.filterand what does it call?"
- Call
overviewto understand the codebase architecture - Read the issue/bug description and identify relevant domains and symbols
- Call
symbol_contexton key symbols to understand their structural context - Use Read/Grep to examine the actual source code at the identified locations
- Make your fix and verify with tests
For fastest performance, pre-compute graphs ahead of time using the precache CLI subcommand. This calls the Supermodel API once and saves the result to disk, enabling sub-second tool responses with no API calls at runtime.
npx @supermodeltools/mcp-server precache /path/to/repo --output-dir ./supermodel-cacheOptions:
--output-dir <dir>— Directory to save the cache file (default:./supermodel-cacheorSUPERMODEL_CACHE_DIR)--name <name>— Repository name for the cache key (default: auto-detected from git remote + commit hash)
SUPERMODEL_CACHE_DIR=./supermodel-cache npx @supermodeltools/mcp-serverThe server loads all cached graphs from SUPERMODEL_CACHE_DIR at startup. If no cache exists for a given repository, the server falls back to an on-demand API call (which takes 5-15 minutes for large repos).
Use the --precache flag to automatically generate and cache the graph for the default workdir on server startup:
npx @supermodeltools/mcp-server /path/to/repo --precacheThis is useful in automated environments (e.g., Docker containers for benchmarking) where you want the graph ready before any tool calls.
Benchmark this MCP server using mcpbr with the provided mcpbr-config.yaml configuration.
git clone https://github.com/supermodeltools/mcp.git
cd mcp
npm install
npm run buildnode dist/index.js # Start MCP server
node dist/index.js /path/to/repo # With default workdir
node dist/index.js precache /path/to/repo # Pre-compute graphnpm test # Run all tests
npm run test:coverage # Run with coverage
npm run typecheck # Type checkingFor interactive testing, use the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.jsThe first analysis of a repository requires an API call that can take 5-15 minutes. If your MCP client times out:
- Pre-compute the graph — Use
precacheto generate the graph ahead of time (see Pre-computed Graphs) - Increase your MCP client timeout — For Claude Code CLI, set
MCP_TOOL_TIMEOUT=900000in your shell profile - Analyze a subdirectory — Target specific parts of your codebase to reduce analysis time
- 401 Unauthorized: Check
SUPERMODEL_API_KEYis set correctly - Permission denied: Check read permissions on the directory
- ENOTFOUND or connection errors: Check your internet connection and firewall settings
Set the DEBUG environment variable for verbose logging:
{
"mcpServers": {
"supermodel": {
"command": "npx",
"args": ["-y", "@supermodeltools/mcp-server"],
"env": {
"SUPERMODEL_API_KEY": "your-api-key",
"DEBUG": "supermodel:*"
}
}
}
}