About Codebase Context
Codebase Context is an MCP server published by PatrickSys in the Developer Tools category: codebase Context gives AI agents understanding of your codebase through semantic code search, team conventions, patterns, and memory, so they use fewer tokens, spend less time, and produce better, more familiar output. Conduid read 12 tools from its source: detect_circular_dependencies, get_code_relationships, get_codebase_health, get_codebase_metadata, get_indexing_status, get_memory and 6 more. It is published to npm as codebase-context and starts with npx.
The repository has 69 stars and 12 forks, is licensed MIT, and its last commit was on 7 Nov 2026. The latest release is v2.3.0 (18 Apr 2026): Features 02-03: implement keyword-index symbol reference lookup (ccfc564) 02-03: register get_symbol_references MCP tool (6f6bc3a) 03-01: add frozen controlled eval fixt… It follows v1.10.0 (15 Apr 2026), and the 5 most recent releases go back to v1.8.1 (5 Mar 2026). It passes 4 of the 6 static checks Conduid ran on the repository; it does not pass No dynamic code execution and Scoped permissions. Its topics include devtools, context-engineering, code-intelligence and ai-coding.
Install
claude mcp add codebase-context -- npx -y codebase-context@2.4.0npx -y codebase-context@2.4.0git clone https://github.com/PatrickSys/codebase-contextTools (12)
detect_circular_dependenciesAnalyze the import graph to detect circular dependencies between files. Circular dependencies can cause initialization issues, tight coupling, and maintenance problems. Returns all detected cycles sorted by length (shorter cycles are often more problematic).| Parameter | Type | Description |
|---|---|---|
| scope | string | Optional path prefix to limit analysis (e.g., 'src/features', 'libs/shared') |
get_code_relationshipsFollow verified import or re-export relationships up to three hops from one indexed file. Returns source lines and freshness diagnostics; imports never imply runtime calls.| Parameter | Type | Description |
|---|---|---|
| direction | string | |
| file * | string | Indexed repository-relative file path. |
| max_hops | number | Hop limit from 1 to 3; defaults to 2. |
| max_nodes | number | Output node cap from 1 to 100; defaults to 50. |
get_codebase_healthGet actionable codebase health signals from the latest index. Returns the highest-risk files and their reasons, or a single file when requested.| Parameter | Type | Description |
|---|---|---|
| file | string | Optional file path to inspect a single file-level health record. |
| level | string | Optional minimum health level to return. |
| limit | number | Maximum number of files to return when no file is specified (default: 10). |
get_codebase_metadataGet codebase metadata including framework information, dependencies, architecture patterns, and project statistics.get_indexing_statusGet current indexing status: state, statistics, and progress. Use refresh_index to manually trigger re-indexing when needed.get_memoryRetrieves team conventions, architectural decisions, and known gotchas.
CALL BEFORE suggesting patterns, libraries, or architecture.
Filters: category (tooling/architecture/testing/dependencies/conventions), type (convention/decision/gotcha), query (keyword search).| Parameter | Type | Description |
|---|---|---|
| category | string | Filter by category |
| query | string | Keyword search across memory and reason |
| type | string | Filter by memory type |
get_style_guideQuery style guide rules and architectural patterns from project documentation.| Parameter | Type | Description |
|---|---|---|
| category | string | Filter by category (naming, structure, patterns, testing) |
| query | string | Query for specific style guide rules (e.g., "component naming", "service patterns") |
get_symbol_referencesFind current-source references across the files recorded by the last successful index. Returns observed usageCount, bounded snippets, parser confidence, and coverage.| Parameter | Type | Description |
|---|---|---|
| limit | number | Maximum number of usage snippets to return (default: 10) |
| symbol * | string | Symbol name to find references for (for example: parseConfig or UserService) |
get_team_patternsGet actionable team pattern recommendations based on codebase analysis. Returns consensus patterns for DI, state management, testing, library wrappers, etc.| Parameter | Type | Description |
|---|---|---|
| category | string | Pattern category to retrieve |
refresh_indexRe-index the codebase. Supports full re-index or incremental mode. Use incrementalOnly=true to process changed files. Omit skipEmbedding to preserve the last successful mode; true disables embedding and reranker models, false opts into semantic embeddings. Mode changes require a full rebuild.| Parameter | Type | Description |
|---|---|---|
| incrementalOnly | boolean | If true, only re-index files changed since last full index (faster). Default: false (full re-index) |
| reason | string | Reason for refreshing the index (for logging) |
| skipEmbedding | boolean | True selects model-free indexing; false explicitly opts into semantic embeddings. Omit to preserve the last successful mode. |
rememberCALL IMMEDIATELY when user explicitly asks to remember/record something.
USER TRIGGERS:
- "Remember this: [X]"
- "Record this: [Y]"
- "Save this for next time: [Z]"
DO NOT call unless user explicitly requests it.
HOW TO WRITE:
- ONE convention per memory (if user lists 5 things, call this 5 times)
- memory: 5-10 words (the specific rule)
- reason: 1 sentence (why it matters)
- Skip: one-time features, code examples, essays| Parameter | Type | Description |
|---|---|---|
| category * | string | Broader category for filtering |
| memory * | string | What to remember (concise) |
| reason * | string | Why this matters or what breaks otherwise |
| scope | object | Optional scope for this memory. Use { kind: "file", file } or { kind: "symbol", file, symbol }. |
| type * | string | Type of memory being recorded. Use "failure" for things that were tried and failed - prevents repeating the same mistakes. |
search_codebaseSearch the indexed codebase. Default compact mode returns at most 6 ranked results with light graph context (importedByCount, topExports, layer), a patternSummary, bestExample, nextHops, and response-budget metadata. Use mode="full" for today's richer response with full hints arrays and all memories — identical shape as before this parameter existed. IMPORTANT: Pass the intent="edit"|"refactor"|"migrate" to get preflight: edit readiness check with evidence gating.| Parameter | Type | Description |
|---|---|---|
| filters | object | Optional filters |
| includeSnippets | boolean | Include code snippets in results (default: false). Open returned paths with your host file reader; CBC does not expose a file-reading tool. |
| intent | string | Optional. Use "edit", "refactor", or "migrate" to get the full preflight card before making changes. |
| limit | number | Maximum number of results to return (default: 5) |
| mode | string | Response mode. compact (default): max 6 results with light graph context, pattern summary, best example, next hops, and budget metadata. full: today's richer shape + budget metadata. |
| query * | string | Natural language search query |
Security checks
Static checks derived from the repository 10 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 1.6K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by pnpm-lock.yaml.
- !No dynamic code executionScanned 99 source files and found 1 call to eval or shell execution, in src/index.ts:1321. Review how tool inputs reach them before granting credentials.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdio and Streamable HTTPsrc/index.ts:79, src/server/http.ts:17
- Starts other programs
- 2 callssrc/index.ts:1321, src/review-cli.ts:136
- Outbound network calls
- 1 callsrc/embeddings/openai.ts:45
- Writes or deletes files
- 30 callssrc/cli-init.ts:575, src/cli-map.ts:90, src/core/index-generation.ts:343
- Lockfile
- pnpm-lock.yaml
Pattern matches on the source text of 99 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 1.6K words, fetched a month ago. The original in the repository is authoritative.
Read full README