MCP Server
Context Chain exposes its knowledge graph through an MCP server with 9 tools. Any MCP-compatible coding AI can query design decisions while writing code.
Tools
get_context_for_code
The main entry point. Five-slot retrieval for a piece of code.
| Parameter | Type | Description |
|---|---|---|
file_path | string | Current file being edited |
function_name | string | (Optional) Specific function |
code_snippet | string | (Optional) Code fragment for semantic matching |
Queries all five slots in priority order: code anchor → keywords → decision links → semantic fallback, with metadata filtering throughout. Returns ranked decision summaries; request full content with a follow-up call.
search_decisions_by_keyword
Direct keyword search against the inverted index. Catches business terms ("refund", "auth", "rate limiting") that don't appear in code.
| Parameter | Type | Description |
|---|---|---|
keywords | string[] | Terms to search |
repo | string | (Optional) Scope to a repo |
search_decisions_semantic
Vector similarity search. Useful when the decision's wording differs from the search — e.g., searching "prevent duplicate charges" finds decisions about "idempotency design".
| Parameter | Type | Description |
|---|---|---|
query | string | Natural language query |
limit | number | (Optional) Max results |
get_decision_relationships
Explore causal, dependency, and conflict chains from a decision.
| Parameter | Type | Description |
|---|---|---|
decision_id | string | Starting decision |
depth | number | (Optional) How many hops to follow |
get_code_structure
List functions in a file or service.
| Parameter | Type | Description |
|---|---|---|
path | string | File path or service name |
type | string | Filter: function, file, service |
get_callers
Upstream dependencies — who calls a given function.
| Parameter | Type | Description |
|---|---|---|
function_name | string | Function to look up |
repo | string | Repository scope |
get_callees
Downstream dependencies — what a function calls.
| Parameter | Type | Description |
|---|---|---|
function_name | string | Function to look up |
repo | string | Repository scope |
get_cross_repo_dependencies
Cross-service API dependencies. Shows how services connect through API calls, shared packages, and message queues.
| Parameter | Type | Description |
|---|---|---|
repo | string | Repository to check |
report_context_usage
Feedback loop — report which decisions were actually useful during a coding session. Improves retrieval ranking over time.
| Parameter | Type | Description |
|---|---|---|
decision_ids | string[] | Decisions that were used |
session_context | string | (Optional) What you were working on |
Starting the Server
npm run mcpCommunicates over stdio, as expected by MCP clients. Usually started automatically by Claude Code via .mcp.json.
Connection
See Claude Code Setup for configuration.