setupResources() — mcp Function Reference
Architecture documentation for the setupResources() function in server.ts from the mcp codebase.
Entity Profile
Dependency Diagram
graph TD 10a4252d_3edb_56bd_28db_9c5d6fc94128["setupResources()"] fb3524f1_6068_fb0f_15f3_83e2b15a3f3f["constructor()"] fb3524f1_6068_fb0f_15f3_83e2b15a3f3f -->|calls| 10a4252d_3edb_56bd_28db_9c5d6fc94128 style 10a4252d_3edb_56bd_28db_9c5d6fc94128 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/server.ts lines 241–273
private setupResources() {
this.server.resource(
'configuration',
'supermodel://docs/configuration',
{
description: 'Supermodel MCP Server configuration reference — environment variables and CLI options',
mimeType: 'text/markdown',
},
async (uri) => ({
contents: [{
uri: uri.toString(),
mimeType: 'text/markdown',
text: `# Configuration Reference\n\n## Environment Variables\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| \`SUPERMODEL_API_KEY\` | Yes | — | API key from [dashboard.supermodeltools.com](https://dashboard.supermodeltools.com) |\n| \`SUPERMODEL_BASE_URL\` | No | \`https://api.supermodeltools.com\` | Override API endpoint |\n| \`SUPERMODEL_CACHE_DIR\` | No | — | Directory for pre-computed graph cache files |\n| \`SUPERMODEL_TIMEOUT_MS\` | No | \`900000\` | API request timeout in milliseconds |\n| \`SUPERMODEL_NO_API_FALLBACK\` | No | — | Set to disable on-demand API calls (cache-only mode) |\n| \`SUPERMODEL_EXPERIMENT\` | No | — | Experiment mode (e.g. \`graphrag\`) |\n\n## CLI Usage\n\n\`\`\`bash\nnpx @supermodeltools/mcp-server [directory] [--precache]\n\`\`\`\n\n| Argument | Description |\n|----------|-------------|\n| \`directory\` | Default working directory for tool calls |\n| \`--precache\` | Generate and cache the graph for the directory on startup |\n\n## Pre-computing Graphs\n\n\`\`\`bash\nnpx @supermodeltools/mcp-server precache /path/to/repo --output-dir ./cache\n\`\`\`\n`,
}],
}),
);
this.server.resource(
'quickstart',
'supermodel://docs/quickstart',
{
description: 'Supermodel MCP Server quick start guide — install, configure, and start using in under 5 minutes',
mimeType: 'text/markdown',
},
async (uri) => ({
contents: [{
uri: uri.toString(),
mimeType: 'text/markdown',
text: `# Quick Start Guide\n\n## 1. Get an API Key\n\nSign up at [dashboard.supermodeltools.com](https://dashboard.supermodeltools.com) to get your free API key.\n\n## 2. Install\n\n\`\`\`bash\nnpm install -g @supermodeltools/mcp-server\n\`\`\`\n\nOr run directly with npx (no install needed):\n\n\`\`\`bash\nnpx @supermodeltools/mcp-server\n\`\`\`\n\n## 3. Add to Your MCP Client\n\n### Claude Code\n\n\`\`\`bash\nclaude mcp add supermodel --env SUPERMODEL_API_KEY=your-key -- npx -y @supermodeltools/mcp-server\n\`\`\`\n\n### Cursor\n\nAdd to \`~/.cursor/mcp.json\`:\n\n\`\`\`json\n{\n "mcpServers": {\n "supermodel": {\n "command": "npx",\n "args": ["-y", "@supermodeltools/mcp-server"],\n "env": { "SUPERMODEL_API_KEY": "your-key" }\n }\n }\n}\n\`\`\`\n\n## 4. Use the Tools\n\n- **\`symbol_context\`**: Look up any function, class, or method with full caller/callee graph and source code\n- Supports batch lookups via the \`symbols\` array\n- Use \`brief: true\` for compact output when looking up 3+ symbols\n\n## Next Steps\n\n- Read the [configuration reference](supermodel://docs/configuration) for advanced options\n- Use \`precache\` to pre-compute graphs for faster responses\n- See the [GitHub repo](https://github.com/supermodeltools/mcp) for more\n`,
}],
}),
);
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does setupResources() do?
setupResources() is a function in the mcp codebase.
What calls setupResources()?
setupResources() is called by 1 function(s): constructor.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free