@giauphan/codeatlas-mcp 1.0.0 β 1.2.3
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/LICENSE +21 -0
- package/README.md +104 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/index.ts +367 -0
- package/package.json +7 -8
- package/tsconfig.json +17 -0
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GiauPhan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# πΊοΈ CodeAtlas MCP Server
|
|
2
|
+
|
|
3
|
+
**MCP server for [CodeAtlas](https://github.com/giauphan/CodeAtlas) β Expose code analysis data to AI assistants**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@giauphan/codeatlas-mcp)
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## What is this?
|
|
10
|
+
|
|
11
|
+
A standalone [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that reads CodeAtlas analysis data and exposes it to AI assistants like **Gemini, Claude, Cursor**, etc.
|
|
12
|
+
|
|
13
|
+
## Tools
|
|
14
|
+
|
|
15
|
+
| Tool | Description |
|
|
16
|
+
|------|-------------|
|
|
17
|
+
| `list_projects` | List all projects analyzed by CodeAtlas |
|
|
18
|
+
| `get_project_structure` | Get modules, classes, functions, variables |
|
|
19
|
+
| `get_dependencies` | Get import/call/containment relationships |
|
|
20
|
+
| `get_insights` | Get AI-generated code insights |
|
|
21
|
+
| `search_entities` | Search for functions, classes by name |
|
|
22
|
+
| `get_file_entities` | Get all entities in a specific file |
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
1. Install the [CodeAtlas VS Code extension](https://github.com/giauphan/CodeAtlas)
|
|
27
|
+
2. Run **CodeAtlas: Analyze Project** in VS Code to generate `.codeatlas/analysis.json`
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g @giauphan/codeatlas-mcp
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Or use directly with `npx` (no install needed):
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @giauphan/codeatlas-mcp
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Configuration
|
|
42
|
+
|
|
43
|
+
Add to your AI assistant's MCP config:
|
|
44
|
+
|
|
45
|
+
### Gemini (`.gemini/settings.json`)
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"codeatlas": {
|
|
51
|
+
"command": "npx",
|
|
52
|
+
"args": ["-y", "@giauphan/codeatlas-mcp"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Claude (`claude_desktop_config.json`)
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"mcpServers": {
|
|
63
|
+
"codeatlas": {
|
|
64
|
+
"command": "npx",
|
|
65
|
+
"args": ["-y", "@giauphan/codeatlas-mcp"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Cursor (`.cursor/mcp.json`)
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"codeatlas": {
|
|
77
|
+
"command": "npx",
|
|
78
|
+
"args": ["-y", "@giauphan/codeatlas-mcp"]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Environment Variables
|
|
85
|
+
|
|
86
|
+
| Variable | Description |
|
|
87
|
+
|----------|-------------|
|
|
88
|
+
| `CODEATLAS_PROJECT_DIR` | Optional: specify a project directory to analyze |
|
|
89
|
+
|
|
90
|
+
The server auto-discovers projects by scanning `~/` for `.codeatlas/analysis.json` files.
|
|
91
|
+
|
|
92
|
+
## Development
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/giauphan/codeatlas-mcp.git
|
|
96
|
+
cd codeatlas-mcp
|
|
97
|
+
npm install
|
|
98
|
+
npm run build
|
|
99
|
+
npm start
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
[MIT](LICENSE)
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/index.ts
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import * as fs from "fs";
|
|
7
|
+
import * as path from "path";
|
|
8
|
+
|
|
9
|
+
interface GraphNode {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
type: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
filePath?: string;
|
|
15
|
+
line?: number;
|
|
16
|
+
val?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface GraphLink {
|
|
20
|
+
source: string;
|
|
21
|
+
target: string;
|
|
22
|
+
type: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface AnalysisResult {
|
|
26
|
+
graph: { nodes: GraphNode[]; links: GraphLink[] };
|
|
27
|
+
insights: any[];
|
|
28
|
+
stats: { files: number; functions: number; classes: number; dependencies: number; circularDeps: number };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Auto-discover all projects with .codeatlas/analysis.json
|
|
32
|
+
function discoverProjects(): { name: string; dir: string; analysisPath: string; modifiedAt: Date }[] {
|
|
33
|
+
const projects: { name: string; dir: string; analysisPath: string; modifiedAt: Date }[] = [];
|
|
34
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE || "/home";
|
|
35
|
+
|
|
36
|
+
// Scan directories for .codeatlas/analysis.json
|
|
37
|
+
const searchDirs: string[] = [];
|
|
38
|
+
|
|
39
|
+
// Add env var project if specified
|
|
40
|
+
if (process.env.CODEATLAS_PROJECT_DIR) {
|
|
41
|
+
searchDirs.push(process.env.CODEATLAS_PROJECT_DIR);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Add cwd
|
|
45
|
+
searchDirs.push(process.cwd());
|
|
46
|
+
|
|
47
|
+
// Scan home directory children (max depth 2)
|
|
48
|
+
try {
|
|
49
|
+
const homeDirs = fs.readdirSync(homeDir);
|
|
50
|
+
for (const d of homeDirs) {
|
|
51
|
+
if (d.startsWith(".")) continue;
|
|
52
|
+
const fullPath = path.join(homeDir, d);
|
|
53
|
+
try {
|
|
54
|
+
if (fs.statSync(fullPath).isDirectory()) {
|
|
55
|
+
searchDirs.push(fullPath);
|
|
56
|
+
}
|
|
57
|
+
} catch { /* skip */ }
|
|
58
|
+
}
|
|
59
|
+
} catch { /* skip */ }
|
|
60
|
+
|
|
61
|
+
// Check each directory for .codeatlas/analysis.json
|
|
62
|
+
const seen = new Set<string>();
|
|
63
|
+
for (const dir of searchDirs) {
|
|
64
|
+
const analysisPath = path.join(dir, ".codeatlas", "analysis.json");
|
|
65
|
+
if (seen.has(analysisPath)) continue;
|
|
66
|
+
seen.add(analysisPath);
|
|
67
|
+
|
|
68
|
+
if (fs.existsSync(analysisPath)) {
|
|
69
|
+
try {
|
|
70
|
+
const stat = fs.statSync(analysisPath);
|
|
71
|
+
projects.push({
|
|
72
|
+
name: path.basename(dir),
|
|
73
|
+
dir,
|
|
74
|
+
analysisPath,
|
|
75
|
+
modifiedAt: stat.mtime,
|
|
76
|
+
});
|
|
77
|
+
} catch { /* skip */ }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Sort by most recently modified
|
|
82
|
+
projects.sort((a, b) => b.modifiedAt.getTime() - a.modifiedAt.getTime());
|
|
83
|
+
return projects;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function loadAnalysis(projectDir?: string): { analysis: AnalysisResult; projectName: string; projectDir: string } | null {
|
|
87
|
+
const projects = discoverProjects();
|
|
88
|
+
if (projects.length === 0) return null;
|
|
89
|
+
|
|
90
|
+
let target = projects[0]; // default: most recently modified
|
|
91
|
+
|
|
92
|
+
if (projectDir) {
|
|
93
|
+
const match = projects.find(
|
|
94
|
+
(p) => p.dir === projectDir || p.name.toLowerCase() === projectDir.toLowerCase()
|
|
95
|
+
);
|
|
96
|
+
if (match) target = match;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
try {
|
|
100
|
+
const data = fs.readFileSync(target.analysisPath, "utf-8");
|
|
101
|
+
return { analysis: JSON.parse(data), projectName: target.name, projectDir: target.dir };
|
|
102
|
+
} catch {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Create MCP server
|
|
108
|
+
const server = new McpServer({
|
|
109
|
+
name: "codeatlas",
|
|
110
|
+
version: "1.2.2",
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Tool 0: List all discovered projects
|
|
114
|
+
server.tool(
|
|
115
|
+
"list_projects",
|
|
116
|
+
"List all projects that have been analyzed by CodeAtlas. Returns project names, paths, and last analysis time.",
|
|
117
|
+
{},
|
|
118
|
+
async () => {
|
|
119
|
+
const projects = discoverProjects();
|
|
120
|
+
if (projects.length === 0) {
|
|
121
|
+
return { content: [{ type: "text" as const, text: "No analyzed projects found. Run 'CodeAtlas: Analyze Project' in VS Code first." }] };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const result = {
|
|
125
|
+
projectCount: projects.length,
|
|
126
|
+
projects: projects.map((p) => ({
|
|
127
|
+
name: p.name,
|
|
128
|
+
path: p.dir,
|
|
129
|
+
lastAnalyzed: p.modifiedAt.toISOString(),
|
|
130
|
+
})),
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
// Tool 1: Get project structure
|
|
138
|
+
server.tool(
|
|
139
|
+
"get_project_structure",
|
|
140
|
+
"Get all modules, classes, functions, and variables in the analyzed project. Returns entity type, name, file path, and line number.",
|
|
141
|
+
{
|
|
142
|
+
project: z.string().optional().describe("Project name or path (auto-detects if omitted)"),
|
|
143
|
+
type: z.enum(["all", "module", "class", "function", "variable"]).optional().describe("Filter by entity type"),
|
|
144
|
+
limit: z.number().optional().describe("Max results to return (default: 100)"),
|
|
145
|
+
},
|
|
146
|
+
async ({ project, type, limit }) => {
|
|
147
|
+
const loaded = loadAnalysis(project);
|
|
148
|
+
if (!loaded) {
|
|
149
|
+
return { content: [{ type: "text" as const, text: "No analysis data found. Run 'CodeAtlas: Analyze Project' in VS Code first." }] };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
let nodes = loaded.analysis.graph.nodes;
|
|
153
|
+
if (type && type !== "all") {
|
|
154
|
+
nodes = nodes.filter((n) => n.type === type);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const maxResults = limit || 100;
|
|
158
|
+
const truncated = nodes.length > maxResults;
|
|
159
|
+
nodes = nodes.slice(0, maxResults);
|
|
160
|
+
|
|
161
|
+
const result = {
|
|
162
|
+
project: loaded.projectName,
|
|
163
|
+
projectDir: loaded.projectDir,
|
|
164
|
+
total: loaded.analysis.graph.nodes.length,
|
|
165
|
+
showing: nodes.length,
|
|
166
|
+
truncated,
|
|
167
|
+
stats: loaded.analysis.stats,
|
|
168
|
+
entities: nodes.map((n) => ({
|
|
169
|
+
name: n.label,
|
|
170
|
+
type: n.type,
|
|
171
|
+
filePath: n.filePath || null,
|
|
172
|
+
line: n.line || null,
|
|
173
|
+
})),
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
// Tool 2: Get dependencies
|
|
181
|
+
server.tool(
|
|
182
|
+
"get_dependencies",
|
|
183
|
+
"Get import/call/containment relationships between entities. Shows how modules, classes, and functions are connected.",
|
|
184
|
+
{
|
|
185
|
+
project: z.string().optional().describe("Project name or path"),
|
|
186
|
+
source: z.string().optional().describe("Filter by source entity name"),
|
|
187
|
+
target: z.string().optional().describe("Filter by target entity name"),
|
|
188
|
+
relationship: z.enum(["all", "import", "call", "contains"]).optional().describe("Filter by relationship type"),
|
|
189
|
+
limit: z.number().optional().describe("Max results (default: 100)"),
|
|
190
|
+
},
|
|
191
|
+
async ({ project, source, target, relationship, limit }) => {
|
|
192
|
+
const loaded = loadAnalysis(project);
|
|
193
|
+
if (!loaded) {
|
|
194
|
+
return { content: [{ type: "text" as const, text: "No analysis data found. Run 'CodeAtlas: Analyze Project' first." }] };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const nodeMap = new Map(loaded.analysis.graph.nodes.map((n) => [n.id, n.label]));
|
|
198
|
+
let links = loaded.analysis.graph.links;
|
|
199
|
+
|
|
200
|
+
if (relationship && relationship !== "all") {
|
|
201
|
+
links = links.filter((l) => l.type === relationship);
|
|
202
|
+
}
|
|
203
|
+
if (source) {
|
|
204
|
+
links = links.filter((l) => {
|
|
205
|
+
const label = nodeMap.get(l.source) || l.source;
|
|
206
|
+
return label.toLowerCase().includes(source.toLowerCase());
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (target) {
|
|
210
|
+
links = links.filter((l) => {
|
|
211
|
+
const label = nodeMap.get(l.target) || l.target;
|
|
212
|
+
return label.toLowerCase().includes(target.toLowerCase());
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const maxResults = limit || 100;
|
|
217
|
+
const truncated = links.length > maxResults;
|
|
218
|
+
links = links.slice(0, maxResults);
|
|
219
|
+
|
|
220
|
+
const result = {
|
|
221
|
+
total: loaded.analysis.graph.links.length,
|
|
222
|
+
showing: links.length,
|
|
223
|
+
truncated,
|
|
224
|
+
dependencies: links.map((l) => ({
|
|
225
|
+
source: nodeMap.get(l.source) || l.source,
|
|
226
|
+
target: nodeMap.get(l.target) || l.target,
|
|
227
|
+
type: l.type,
|
|
228
|
+
})),
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
// Tool 3: Get AI insights
|
|
236
|
+
server.tool(
|
|
237
|
+
"get_insights",
|
|
238
|
+
"Get AI-generated code insights including refactoring suggestions, security issues, and maintainability analysis.",
|
|
239
|
+
{},
|
|
240
|
+
async () => {
|
|
241
|
+
const loaded = loadAnalysis();
|
|
242
|
+
if (!loaded) {
|
|
243
|
+
return { content: [{ type: "text" as const, text: "No analysis data found. Run 'CodeAtlas: Analyze Project' first." }] };
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const result = {
|
|
247
|
+
project: loaded.projectName,
|
|
248
|
+
stats: loaded.analysis.stats,
|
|
249
|
+
insights: loaded.analysis.insights,
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
// Tool 4: Search entities
|
|
257
|
+
server.tool(
|
|
258
|
+
"search_entities",
|
|
259
|
+
"Search for functions, classes, modules, or variables by name. Supports fuzzy matching.",
|
|
260
|
+
{
|
|
261
|
+
project: z.string().optional().describe("Project name or path"),
|
|
262
|
+
query: z.string().describe("Search query (case-insensitive, partial match)"),
|
|
263
|
+
type: z.enum(["all", "module", "class", "function", "variable"]).optional().describe("Filter by entity type"),
|
|
264
|
+
},
|
|
265
|
+
async ({ project, query, type }) => {
|
|
266
|
+
const loaded = loadAnalysis(project);
|
|
267
|
+
if (!loaded) {
|
|
268
|
+
return { content: [{ type: "text" as const, text: "No analysis data found. Run 'CodeAtlas: Analyze Project' first." }] };
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
let nodes = loaded.analysis.graph.nodes;
|
|
272
|
+
if (type && type !== "all") {
|
|
273
|
+
nodes = nodes.filter((n) => n.type === type);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const q = query.toLowerCase();
|
|
277
|
+
const matches = nodes.filter((n) => n.label.toLowerCase().includes(q));
|
|
278
|
+
|
|
279
|
+
// For each match, find its relationships
|
|
280
|
+
const links = loaded.analysis.graph.links;
|
|
281
|
+
const nodeMap = new Map(loaded.analysis.graph.nodes.map((n) => [n.id, n.label]));
|
|
282
|
+
|
|
283
|
+
const result = {
|
|
284
|
+
query,
|
|
285
|
+
matchCount: matches.length,
|
|
286
|
+
results: matches.slice(0, 50).map((n) => {
|
|
287
|
+
const incomingLinks = links
|
|
288
|
+
.filter((l) => l.target === n.id)
|
|
289
|
+
.map((l) => ({ from: nodeMap.get(l.source) || l.source, type: l.type }));
|
|
290
|
+
const outgoingLinks = links
|
|
291
|
+
.filter((l) => l.source === n.id)
|
|
292
|
+
.map((l) => ({ to: nodeMap.get(l.target) || l.target, type: l.type }));
|
|
293
|
+
|
|
294
|
+
return {
|
|
295
|
+
name: n.label,
|
|
296
|
+
type: n.type,
|
|
297
|
+
filePath: n.filePath || null,
|
|
298
|
+
line: n.line || null,
|
|
299
|
+
incomingRelationships: incomingLinks,
|
|
300
|
+
outgoingRelationships: outgoingLinks,
|
|
301
|
+
};
|
|
302
|
+
}),
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
306
|
+
}
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
// Tool 5: Get file entities
|
|
310
|
+
server.tool(
|
|
311
|
+
"get_file_entities",
|
|
312
|
+
"Get all entities (classes, functions, variables) defined in a specific file.",
|
|
313
|
+
{
|
|
314
|
+
project: z.string().optional().describe("Project name or path"),
|
|
315
|
+
filePath: z.string().describe("File path (partial match, e.g. 'User.php' or 'src/models')"),
|
|
316
|
+
},
|
|
317
|
+
async ({ project, filePath }) => {
|
|
318
|
+
const loaded = loadAnalysis(project);
|
|
319
|
+
if (!loaded) {
|
|
320
|
+
return { content: [{ type: "text" as const, text: "No analysis data found. Run 'CodeAtlas: Analyze Project' first." }] };
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const q = filePath.toLowerCase().replace(/\\/g, "/");
|
|
324
|
+
const matches = loaded.analysis.graph.nodes.filter((n) => {
|
|
325
|
+
const fp = (n.filePath || n.id).toLowerCase().replace(/\\/g, "/");
|
|
326
|
+
return fp.includes(q);
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
const links = loaded.analysis.graph.links;
|
|
330
|
+
const nodeMap = new Map(loaded.analysis.graph.nodes.map((n) => [n.id, n.label]));
|
|
331
|
+
|
|
332
|
+
// Group by file
|
|
333
|
+
const byFile = new Map<string, typeof matches>();
|
|
334
|
+
for (const n of matches) {
|
|
335
|
+
const fp = n.filePath || "unknown";
|
|
336
|
+
if (!byFile.has(fp)) byFile.set(fp, []);
|
|
337
|
+
byFile.get(fp)!.push(n);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const result = {
|
|
341
|
+
query: filePath,
|
|
342
|
+
filesFound: byFile.size,
|
|
343
|
+
files: Array.from(byFile.entries()).map(([fp, entities]) => ({
|
|
344
|
+
filePath: fp,
|
|
345
|
+
entities: entities.map((e) => ({
|
|
346
|
+
name: e.label,
|
|
347
|
+
type: e.type,
|
|
348
|
+
line: e.line || null,
|
|
349
|
+
dependencies: links
|
|
350
|
+
.filter((l) => l.source === e.id)
|
|
351
|
+
.map((l) => ({ to: nodeMap.get(l.target) || l.target, type: l.type })),
|
|
352
|
+
})),
|
|
353
|
+
})),
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
|
|
360
|
+
// Start server
|
|
361
|
+
async function main() {
|
|
362
|
+
const transport = new StdioServerTransport();
|
|
363
|
+
await server.connect(transport);
|
|
364
|
+
console.error("CodeAtlas MCP server running on stdio");
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
main().catch(console.error);
|
package/package.json
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giauphan/codeatlas-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "MCP server for CodeAtlas β exposes code analysis data to AI assistants via Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
7
8
|
"bin": {
|
|
8
9
|
"codeatlas-mcp": "dist/index.js"
|
|
9
10
|
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist/",
|
|
12
|
-
"README.md",
|
|
13
|
-
"LICENSE"
|
|
14
|
-
],
|
|
15
11
|
"scripts": {
|
|
16
12
|
"build": "tsc",
|
|
17
13
|
"start": "node dist/index.js",
|
|
@@ -30,11 +26,14 @@
|
|
|
30
26
|
"architecture",
|
|
31
27
|
"dependencies"
|
|
32
28
|
],
|
|
33
|
-
"author":
|
|
29
|
+
"author": {
|
|
30
|
+
"name": "GiauPhan",
|
|
31
|
+
"email": "zero99ck9@gmail.com"
|
|
32
|
+
},
|
|
34
33
|
"license": "MIT",
|
|
35
34
|
"repository": {
|
|
36
35
|
"type": "git",
|
|
37
|
-
"url": "https://github.com/giauphan/codeatlas-mcp.git"
|
|
36
|
+
"url": "git+https://github.com/giauphan/codeatlas-mcp.git"
|
|
38
37
|
},
|
|
39
38
|
"bugs": {
|
|
40
39
|
"url": "https://github.com/giauphan/codeatlas-mcp/issues"
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "NodeNext",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"lib": ["ES2022"],
|
|
6
|
+
"outDir": "dist",
|
|
7
|
+
"rootDir": ".",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"moduleResolution": "NodeNext",
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"declaration": true
|
|
14
|
+
},
|
|
15
|
+
"include": ["index.ts"],
|
|
16
|
+
"exclude": ["node_modules", "dist"]
|
|
17
|
+
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":""}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAwB7B,2DAA2D;AAC3D,SAAS,gBAAgB;IACvB,MAAM,QAAQ,GAA4E,EAAE,CAAC;IAC7F,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,OAAO,CAAC;IAEvE,gDAAgD;IAChD,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,mCAAmC;IACnC,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;QACtC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;IAED,UAAU;IACV,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAE/B,6CAA6C;IAC7C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YAChC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