codedev-mcp 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -0
- package/LICENSE +21 -0
- package/README.md +760 -0
- package/dist/analyzers/api-contract.d.ts +46 -0
- package/dist/analyzers/api-contract.d.ts.map +1 -0
- package/dist/analyzers/api-contract.js +319 -0
- package/dist/analyzers/api-contract.js.map +1 -0
- package/dist/analyzers/architecture.d.ts +37 -0
- package/dist/analyzers/architecture.d.ts.map +1 -0
- package/dist/analyzers/architecture.js +149 -0
- package/dist/analyzers/architecture.js.map +1 -0
- package/dist/analyzers/branch-compare.d.ts +46 -0
- package/dist/analyzers/branch-compare.d.ts.map +1 -0
- package/dist/analyzers/branch-compare.js +128 -0
- package/dist/analyzers/branch-compare.js.map +1 -0
- package/dist/analyzers/cicd.d.ts +42 -0
- package/dist/analyzers/cicd.d.ts.map +1 -0
- package/dist/analyzers/cicd.js +237 -0
- package/dist/analyzers/cicd.js.map +1 -0
- package/dist/analyzers/codebase.d.ts +64 -0
- package/dist/analyzers/codebase.d.ts.map +1 -0
- package/dist/analyzers/codebase.js +354 -0
- package/dist/analyzers/codebase.js.map +1 -0
- package/dist/analyzers/complexity-heatmap.d.ts +50 -0
- package/dist/analyzers/complexity-heatmap.d.ts.map +1 -0
- package/dist/analyzers/complexity-heatmap.js +156 -0
- package/dist/analyzers/complexity-heatmap.js.map +1 -0
- package/dist/analyzers/context-pack.d.ts +43 -0
- package/dist/analyzers/context-pack.d.ts.map +1 -0
- package/dist/analyzers/context-pack.js +232 -0
- package/dist/analyzers/context-pack.js.map +1 -0
- package/dist/analyzers/coverage.d.ts +70 -0
- package/dist/analyzers/coverage.d.ts.map +1 -0
- package/dist/analyzers/coverage.js +313 -0
- package/dist/analyzers/coverage.js.map +1 -0
- package/dist/analyzers/db-schema.d.ts +55 -0
- package/dist/analyzers/db-schema.d.ts.map +1 -0
- package/dist/analyzers/db-schema.js +237 -0
- package/dist/analyzers/db-schema.js.map +1 -0
- package/dist/analyzers/dead-code.d.ts +34 -0
- package/dist/analyzers/dead-code.d.ts.map +1 -0
- package/dist/analyzers/dead-code.js +131 -0
- package/dist/analyzers/dead-code.js.map +1 -0
- package/dist/analyzers/dep-vuln.d.ts +36 -0
- package/dist/analyzers/dep-vuln.d.ts.map +1 -0
- package/dist/analyzers/dep-vuln.js +342 -0
- package/dist/analyzers/dep-vuln.js.map +1 -0
- package/dist/analyzers/docs.d.ts +47 -0
- package/dist/analyzers/docs.d.ts.map +1 -0
- package/dist/analyzers/docs.js +473 -0
- package/dist/analyzers/docs.js.map +1 -0
- package/dist/analyzers/git.d.ts +115 -0
- package/dist/analyzers/git.d.ts.map +1 -0
- package/dist/analyzers/git.js +214 -0
- package/dist/analyzers/git.js.map +1 -0
- package/dist/analyzers/iac.d.ts +39 -0
- package/dist/analyzers/iac.d.ts.map +1 -0
- package/dist/analyzers/iac.js +233 -0
- package/dist/analyzers/iac.js.map +1 -0
- package/dist/analyzers/impact.d.ts +51 -0
- package/dist/analyzers/impact.d.ts.map +1 -0
- package/dist/analyzers/impact.js +235 -0
- package/dist/analyzers/impact.js.map +1 -0
- package/dist/analyzers/monorepo.d.ts +36 -0
- package/dist/analyzers/monorepo.d.ts.map +1 -0
- package/dist/analyzers/monorepo.js +233 -0
- package/dist/analyzers/monorepo.js.map +1 -0
- package/dist/analyzers/notebook.d.ts +53 -0
- package/dist/analyzers/notebook.d.ts.map +1 -0
- package/dist/analyzers/notebook.js +149 -0
- package/dist/analyzers/notebook.js.map +1 -0
- package/dist/analyzers/perf-profile.d.ts +39 -0
- package/dist/analyzers/perf-profile.d.ts.map +1 -0
- package/dist/analyzers/perf-profile.js +222 -0
- package/dist/analyzers/perf-profile.js.map +1 -0
- package/dist/analyzers/scaffold.d.ts +46 -0
- package/dist/analyzers/scaffold.d.ts.map +1 -0
- package/dist/analyzers/scaffold.js +313 -0
- package/dist/analyzers/scaffold.js.map +1 -0
- package/dist/analyzers/security.d.ts +42 -0
- package/dist/analyzers/security.d.ts.map +1 -0
- package/dist/analyzers/security.js +281 -0
- package/dist/analyzers/security.js.map +1 -0
- package/dist/analyzers/symbols.d.ts +49 -0
- package/dist/analyzers/symbols.d.ts.map +1 -0
- package/dist/analyzers/symbols.js +212 -0
- package/dist/analyzers/symbols.js.map +1 -0
- package/dist/analyzers/tree-sitter.d.ts +71 -0
- package/dist/analyzers/tree-sitter.d.ts.map +1 -0
- package/dist/analyzers/tree-sitter.js +333 -0
- package/dist/analyzers/tree-sitter.js.map +1 -0
- package/dist/analyzers/type-flow.d.ts +39 -0
- package/dist/analyzers/type-flow.d.ts.map +1 -0
- package/dist/analyzers/type-flow.js +75 -0
- package/dist/analyzers/type-flow.js.map +1 -0
- package/dist/cache/memory-cache.d.ts +130 -0
- package/dist/cache/memory-cache.d.ts.map +1 -0
- package/dist/cache/memory-cache.js +273 -0
- package/dist/cache/memory-cache.js.map +1 -0
- package/dist/config.d.ts +32 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +57 -0
- package/dist/config.js.map +1 -0
- package/dist/constants/instructions.d.ts +2 -0
- package/dist/constants/instructions.d.ts.map +1 -0
- package/dist/constants/instructions.js +82 -0
- package/dist/constants/instructions.js.map +1 -0
- package/dist/db/connection.d.ts +12 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +34 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/json-store.d.ts +111 -0
- package/dist/db/json-store.d.ts.map +1 -0
- package/dist/db/json-store.js +201 -0
- package/dist/db/json-store.js.map +1 -0
- package/dist/db/sqlite-store.d.ts +153 -0
- package/dist/db/sqlite-store.d.ts.map +1 -0
- package/dist/db/sqlite-store.js +388 -0
- package/dist/db/sqlite-store.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/health.d.ts +35 -0
- package/dist/resources/health.d.ts.map +1 -0
- package/dist/resources/health.js +81 -0
- package/dist/resources/health.js.map +1 -0
- package/dist/schemas/output-schemas.d.ts +517 -0
- package/dist/schemas/output-schemas.d.ts.map +1 -0
- package/dist/schemas/output-schemas.js +296 -0
- package/dist/schemas/output-schemas.js.map +1 -0
- package/dist/search/fast-search.d.ts +90 -0
- package/dist/search/fast-search.d.ts.map +1 -0
- package/dist/search/fast-search.js +387 -0
- package/dist/search/fast-search.js.map +1 -0
- package/dist/search/semantic.d.ts +26 -0
- package/dist/search/semantic.d.ts.map +1 -0
- package/dist/search/semantic.js +458 -0
- package/dist/search/semantic.js.map +1 -0
- package/dist/tools/analysis.d.ts +7 -0
- package/dist/tools/analysis.d.ts.map +1 -0
- package/dist/tools/analysis.js +491 -0
- package/dist/tools/analysis.js.map +1 -0
- package/dist/tools/architecture.d.ts +7 -0
- package/dist/tools/architecture.d.ts.map +1 -0
- package/dist/tools/architecture.js +176 -0
- package/dist/tools/architecture.js.map +1 -0
- package/dist/tools/devops.d.ts +7 -0
- package/dist/tools/devops.d.ts.map +1 -0
- package/dist/tools/devops.js +179 -0
- package/dist/tools/devops.js.map +1 -0
- package/dist/tools/docs.d.ts +7 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/docs.js +102 -0
- package/dist/tools/docs.js.map +1 -0
- package/dist/tools/git.d.ts +7 -0
- package/dist/tools/git.d.ts.map +1 -0
- package/dist/tools/git.js +475 -0
- package/dist/tools/git.js.map +1 -0
- package/dist/tools/nav.d.ts +7 -0
- package/dist/tools/nav.d.ts.map +1 -0
- package/dist/tools/nav.js +275 -0
- package/dist/tools/nav.js.map +1 -0
- package/dist/tools/notebook.d.ts +7 -0
- package/dist/tools/notebook.d.ts.map +1 -0
- package/dist/tools/notebook.js +102 -0
- package/dist/tools/notebook.js.map +1 -0
- package/dist/tools/performance.d.ts +7 -0
- package/dist/tools/performance.d.ts.map +1 -0
- package/dist/tools/performance.js +59 -0
- package/dist/tools/performance.js.map +1 -0
- package/dist/tools/quality.d.ts +7 -0
- package/dist/tools/quality.d.ts.map +1 -0
- package/dist/tools/quality.js +279 -0
- package/dist/tools/quality.js.map +1 -0
- package/dist/tools/scaffold.d.ts +7 -0
- package/dist/tools/scaffold.d.ts.map +1 -0
- package/dist/tools/scaffold.js +80 -0
- package/dist/tools/scaffold.js.map +1 -0
- package/dist/tools/search.d.ts +7 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +308 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/security.d.ts +7 -0
- package/dist/tools/security.d.ts.map +1 -0
- package/dist/tools/security.js +138 -0
- package/dist/tools/security.js.map +1 -0
- package/dist/utils/analytics.d.ts +69 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +144 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/concurrency.d.ts +43 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/concurrency.js +78 -0
- package/dist/utils/concurrency.js.map +1 -0
- package/dist/utils/fallback.d.ts +52 -0
- package/dist/utils/fallback.d.ts.map +1 -0
- package/dist/utils/fallback.js +137 -0
- package/dist/utils/fallback.js.map +1 -0
- package/dist/utils/git-hooks.d.ts +24 -0
- package/dist/utils/git-hooks.d.ts.map +1 -0
- package/dist/utils/git-hooks.js +108 -0
- package/dist/utils/git-hooks.js.map +1 -0
- package/dist/utils/languages.d.ts +72 -0
- package/dist/utils/languages.d.ts.map +1 -0
- package/dist/utils/languages.js +463 -0
- package/dist/utils/languages.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +34 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/plugins.d.ts +105 -0
- package/dist/utils/plugins.d.ts.map +1 -0
- package/dist/utils/plugins.js +325 -0
- package/dist/utils/plugins.js.map +1 -0
- package/dist/utils/security.d.ts +17 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +48 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/utils/streaming.d.ts +56 -0
- package/dist/utils/streaming.d.ts.map +1 -0
- package/dist/utils/streaming.js +95 -0
- package/dist/utils/streaming.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/mcp.json +100 -0
- package/package.json +89 -0
package/README.md
ADDED
|
@@ -0,0 +1,760 @@
|
|
|
1
|
+
# codedev-mcp
|
|
2
|
+
|
|
3
|
+
**Universal code development MCP server** — search, analyze, review, and navigate any codebase across 40+ programming languages. 33 tools, semantic search, AST parsing, security scanning, dead code detection, complexity heatmaps, type flow analysis, database schema parsing, API contract discovery, IaC analysis, CI/CD pipeline parsing, monorepo support, dependency vulnerability scanning, performance profiling, code scaffolding, and more. Works with every MCP-compatible IDE. **Zero API keys needed.**
|
|
4
|
+
|
|
5
|
+
The host LLM (Claude, GPT, Gemini) does the reasoning. This server gives it **fast, structured, comprehensive access** to your code.
|
|
6
|
+
|
|
7
|
+
```mermaid
|
|
8
|
+
graph TD
|
|
9
|
+
IDE["🖥️ IDE / Agent<br/>(Claude Code, Cursor, VS Code,<br/>Codex CLI, Gemini CLI)"]
|
|
10
|
+
MCP["⚡ codedev-mcp v3.1<br/>33 tools · 6 resources · 7 prompts<br/>Typed output schemas"]
|
|
11
|
+
FS["📁 File System<br/>Ripgrep + Regex + AST"]
|
|
12
|
+
GIT["🔀 Git History<br/>Log · Diff · Blame · Status"]
|
|
13
|
+
SQLITE["💾 SQLite Index<br/>sql.js WASM · persistent"]
|
|
14
|
+
TOOLCACHE["🗄️ Tool Result Cache<br/>LRU · TTL · hash-keyed"]
|
|
15
|
+
FILECACHE["📦 File Cache<br/>mtime invalidation"]
|
|
16
|
+
WATCH["👁️ File Watcher<br/>Auto cache invalidation"]
|
|
17
|
+
ROOTS["🌲 Multi-Root<br/>workspace support"]
|
|
18
|
+
|
|
19
|
+
IDE <-->|"MCP Protocol<br/>(stdio)"| MCP
|
|
20
|
+
MCP <--> FS
|
|
21
|
+
MCP <--> GIT
|
|
22
|
+
MCP <-.-> SQLITE
|
|
23
|
+
MCP <-.-> TOOLCACHE
|
|
24
|
+
MCP <-.-> FILECACHE
|
|
25
|
+
WATCH -.->|"invalidate"| FILECACHE
|
|
26
|
+
WATCH -.->|"invalidate"| TOOLCACHE
|
|
27
|
+
FS -.->|"file changes"| WATCH
|
|
28
|
+
ROOTS -.->|"multiple dirs"| FS
|
|
29
|
+
|
|
30
|
+
style MCP fill:#7c3aed,stroke:#5b21b6,stroke-width:3px,color:#fff
|
|
31
|
+
style IDE fill:#2563eb,stroke:#1d4ed8,stroke-width:2px,color:#fff
|
|
32
|
+
style FS fill:#059669,stroke:#047857,stroke-width:2px,color:#fff
|
|
33
|
+
style GIT fill:#d97706,stroke:#b45309,stroke-width:2px,color:#fff
|
|
34
|
+
style SQLITE fill:#6b7280,stroke:#4b5563,stroke-width:1px,color:#fff
|
|
35
|
+
style TOOLCACHE fill:#6b7280,stroke:#4b5563,stroke-width:1px,color:#fff
|
|
36
|
+
style FILECACHE fill:#6b7280,stroke:#4b5563,stroke-width:1px,color:#fff
|
|
37
|
+
style WATCH fill:#6b7280,stroke:#4b5563,stroke-width:1px,color:#fff
|
|
38
|
+
style ROOTS fill:#059669,stroke:#047857,stroke-width:1px,color:#fff
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
> **100% local execution. No data leaves your machine. No API keys. No network calls.**
|
|
42
|
+
|
|
43
|
+
## Why?
|
|
44
|
+
|
|
45
|
+
| Problem | codedev-mcp solves it |
|
|
46
|
+
|---|---|
|
|
47
|
+
| AI can't search your codebase efficiently | Ripgrep-powered search + TF-IDF semantic search |
|
|
48
|
+
| AI doesn't understand your project structure | `codebase_map` gives full overview in one call |
|
|
49
|
+
| AI loses context in large codebases | Symbol search, call graphs, dependency maps, targeted file reading |
|
|
50
|
+
| No visibility into code quality | Security scan, test coverage, doc extraction, health checks |
|
|
51
|
+
| Hard to assess change impact | `change_impact` finds affected files, tests, and breaking changes |
|
|
52
|
+
| Different tools for different IDEs | One server works everywhere — Claude Code, Cursor, VS Code, Codex, Gemini CLI |
|
|
53
|
+
| Needs API keys / external services | Zero config, runs 100% local, no network required |
|
|
54
|
+
|
|
55
|
+
## Tools (33)
|
|
56
|
+
|
|
57
|
+
### Search & Navigation
|
|
58
|
+
| Tool | Description |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `search_code` | Fast text/regex search across the codebase (ripgrep-powered) |
|
|
61
|
+
| `search_symbols` | Find functions, classes, types, interfaces by name or pattern |
|
|
62
|
+
| `semantic_search` | **Concept-based search** — find "authentication logic" or "error handling code" without exact strings |
|
|
63
|
+
| `find_references` | Find all usages of a symbol across the codebase |
|
|
64
|
+
| `file_tree` | Smart directory listing with depth control and filtering |
|
|
65
|
+
| `context_pack` | **Smart context packing** — returns the most relevant files/snippets for a question within a token budget |
|
|
66
|
+
|
|
67
|
+
### Analysis & Architecture
|
|
68
|
+
| Tool | Description |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `codebase_map` | Full project overview: languages, frameworks, structure, git info |
|
|
71
|
+
| `analyze_file` | Deep file analysis: symbols, imports, exports, complexity |
|
|
72
|
+
| `read_files` | Read one or multiple files with line ranges (consolidated single/batch) |
|
|
73
|
+
| `dependency_graph` | Import/dependency relationship analysis for any file |
|
|
74
|
+
| `call_graph` | **Function call relationships** — who calls what (tree-sitter AST or regex) |
|
|
75
|
+
| `code_metrics` | LOC, complexity, comment ratios, file size analysis |
|
|
76
|
+
| `type_flow` | **Type flow analysis** — trace where a type/interface flows: definition → imports → params → returns |
|
|
77
|
+
| `architecture_check` | **Layer boundary enforcement** — verify controllers don't import from repositories, etc. |
|
|
78
|
+
| `complexity_heatmap` | **Complexity ranking** — rank files/functions by cyclomatic, cognitive, nesting metrics |
|
|
79
|
+
|
|
80
|
+
### Quality & Security
|
|
81
|
+
| Tool | Description |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `security_scan` | **SAST-lite** — detects SQL injection, XSS, hardcoded secrets, eval, weak crypto, path traversal (15 patterns) |
|
|
84
|
+
| `test_coverage` | Parse lcov/istanbul/cobertura — coverage percentages, uncovered lines, untested functions |
|
|
85
|
+
| `code_docs` | Extract JSDoc, Python docstrings, Rustdoc, Javadoc, Go doc comments; find undocumented APIs |
|
|
86
|
+
| `find_pattern` | Detect TODOs, large files, long functions, hardcoded secrets, empty catches, console logs |
|
|
87
|
+
| `dead_code` | **Dead code detection** — unused exports, orphan files never imported |
|
|
88
|
+
| `dep_vuln_scan` | **Dependency vulnerability scanning** — cross-references lock files against bundled offline advisory database (no network calls) |
|
|
89
|
+
|
|
90
|
+
### Performance
|
|
91
|
+
| Tool | Description |
|
|
92
|
+
|---|---|
|
|
93
|
+
| `perf_profile` | **Performance profiling** — V8 CPU profiles, webpack bundle stats, large files, heavy npm deps with lighter alternatives |
|
|
94
|
+
|
|
95
|
+
### Git & Change Management
|
|
96
|
+
| Tool | Description |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `git_history` | Log, diff, blame, status, branches, contributors, show commits |
|
|
99
|
+
| `change_impact` | **Impact analysis** — given changes, find affected dependents, tests to re-run, breaking changes, risk level |
|
|
100
|
+
| `branch_compare` | **Branch structural diff** — added/modified/deleted files, commits ahead/behind, conflict detection |
|
|
101
|
+
| `git_hooks` | **Pre-commit hooks** — generate, preview, or check status of git hooks for code quality enforcement |
|
|
102
|
+
|
|
103
|
+
### Infrastructure & Ecosystem
|
|
104
|
+
| Tool | Description |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `db_schema` | **Database schema analysis** — Prisma, Drizzle, SQLAlchemy, Django ORM, TypeORM, raw SQL DDL |
|
|
107
|
+
| `api_contracts` | **API endpoint discovery** — OpenAPI/Swagger, GraphQL, Express, NestJS, FastAPI route parsing |
|
|
108
|
+
| `iac_analyze` | **Infrastructure-as-Code** — Terraform, CloudFormation, Kubernetes manifests, Docker Compose |
|
|
109
|
+
| `cicd_analyze` | **CI/CD pipeline parsing** — GitHub Actions, GitLab CI, Jenkins, CircleCI |
|
|
110
|
+
| `monorepo_analyze` | **Monorepo intelligence** — npm/yarn/pnpm workspaces, Cargo, Lerna, Nx, Turborepo |
|
|
111
|
+
|
|
112
|
+
### Code Generation
|
|
113
|
+
| Tool | Description |
|
|
114
|
+
|---|---|
|
|
115
|
+
| `scaffold` | **Boilerplate generation** — auto-detects project conventions and generates components, routes, tests, services, hooks, utils |
|
|
116
|
+
|
|
117
|
+
### Notebooks
|
|
118
|
+
| Tool | Description |
|
|
119
|
+
|---|---|
|
|
120
|
+
| `notebook_analyze` | Jupyter .ipynb analysis — code cells, execution order, imports, health scoring |
|
|
121
|
+
|
|
122
|
+
## MCP Resources (6)
|
|
123
|
+
|
|
124
|
+
Auto-loaded context available without tool calls:
|
|
125
|
+
|
|
126
|
+
| Resource URI | Description |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `project://config` | Project config files (package.json, tsconfig, pyproject.toml, Cargo.toml, etc.) |
|
|
129
|
+
| `project://structure` | Directory tree (top 3 levels, cached) |
|
|
130
|
+
| `project://gitinfo` | Current branch, recent commits, dirty files |
|
|
131
|
+
| `project://languages` | Language breakdown with file counts |
|
|
132
|
+
| `server://stats` | **Server analytics** — uptime, per-tool call counts, avg/max duration, error rates, file cache + tool-result cache hit ratios |
|
|
133
|
+
| `project://suggested_actions` | **AI-suggested next actions** — recommends unused tools and flags issues based on usage patterns |
|
|
134
|
+
|
|
135
|
+
## MCP Prompts (7)
|
|
136
|
+
|
|
137
|
+
Workflow macros that chain multiple tools for common tasks:
|
|
138
|
+
|
|
139
|
+
| Prompt | Description | Tools Chained |
|
|
140
|
+
|---|---|---|
|
|
141
|
+
| `onboard_codebase` | Complete project onboarding overview | codebase_map → file_tree → code_metrics → dependency_graph → git_history → find_pattern |
|
|
142
|
+
| `review_changes` | Pre-commit code review | git_history → change_impact → find_pattern × 3 → security_scan |
|
|
143
|
+
| `investigate_symbol` | Deep-dive into any function/class | search_symbols → find_references → code_docs → dependency_graph → call_graph → git_history |
|
|
144
|
+
| `code_health_check` | Full codebase health audit | code_metrics → find_pattern × 4 → security_scan → test_coverage |
|
|
145
|
+
| `understand_file` | Complete file understanding | analyze_file → read_files → code_docs → dependency_graph → call_graph → git_history → test_coverage |
|
|
146
|
+
| `pr_review` | **PR review workflow** | branch_compare → analyze_file → complexity_heatmap → security_scan → dead_code → test_coverage → architecture_check |
|
|
147
|
+
| `refactor_plan` | **Refactoring priority plan** | complexity_heatmap → dead_code → architecture_check → security_scan → code_docs → test_coverage → find_pattern |
|
|
148
|
+
|
|
149
|
+
## Language Support
|
|
150
|
+
|
|
151
|
+
**Full analysis support** (symbols, imports, docs, call graphs, security patterns) for:
|
|
152
|
+
|
|
153
|
+
TypeScript, JavaScript, Python, Java, Go, Rust, C, C++, C#, Ruby, PHP, Swift, Kotlin
|
|
154
|
+
|
|
155
|
+
**Search + symbol detection** (regex-based extraction) for:
|
|
156
|
+
|
|
157
|
+
Dart, Scala, Elixir, Erlang, Haskell, OCaml, F#, Lua, R, Julia, Perl, Shell/Bash, Clojure, Zig, Nim, Crystal, V
|
|
158
|
+
|
|
159
|
+
**Search-only** (text search, file detection, metrics — no deep symbol extraction):
|
|
160
|
+
|
|
161
|
+
SQL, Solidity, Terraform, YAML, TOML, Markdown, HTML, CSS, SCSS, Vue, Svelte, and any other text file
|
|
162
|
+
|
|
163
|
+
> **Note**: `security_scan` runs SAST patterns against TS, JS, Python, Java, Go, Rust, Ruby, PHP, and C#. Use `search_code` with regex patterns for security checks in other languages.
|
|
164
|
+
|
|
165
|
+
## Prerequisites
|
|
166
|
+
|
|
167
|
+
- **Node.js v18+** — required ([download](https://nodejs.org/))
|
|
168
|
+
- **Git** — must be in your `PATH` for git_history, change_impact, and git-related features
|
|
169
|
+
- **ripgrep** (optional, recommended) — 10-100x faster search; falls back to grep if not installed ([install](https://github.com/BurntSushi/ripgrep#installation))
|
|
170
|
+
|
|
171
|
+
Verify:
|
|
172
|
+
```bash
|
|
173
|
+
node --version # v18.0.0 or higher
|
|
174
|
+
git --version # any recent version
|
|
175
|
+
rg --version # optional but recommended
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Installation
|
|
179
|
+
|
|
180
|
+
### Claude Code
|
|
181
|
+
```bash
|
|
182
|
+
claude mcp add codedev -- npx -y codedev-mcp
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Codex CLI
|
|
186
|
+
Add to `~/.codex/config.toml`:
|
|
187
|
+
```toml
|
|
188
|
+
[mcp_servers.codedev]
|
|
189
|
+
command = "npx"
|
|
190
|
+
args = ["-y", "codedev-mcp"]
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Gemini CLI
|
|
194
|
+
Add to `~/.gemini/settings.json`:
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"mcpServers": {
|
|
198
|
+
"codedev": {
|
|
199
|
+
"command": "npx",
|
|
200
|
+
"args": ["-y", "codedev-mcp"]
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
> **Note**: If Gemini CLI can't find `npx`, use the full path: `"command": "/usr/local/bin/npx"` (run `which npx` to find yours). On Windows, use `npx.cmd` or the full path from `where npx`.
|
|
206
|
+
|
|
207
|
+
### Cursor
|
|
208
|
+
Add to `~/.cursor/mcp.json`:
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"mcpServers": {
|
|
212
|
+
"codedev": {
|
|
213
|
+
"command": "npx",
|
|
214
|
+
"args": ["-y", "codedev-mcp"]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### VS Code / GitHub Copilot
|
|
221
|
+
Command Palette → "MCP: Add Server", or add to `.vscode/settings.json`:
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"mcp": {
|
|
225
|
+
"servers": {
|
|
226
|
+
"codedev": {
|
|
227
|
+
"command": "npx",
|
|
228
|
+
"args": ["-y", "codedev-mcp"]
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Windsurf
|
|
236
|
+
Add to MCP configuration:
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"mcpServers": {
|
|
240
|
+
"codedev": {
|
|
241
|
+
"command": "npx",
|
|
242
|
+
"args": ["-y", "codedev-mcp"]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Claude Desktop
|
|
249
|
+
Add to `claude_desktop_config.json`:
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"mcpServers": {
|
|
253
|
+
"codedev": {
|
|
254
|
+
"command": "npx",
|
|
255
|
+
"args": ["-y", "codedev-mcp"]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Docker
|
|
262
|
+
```bash
|
|
263
|
+
docker build -t codedev-mcp .
|
|
264
|
+
docker run --init -i -v /path/to/project:/workspace:ro codedev-mcp
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Or with docker-compose:
|
|
268
|
+
```bash
|
|
269
|
+
PROJECT_DIR=/path/to/project docker-compose up
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Version Pinning
|
|
273
|
+
|
|
274
|
+
`npx -y codedev-mcp` always fetches the latest version. For stability in CI/CD or team environments, pin a version:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
npx -y codedev-mcp@3.1.0
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Or install globally:
|
|
281
|
+
```bash
|
|
282
|
+
npm install -g codedev-mcp@3.1.0
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Working Directory
|
|
286
|
+
|
|
287
|
+
By default, codedev-mcp uses the current working directory. Override with:
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# Environment variable
|
|
291
|
+
CODEDEV_CWD=/path/to/project npx codedev-mcp
|
|
292
|
+
|
|
293
|
+
# CLI flag
|
|
294
|
+
npx codedev-mcp --cwd=/path/to/project
|
|
295
|
+
|
|
296
|
+
# In MCP config (any IDE)
|
|
297
|
+
{
|
|
298
|
+
"command": "npx",
|
|
299
|
+
"args": ["-y", "codedev-mcp", "--cwd=/path/to/your/project"]
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Multi-Root Workspaces
|
|
304
|
+
|
|
305
|
+
Analyze multiple project directories simultaneously with `--roots`:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# CLI flag (comma-separated)
|
|
309
|
+
npx codedev-mcp --roots=/path/to/frontend,/path/to/backend,/path/to/shared
|
|
310
|
+
|
|
311
|
+
# Environment variable
|
|
312
|
+
CODEDEV_ROOTS=/path/to/frontend,/path/to/backend npx codedev-mcp
|
|
313
|
+
|
|
314
|
+
# In MCP config
|
|
315
|
+
{
|
|
316
|
+
"command": "npx",
|
|
317
|
+
"args": ["-y", "codedev-mcp", "--roots=/path/to/frontend,/path/to/backend"]
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
When multi-root is enabled, tools like `search_code` and `codebase_map` automatically span all roots, prefixing results with the root directory name. The file watcher monitors all roots for cache invalidation. Single-root mode (`--cwd`) remains the default and is fully backward-compatible.
|
|
322
|
+
|
|
323
|
+
## Configuration & Filtering
|
|
324
|
+
|
|
325
|
+
### .gitignore Support
|
|
326
|
+
|
|
327
|
+
**Ripgrep respects `.gitignore` automatically.** When ripgrep is installed, `search_code` and `find_references` will skip files listed in your `.gitignore`, `.rgignore`, and `.ignore` files by default. This is a built-in ripgrep behavior — no configuration needed.
|
|
328
|
+
|
|
329
|
+
When falling back to grep (ripgrep not installed), codedev-mcp uses a hardcoded exclusion list instead.
|
|
330
|
+
|
|
331
|
+
### Default Exclusions
|
|
332
|
+
|
|
333
|
+
All tools automatically exclude these directories, even without a `.gitignore`:
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
node_modules, .git, dist, build, __pycache__, .venv, venv,
|
|
337
|
+
target, bin, obj, .next, coverage, vendor, Pods, .dart_tool
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Custom Filtering
|
|
341
|
+
|
|
342
|
+
Most tools accept `file_glob` or `directory` parameters for targeted analysis:
|
|
343
|
+
|
|
344
|
+
```
|
|
345
|
+
"Find TODO comments only in Python files"
|
|
346
|
+
→ find_pattern with file_glob: "*.py"
|
|
347
|
+
|
|
348
|
+
"Search only in the src/api directory"
|
|
349
|
+
→ search_code with directory: "src/api"
|
|
350
|
+
|
|
351
|
+
"Analyze only Go files for security issues"
|
|
352
|
+
→ security_scan with file_glob: "**/*.go"
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
For batch reads, `max_lines_per_file` (default: 200) prevents overwhelming output from large files.
|
|
356
|
+
|
|
357
|
+
> **No `--ignore` CLI flag exists currently.** Custom exclusions beyond `.gitignore` should be handled via `file_glob` and `directory` parameters on individual tool calls. Plugin support allows adding custom exclusion logic if needed.
|
|
358
|
+
|
|
359
|
+
## Usage Examples
|
|
360
|
+
|
|
361
|
+
Once installed, just talk to your AI naturally:
|
|
362
|
+
|
|
363
|
+
> **"Map out this codebase for me"**
|
|
364
|
+
> → AI calls `codebase_map`
|
|
365
|
+
|
|
366
|
+
> **"Find all authentication-related code"**
|
|
367
|
+
> → AI calls `semantic_search` with query "authentication"
|
|
368
|
+
|
|
369
|
+
> **"Who calls the handlePayment function?"**
|
|
370
|
+
> → AI calls `call_graph` with function_name "handlePayment"
|
|
371
|
+
|
|
372
|
+
> **"Run a security scan"**
|
|
373
|
+
> → AI calls `security_scan`
|
|
374
|
+
|
|
375
|
+
> **"What's the test coverage for src/auth/login.ts?"**
|
|
376
|
+
> → AI calls `test_coverage` with action "file"
|
|
377
|
+
|
|
378
|
+
> **"Show me the docs for the UserService class"**
|
|
379
|
+
> → AI calls `code_docs` with action "extract" and symbol "UserService"
|
|
380
|
+
|
|
381
|
+
> **"What would be affected if I change src/api/routes.ts?"**
|
|
382
|
+
> → AI calls `change_impact` with files ["src/api/routes.ts"]
|
|
383
|
+
|
|
384
|
+
> **"Do a full code review before I commit"**
|
|
385
|
+
> → AI uses the `review_changes` prompt (chains 7 tools)
|
|
386
|
+
|
|
387
|
+
> **"Give me a health check of this codebase"**
|
|
388
|
+
> → AI uses the `code_health_check` prompt (chains 8 tools)
|
|
389
|
+
|
|
390
|
+
> **"Analyze this Jupyter notebook"**
|
|
391
|
+
> → AI calls `notebook_analyze` with action "analyze"
|
|
392
|
+
|
|
393
|
+
> **"What changed in the last 5 commits?"**
|
|
394
|
+
> → AI calls `git_history` with action "log" and with_files true
|
|
395
|
+
|
|
396
|
+
> **"Find dead code and unused exports"**
|
|
397
|
+
> → AI calls `dead_code`
|
|
398
|
+
|
|
399
|
+
> **"What are the most complex files that need refactoring?"**
|
|
400
|
+
> → AI calls `complexity_heatmap` with granularity "file"
|
|
401
|
+
|
|
402
|
+
> **"Compare my feature branch against main"**
|
|
403
|
+
> → AI calls `branch_compare` with base "main"
|
|
404
|
+
|
|
405
|
+
> **"Where does the UserProfile type flow through the codebase?"**
|
|
406
|
+
> → AI calls `type_flow` with type_name "UserProfile"
|
|
407
|
+
|
|
408
|
+
> **"Check for architecture violations"**
|
|
409
|
+
> → AI calls `architecture_check`
|
|
410
|
+
|
|
411
|
+
> **"Show me the database schema"**
|
|
412
|
+
> → AI calls `db_schema`
|
|
413
|
+
|
|
414
|
+
> **"Find all API endpoints in this project"**
|
|
415
|
+
> → AI calls `api_contracts`
|
|
416
|
+
|
|
417
|
+
> **"Analyze the CI/CD pipelines"**
|
|
418
|
+
> → AI calls `cicd_analyze`
|
|
419
|
+
|
|
420
|
+
> **"What Terraform resources are defined?"**
|
|
421
|
+
> → AI calls `iac_analyze`
|
|
422
|
+
|
|
423
|
+
> **"Analyze the monorepo structure"**
|
|
424
|
+
> → AI calls `monorepo_analyze`
|
|
425
|
+
|
|
426
|
+
> **"Review this PR thoroughly"**
|
|
427
|
+
> → AI uses the `pr_review` prompt (chains 7 tools)
|
|
428
|
+
|
|
429
|
+
> **"Create a refactoring plan for technical debt"**
|
|
430
|
+
> → AI uses the `refactor_plan` prompt (chains 7 tools)
|
|
431
|
+
|
|
432
|
+
> **"Get me the most relevant files for understanding the auth flow"**
|
|
433
|
+
> → AI calls `context_pack` with query "authentication flow"
|
|
434
|
+
|
|
435
|
+
> **"Scan dependencies for vulnerabilities"**
|
|
436
|
+
> → AI calls `dep_vuln_scan`
|
|
437
|
+
|
|
438
|
+
> **"Are there any performance bottlenecks?"**
|
|
439
|
+
> → AI calls `perf_profile`
|
|
440
|
+
|
|
441
|
+
> **"Generate a React component following our conventions"**
|
|
442
|
+
> → AI calls `scaffold` with action "generate" and template "component"
|
|
443
|
+
|
|
444
|
+
> **"Set up a pre-commit hook"**
|
|
445
|
+
> → AI calls `git_hooks` with action "generate"
|
|
446
|
+
|
|
447
|
+
## Output Examples
|
|
448
|
+
|
|
449
|
+
### `change_impact` output
|
|
450
|
+
|
|
451
|
+
```
|
|
452
|
+
## Change Impact Analysis
|
|
453
|
+
|
|
454
|
+
3 files changed, 2 symbols modified
|
|
455
|
+
8 dependent files affected
|
|
456
|
+
2 test files need re-running
|
|
457
|
+
⚠️ 1 breaking changes detected
|
|
458
|
+
Risk level: CRITICAL
|
|
459
|
+
|
|
460
|
+
### Changed symbols:
|
|
461
|
+
modified: handlePayment in src/billing/payments.ts
|
|
462
|
+
removed: legacyCharge in src/billing/payments.ts
|
|
463
|
+
|
|
464
|
+
### Affected files (8):
|
|
465
|
+
src/api/routes.ts
|
|
466
|
+
src/checkout/flow.ts
|
|
467
|
+
src/webhooks/stripe.ts
|
|
468
|
+
...
|
|
469
|
+
|
|
470
|
+
### Tests to re-run (2):
|
|
471
|
+
tests/billing/payments.test.ts
|
|
472
|
+
tests/api/routes.test.ts
|
|
473
|
+
|
|
474
|
+
### ⚠️ Breaking changes:
|
|
475
|
+
Removed: legacyCharge from src/billing/payments.ts
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### `security_scan` output
|
|
479
|
+
|
|
480
|
+
```
|
|
481
|
+
## Security Scan Report
|
|
482
|
+
|
|
483
|
+
Total findings: 4
|
|
484
|
+
Severity breakdown: critical: 1, high: 2, medium: 1
|
|
485
|
+
|
|
486
|
+
Dependencies: 12 direct, 347 total (lockfile ✅)
|
|
487
|
+
|
|
488
|
+
### Findings:
|
|
489
|
+
|
|
490
|
+
🔴 [CRITICAL] Hardcoded secret/credential
|
|
491
|
+
src/config/database.ts:14
|
|
492
|
+
const DB_PASSWORD = "super_secret_123"
|
|
493
|
+
💡 Move secrets to environment variables or a secret manager.
|
|
494
|
+
|
|
495
|
+
🟠 [HIGH] Potential XSS via innerHTML
|
|
496
|
+
src/components/render.ts:42
|
|
497
|
+
element.innerHTML = userInput
|
|
498
|
+
💡 Use textContent instead of innerHTML, or sanitize with DOMPurify.
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
### `test_coverage` output
|
|
502
|
+
|
|
503
|
+
```
|
|
504
|
+
## Test Coverage (lcov)
|
|
505
|
+
|
|
506
|
+
Files: 47
|
|
507
|
+
Lines: 2,841/4,120 (68%)
|
|
508
|
+
Functions: 189/267 (70%)
|
|
509
|
+
Branches: 412/680 (60%)
|
|
510
|
+
|
|
511
|
+
### Lowest coverage files:
|
|
512
|
+
src/billing/payments.ts 23% lines 20% funcs
|
|
513
|
+
src/api/middleware.ts 34% lines 25% funcs
|
|
514
|
+
src/utils/crypto.ts 41% lines 33% funcs
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
## Performance
|
|
518
|
+
|
|
519
|
+
- **Search**: Ripgrep-powered, handles 100K+ file codebases in < 1 second
|
|
520
|
+
- **Two-tier caching**: File-level mtime cache + tool-result LRU cache (2,000 entries, 120s TTL) — repeated tool calls return instantly
|
|
521
|
+
- **SQLite persistent index**: sql.js WASM-based SQLite stores file/symbol/import indices across restarts — no re-indexing on startup
|
|
522
|
+
- **File watching**: Automatic cache invalidation when files change (chokidar) — invalidates both file cache and tool-result cache
|
|
523
|
+
- **Multi-root workspaces**: Analyze multiple project directories in a single session with `--roots=dir1,dir2`
|
|
524
|
+
- **AST parsing**: Tree-sitter WASM when available, regex fallback for all languages
|
|
525
|
+
- **Smart filtering**: Respects `.gitignore`, auto-excludes build dirs, configurable via `file_glob`
|
|
526
|
+
- **Large file protection**: Batch reads truncate at 200 lines/file by default (configurable); line-range reading for targeted access
|
|
527
|
+
- **No network**: Everything runs locally, zero latency from API calls
|
|
528
|
+
|
|
529
|
+
## Architecture
|
|
530
|
+
|
|
531
|
+
```
|
|
532
|
+
src/
|
|
533
|
+
├── index.ts # MCP server: 33 tools, 6 resources, 7 prompts (~2,326 lines)
|
|
534
|
+
├── schemas/
|
|
535
|
+
│ └── output-schemas.ts # Zod output schemas for all 33 tools (typed structuredContent)
|
|
536
|
+
├── search/
|
|
537
|
+
│ ├── fast-search.ts # Ripgrep/grep search engine
|
|
538
|
+
│ └── semantic.ts # TF-IDF semantic search with synonym expansion
|
|
539
|
+
├── analyzers/
|
|
540
|
+
│ ├── symbols.ts # Symbol extraction (40+ languages)
|
|
541
|
+
│ ├── codebase.ts # Codebase mapping & metrics
|
|
542
|
+
│ ├── git.ts # Git operations (log, diff, blame, status)
|
|
543
|
+
│ ├── tree-sitter.ts # AST parsing, call graphs, scope analysis
|
|
544
|
+
│ ├── coverage.ts # Test coverage (lcov, istanbul, cobertura)
|
|
545
|
+
│ ├── docs.ts # Documentation extraction (JSDoc, docstrings, etc.)
|
|
546
|
+
│ ├── security.ts # SAST-lite security scanning (15 patterns)
|
|
547
|
+
│ ├── impact.ts # Change impact analysis
|
|
548
|
+
│ ├── notebook.ts # Jupyter notebook parsing
|
|
549
|
+
│ ├── dead-code.ts # Dead code detection (unused exports, orphan files)
|
|
550
|
+
│ ├── branch-compare.ts # Structural git branch comparison
|
|
551
|
+
│ ├── complexity-heatmap.ts # Complexity ranking with A-F grading
|
|
552
|
+
│ ├── context-pack.ts # Smart context window packing
|
|
553
|
+
│ ├── type-flow.ts # Type/interface flow tracing
|
|
554
|
+
│ ├── architecture.ts # Layer boundary rule enforcement
|
|
555
|
+
│ ├── db-schema.ts # Database schema parsing (6 ORMs + raw SQL)
|
|
556
|
+
│ ├── api-contract.ts # API endpoint discovery (REST, GraphQL, tRPC)
|
|
557
|
+
│ ├── iac.ts # Infrastructure-as-Code analysis
|
|
558
|
+
│ ├── cicd.ts # CI/CD pipeline parsing
|
|
559
|
+
│ ├── monorepo.ts # Monorepo workspace intelligence
|
|
560
|
+
│ ├── dep-vuln.ts # Dependency vulnerability scanning
|
|
561
|
+
│ ├── perf-profile.ts # Performance profiling & bundle analysis
|
|
562
|
+
│ └── scaffold.ts # Code generation from project conventions
|
|
563
|
+
├── cache/
|
|
564
|
+
│ └── memory-cache.ts # File cache (mtime) + tool-result LRU cache (2K entries, 120s TTL)
|
|
565
|
+
├── db/
|
|
566
|
+
│ ├── json-store.ts # JSON-file persistent index (legacy)
|
|
567
|
+
│ └── sqlite-store.ts # SQLite persistent index (sql.js WASM, zero native deps)
|
|
568
|
+
├── types/
|
|
569
|
+
│ └── sql.js.d.ts # Type declarations for sql.js WASM module
|
|
570
|
+
└── utils/
|
|
571
|
+
├── languages.ts # Language detection & patterns (40+)
|
|
572
|
+
├── plugins.ts # Plugin architecture + npm marketplace auto-discovery
|
|
573
|
+
├── analytics.ts # Per-tool usage analytics & tracking
|
|
574
|
+
└── git-hooks.ts # Git hook generation & management
|
|
575
|
+
|
|
576
|
+
Dockerfile # Multi-stage Docker build (alpine, non-root, tini)
|
|
577
|
+
docker-compose.yml # Docker Compose for easy deployment
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
**~10,200 lines of TypeScript** across 36 source files. 7 runtime dependencies.
|
|
581
|
+
|
|
582
|
+
## Plugins
|
|
583
|
+
|
|
584
|
+
Extend codedev-mcp with custom analyzers without forking:
|
|
585
|
+
|
|
586
|
+
### Local Plugins
|
|
587
|
+
|
|
588
|
+
```
|
|
589
|
+
~/.codedev-mcp/plugins/
|
|
590
|
+
└── my-plugin/
|
|
591
|
+
├── plugin.json # Manifest: name, tools, patterns, languages
|
|
592
|
+
└── index.js # Tool handler implementations
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
Place plugins in `~/.codedev-mcp/plugins/` (global) or `.codedev-mcp/plugins/` (per-project). Plugins are loaded automatically at server startup.
|
|
596
|
+
|
|
597
|
+
### npm Marketplace Plugins
|
|
598
|
+
|
|
599
|
+
Plugins published to npm with the `codedev-plugin-*` naming convention are auto-discovered:
|
|
600
|
+
|
|
601
|
+
```bash
|
|
602
|
+
# Install a marketplace plugin
|
|
603
|
+
npm install codedev-plugin-terraform
|
|
604
|
+
|
|
605
|
+
# Or use scoped packages
|
|
606
|
+
npm install @myorg/codedev-plugin-custom-rules
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
codedev-mcp automatically searches `node_modules` in three locations (project, `~/.codedev-mcp/node_modules`, global) for packages matching `codedev-plugin-*` or `@*/codedev-plugin-*`. Each package should export a `plugin.json` manifest (or a `codedev` key in its `package.json`).
|
|
610
|
+
|
|
611
|
+
To publish your own marketplace plugin, use the scaffold tool:
|
|
612
|
+
```
|
|
613
|
+
"Generate a plugin scaffold"
|
|
614
|
+
→ scaffold with action "generate", template "plugin"
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
This generates both `plugin.json` (native) and `package.json` (npm marketplace) with publishing instructions.
|
|
618
|
+
|
|
619
|
+
## Security
|
|
620
|
+
|
|
621
|
+
- **Path traversal protection**: All file parameters validated via `safePath()` — no access outside project root
|
|
622
|
+
- **Read-only**: All 33 tools are read-only, never modify files or git state
|
|
623
|
+
- **Tool safety**: All tools designed as read-only and idempotent — safe to re-run without side effects
|
|
624
|
+
- **Docker**: Non-root user, minimal alpine image, tini init, read-only workspace mount
|
|
625
|
+
- **No network**: Zero external API calls, all processing is local
|
|
626
|
+
|
|
627
|
+
## Troubleshooting
|
|
628
|
+
|
|
629
|
+
### "Server not found" or "npx: command not found"
|
|
630
|
+
|
|
631
|
+
Ensure Node.js is installed and `npx` is in your system PATH:
|
|
632
|
+
```bash
|
|
633
|
+
which npx # Should print a path
|
|
634
|
+
npx --version # Should print a version
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
For GUI-based IDEs (Claude Desktop, Cursor), the system PATH may differ from your terminal. Try using the full path:
|
|
638
|
+
```json
|
|
639
|
+
{ "command": "/usr/local/bin/npx", "args": ["-y", "codedev-mcp"] }
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
On Windows, use `npx.cmd` instead of `npx`, or the full path from `where npx`.
|
|
643
|
+
|
|
644
|
+
### Slow search on large codebases
|
|
645
|
+
|
|
646
|
+
Install [ripgrep](https://github.com/BurntSushi/ripgrep#installation) for 10-100x faster search. codedev-mcp auto-detects and uses it. Without ripgrep, it falls back to grep which is significantly slower on large repos.
|
|
647
|
+
|
|
648
|
+
```bash
|
|
649
|
+
# macOS
|
|
650
|
+
brew install ripgrep
|
|
651
|
+
|
|
652
|
+
# Ubuntu/Debian
|
|
653
|
+
sudo apt install ripgrep
|
|
654
|
+
|
|
655
|
+
# Windows
|
|
656
|
+
winget install BurntSushi.ripgrep
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
### Large file reads timing out or producing huge output
|
|
660
|
+
|
|
661
|
+
Use line ranges for large files instead of reading the entire file:
|
|
662
|
+
```
|
|
663
|
+
"Read lines 100-150 of that large config file"
|
|
664
|
+
→ read_files with path: "config.json", start_line: 100, end_line: 150
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
Batch reads automatically truncate at 200 lines per file. Override with `max_lines_per_file`.
|
|
668
|
+
|
|
669
|
+
### Git tools returning errors
|
|
670
|
+
|
|
671
|
+
Ensure the working directory is inside a Git repository and `git` is in your PATH:
|
|
672
|
+
```bash
|
|
673
|
+
cd /your/project && git status # Should work without errors
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
### Cache showing stale results
|
|
677
|
+
|
|
678
|
+
codedev-mcp uses a two-tier cache: a file-level mtime cache and a tool-result LRU cache (2,000 entries, 120s TTL). Both caches invalidate automatically on file changes via the chokidar file watcher. If you see stale results, the file watcher may not have detected a change (e.g., changes made by external tools). Tool-result cache entries also expire after 120 seconds. The SQLite persistent index auto-saves every 5 minutes.
|
|
679
|
+
|
|
680
|
+
### Tree-sitter not loading
|
|
681
|
+
|
|
682
|
+
Tree-sitter AST parsing requires WASM grammar files. Without them, codedev-mcp falls back to regex-based parsing (which works well for most use cases). Tree-sitter support is optional and primarily improves accuracy for call graphs and scope analysis.
|
|
683
|
+
|
|
684
|
+
### Docker: server doesn't shut down cleanly
|
|
685
|
+
|
|
686
|
+
Use `--init` flag (or tini) for proper signal handling:
|
|
687
|
+
```bash
|
|
688
|
+
docker run --init -i -v /path/to/project:/workspace:ro codedev-mcp
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
The provided Dockerfile already includes tini for this purpose.
|
|
692
|
+
|
|
693
|
+
## v3.1.0 Changelog (from v3.0.0)
|
|
694
|
+
|
|
695
|
+
**Output Schemas Migration:** All 33 tools migrated from `server.tool()` to `server.registerTool()` with Zod-defined `outputSchema` and `structuredContent` on every success return (66 return paths total). MCP clients can now consume typed JSON alongside human-readable text.
|
|
696
|
+
|
|
697
|
+
**SQLite Persistent Index:** Replaced JSON-file index with sql.js WASM-based SQLite (`.codedev-mcp/index.sqlite`). Schema includes 5 tables (meta, files, symbols, imports, usage_stats) with proper indices. Zero native compilation — works everywhere Node.js runs. Auto-saves every 5 minutes with graceful shutdown persistence. Analytics data is now persisted across sessions.
|
|
698
|
+
|
|
699
|
+
**Reliability & Security:** Implemented structured logging (JSON-formatted stderr) replacing `console.log` for better observability. Secured all database queries with prepared statements (zero string concatenation). Enhanced `safePath` validation to robustly prevent directory traversal attacks.
|
|
700
|
+
|
|
701
|
+
**Multi-Root Workspace Support:** New `--roots=dir1,dir2` flag and `CODEDEV_ROOTS` env var for analyzing multiple project directories in a single session. `search_code` and `codebase_map` span all roots automatically. File watcher monitors all roots for cache invalidation. Fully backward-compatible — single-root mode remains the default.
|
|
702
|
+
|
|
703
|
+
**Tool Result Cache:** New conversation-aware LRU cache (2,000 entries, 120s TTL) that caches complete tool responses keyed by `hash(toolName + params)`. Uses FNV-1a-inspired hashing for speed. Automatic invalidation on file changes via the file watcher. Stats visible in `server://stats`.
|
|
704
|
+
|
|
705
|
+
**npm Marketplace Plugin Discovery:** `loadPlugins()` now auto-discovers npm packages matching `codedev-plugin-*` (including scoped `@org/codedev-plugin-*`) from project `node_modules`, `~/.codedev-mcp/node_modules`, and global `node_modules`. Scaffold tool generates both `plugin.json` and `package.json` with publishing instructions.
|
|
706
|
+
|
|
707
|
+
**Infrastructure:** Orphan file cleanup (removed unused context-packer.ts), dual-layer cache stats in `server://stats` (file cache + tool-result cache), graceful SQLite shutdown on SIGINT/SIGTERM, type declarations for sql.js.
|
|
708
|
+
|
|
709
|
+
## v3.0.0 Changelog (from v2.0.0)
|
|
710
|
+
|
|
711
|
+
**New tools (+15):** dead_code, branch_compare, complexity_heatmap, context_pack, type_flow, architecture_check, db_schema, api_contracts, iac_analyze, cicd_analyze, monorepo_analyze, dep_vuln_scan, perf_profile, scaffold, git_hooks
|
|
712
|
+
|
|
713
|
+
**New resources (+2):** server://stats (analytics dashboard), project://suggested_actions (AI-guided next steps)
|
|
714
|
+
|
|
715
|
+
**New prompts (+2):** pr_review (comprehensive PR review workflow), refactor_plan (prioritized refactoring plan)
|
|
716
|
+
|
|
717
|
+
**New capabilities:** Dead code detection (unused exports, orphan files), structural branch comparison, complexity heatmaps with A-F grading, smart context packing for LLM token budgets, type flow tracing across codebase, architectural layer boundary enforcement, database schema parsing (Prisma, Drizzle, SQLAlchemy, Django, TypeORM, raw SQL), API endpoint discovery (OpenAPI, GraphQL, Express, NestJS, FastAPI), infrastructure-as-code analysis (Terraform, CloudFormation, K8s, Docker Compose), CI/CD pipeline parsing (GitHub Actions, GitLab CI, Jenkins, CircleCI), monorepo workspace intelligence (npm/yarn/pnpm, Cargo, Lerna, Nx, Turborepo), dependency vulnerability scanning (npm, Cargo, pip, Go lock files), performance profiling (V8 CPU profiles, webpack bundles, heavy deps), code scaffolding from project conventions, git hook generation/preview
|
|
718
|
+
|
|
719
|
+
**Infrastructure:** Per-tool analytics tracking (call count, duration, errors, cache hits), usage-based suggested actions engine, consistent tool hint annotations
|
|
720
|
+
|
|
721
|
+
## v2.0.0 Changelog (from v1.0.0)
|
|
722
|
+
|
|
723
|
+
**New tools (+7):** semantic_search, call_graph, test_coverage, code_docs, security_scan, change_impact, notebook_analyze
|
|
724
|
+
|
|
725
|
+
**New MCP features:** 4 Resources (project config, structure, git info, languages), 5 Prompts (onboard, review, investigate, health check, understand file)
|
|
726
|
+
|
|
727
|
+
**Tool consolidation:** read_file + batch_read → `read_files` (12 → 18 tools net)
|
|
728
|
+
|
|
729
|
+
**Infrastructure:** In-memory cache (100x faster repeats), file watcher (auto-invalidation), tree-sitter AST (accurate parsing), JSON persistent index, plugin architecture, Docker packaging (multi-stage, non-root, tini)
|
|
730
|
+
|
|
731
|
+
## Local Development
|
|
732
|
+
|
|
733
|
+
```bash
|
|
734
|
+
git clone https://github.com/YOUR_USERNAME/codedev-mcp.git
|
|
735
|
+
cd codedev-mcp
|
|
736
|
+
npm install
|
|
737
|
+
npm run build
|
|
738
|
+
|
|
739
|
+
# Test with MCP Inspector
|
|
740
|
+
npm run inspect
|
|
741
|
+
|
|
742
|
+
# Test with Claude Code
|
|
743
|
+
claude mcp add codedev-local -- node /path/to/codedev-mcp/dist/index.js
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
## Contributing
|
|
747
|
+
|
|
748
|
+
PRs welcome! Areas of interest:
|
|
749
|
+
- Tree-sitter grammar WASM files for more languages
|
|
750
|
+
- Additional security scanning patterns (Solidity, Terraform, etc.)
|
|
751
|
+
- LSP bridge integration for type-aware analysis
|
|
752
|
+
- OAuth 2.1 HTTP transport for remote deployment
|
|
753
|
+
- Performance optimizations for enterprise-scale repos (500K+ files)
|
|
754
|
+
- Custom `--ignore` CLI flag for exclusion patterns beyond `.gitignore`
|
|
755
|
+
- Additional output schema refinements for better structuredContent
|
|
756
|
+
- npm marketplace plugins for domain-specific analysis
|
|
757
|
+
|
|
758
|
+
## License
|
|
759
|
+
|
|
760
|
+
MIT
|