gdep-mcp 0.1.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/README.md +76 -0
- package/bin/gdep-mcp.js +57 -0
- package/bin/postinstall.js +85 -0
- package/package.json +26 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# gdep-mcp
|
|
2
|
+
|
|
3
|
+
> MCP server for [gdep](https://github.com/pirua-game/gdep) — Game Codebase Analysis Tool
|
|
4
|
+
|
|
5
|
+
Enables Claude Desktop, Cursor, and other MCP-compatible AI agents to analyze game projects
|
|
6
|
+
(Unity, Unreal Engine 5, C++, C#) using gdep.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g gdep-mcp
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Automatically installs the `gdep` Python package and `mcp[cli]` dependencies.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Add to your AI agent config:
|
|
19
|
+
|
|
20
|
+
**Claude Desktop** (`claude_desktop_config.json`):
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"gdep": {
|
|
25
|
+
"command": "gdep-mcp"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Cursor** (`.cursor/mcp.json`):
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"gdep": {
|
|
36
|
+
"command": "gdep-mcp"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> Each tool accepts `project_path` as a call parameter — no path needed in the config.
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
- Node.js 18+
|
|
47
|
+
- Python 3.11+
|
|
48
|
+
- .NET Runtime 8.0+ (for C#/Unity analysis)
|
|
49
|
+
|
|
50
|
+
## Available Tools (13)
|
|
51
|
+
|
|
52
|
+
| Tool | Description |
|
|
53
|
+
|------|-------------|
|
|
54
|
+
| `get_project_context` | Project overview — call first |
|
|
55
|
+
| `analyze_impact_and_risk` | Change impact + lint |
|
|
56
|
+
| `trace_gameplay_flow` | Call chain tracing (C++→BP) |
|
|
57
|
+
| `inspect_architectural_health` | Tech debt diagnosis |
|
|
58
|
+
| `explore_class_semantics` | Class structure + AI summary |
|
|
59
|
+
| `execute_gdep_cli` | Raw CLI access |
|
|
60
|
+
| `find_unity_event_bindings` | Unity Inspector bindings |
|
|
61
|
+
| `analyze_unity_animator` | Unity Animator state machine |
|
|
62
|
+
| `analyze_ue5_gas` | UE5 GAS full analysis |
|
|
63
|
+
| `analyze_ue5_behavior_tree` | BehaviorTree structure |
|
|
64
|
+
| `analyze_ue5_state_tree` | StateTree structure |
|
|
65
|
+
| `analyze_ue5_animation` | ABP + Montage analysis |
|
|
66
|
+
| `analyze_ue5_blueprint_mapping` | C++ → Blueprint mapping |
|
|
67
|
+
|
|
68
|
+
## Links
|
|
69
|
+
|
|
70
|
+
- [GitHub Repository](https://github.com/pirua-game/gdep)
|
|
71
|
+
- [Full Documentation](https://github.com/pirua-game/gdep/blob/main/README.md)
|
|
72
|
+
- [Benchmark](https://github.com/pirua-game/gdep/blob/main/docs/BENCHMARK.md)
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
Apache-2.0
|
package/bin/gdep-mcp.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* gdep-mcp — CLI entry point
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* gdep-mcp
|
|
7
|
+
*
|
|
8
|
+
* Launches the gdep MCP server (Python).
|
|
9
|
+
* Each tool call passes project_path as a parameter — no args needed here.
|
|
10
|
+
* The Python gdep package must be installed: pip install gdep
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const { spawn } = require('child_process');
|
|
14
|
+
const os = require('os');
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
|
|
18
|
+
const pyCmd = os.platform() === 'win32' ? 'python' : 'python3';
|
|
19
|
+
|
|
20
|
+
function findServerScript() {
|
|
21
|
+
const { execSync } = require('child_process');
|
|
22
|
+
try {
|
|
23
|
+
const pipShow = execSync(`${pyCmd} -m pip show gdep`, { encoding: 'utf8' });
|
|
24
|
+
const locationMatch = pipShow.match(/Location: (.+)/);
|
|
25
|
+
if (locationMatch) {
|
|
26
|
+
// pip install gdep installs to site-packages/gdep_mcp/server.py
|
|
27
|
+
const candidate = path.join(locationMatch[1].trim(), 'gdep_mcp', 'server.py');
|
|
28
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
29
|
+
}
|
|
30
|
+
} catch {}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const serverScript = findServerScript();
|
|
35
|
+
|
|
36
|
+
let child;
|
|
37
|
+
if (serverScript) {
|
|
38
|
+
child = spawn(pyCmd, [serverScript], {
|
|
39
|
+
stdio: 'inherit',
|
|
40
|
+
env: { ...process.env, PYTHONUTF8: '1' },
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
child = spawn(pyCmd, ['-m', 'gdep_mcp.server'], {
|
|
44
|
+
stdio: 'inherit',
|
|
45
|
+
env: { ...process.env, PYTHONUTF8: '1' },
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
child.on('error', (err) => {
|
|
50
|
+
console.error(`Failed to start gdep MCP server: ${err.message}`);
|
|
51
|
+
console.error('Make sure gdep is installed: pip install gdep "mcp[cli]"');
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
child.on('exit', (code) => {
|
|
56
|
+
process.exit(code ?? 0);
|
|
57
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* gdep-mcp — postinstall script
|
|
4
|
+
*
|
|
5
|
+
* Automatically installs the gdep Python package and MCP dependencies
|
|
6
|
+
* after `npm install -g gdep-mcp`.
|
|
7
|
+
*
|
|
8
|
+
* Steps:
|
|
9
|
+
* 1. Check Python 3.11+ is available
|
|
10
|
+
* 2. pip install gdep (from PyPI)
|
|
11
|
+
* 3. pip install "mcp[cli]"
|
|
12
|
+
* 4. Print Claude Desktop config snippet
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const { execSync, spawnSync } = require('child_process');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
const os = require('os');
|
|
18
|
+
|
|
19
|
+
const BOLD = '\x1b[1m';
|
|
20
|
+
const GREEN = '\x1b[32m';
|
|
21
|
+
const YELLOW = '\x1b[33m';
|
|
22
|
+
const CYAN = '\x1b[36m';
|
|
23
|
+
const RESET = '\x1b[0m';
|
|
24
|
+
|
|
25
|
+
function log(msg) { console.log(msg); }
|
|
26
|
+
function ok(msg) { console.log(`${GREEN}✓${RESET} ${msg}`); }
|
|
27
|
+
function warn(msg) { console.log(`${YELLOW}⚠${RESET} ${msg}`); }
|
|
28
|
+
function info(msg) { console.log(`${CYAN}→${RESET} ${msg}`); }
|
|
29
|
+
|
|
30
|
+
log(`\n${BOLD}gdep-mcp postinstall${RESET}\n`);
|
|
31
|
+
|
|
32
|
+
// ── 1. Python check ───────────────────────────────────────────
|
|
33
|
+
const pyCmd = os.platform() === 'win32' ? 'python' : 'python3';
|
|
34
|
+
let pyVersion = null;
|
|
35
|
+
try {
|
|
36
|
+
pyVersion = execSync(`${pyCmd} --version`, { encoding: 'utf8' }).trim();
|
|
37
|
+
ok(`Python found: ${pyVersion}`);
|
|
38
|
+
} catch {
|
|
39
|
+
warn('Python 3.11+ not found. Please install Python and re-run:');
|
|
40
|
+
warn(' pip install gdep "mcp[cli]"');
|
|
41
|
+
process.exit(0); // soft fail — don't block npm install
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const versionMatch = pyVersion.match(/Python (\d+)\.(\d+)/);
|
|
45
|
+
if (versionMatch) {
|
|
46
|
+
const [, major, minor] = versionMatch.map(Number);
|
|
47
|
+
if (major < 3 || (major === 3 && minor < 11)) {
|
|
48
|
+
warn(`Python 3.11+ required (found ${major}.${minor}). Please upgrade.`);
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ── 2. pip install gdep ───────────────────────────────────────
|
|
54
|
+
info('Installing gdep Python package...');
|
|
55
|
+
const pipInstall = spawnSync(pyCmd, ['-m', 'pip', 'install', '--upgrade', 'gdep', 'mcp[cli]'], {
|
|
56
|
+
stdio: 'inherit',
|
|
57
|
+
shell: true,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (pipInstall.status !== 0) {
|
|
61
|
+
warn('pip install failed. Try manually: pip install gdep "mcp[cli]"');
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
ok('gdep and mcp[cli] installed successfully.');
|
|
65
|
+
|
|
66
|
+
// ── 3. Print config snippet ───────────────────────────────────
|
|
67
|
+
const serverScript = path.join(__dirname, 'server.js');
|
|
68
|
+
log(`
|
|
69
|
+
${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}
|
|
70
|
+
${GREEN}${BOLD} gdep-mcp installed!${RESET}
|
|
71
|
+
|
|
72
|
+
Add this to your Claude Desktop config
|
|
73
|
+
(claude_desktop_config.json):
|
|
74
|
+
|
|
75
|
+
${CYAN}{
|
|
76
|
+
"mcpServers": {
|
|
77
|
+
"gdep": {
|
|
78
|
+
"command": "gdep-mcp",
|
|
79
|
+
"args": ["/path/to/your/game/project"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}${RESET}
|
|
83
|
+
|
|
84
|
+
${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}
|
|
85
|
+
`);
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gdep-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for gdep — Game Codebase Analysis Tool (Unity/UE5/C++/C#)",
|
|
5
|
+
"keywords": ["mcp", "game", "unity", "unreal", "ue5", "dependency", "analysis", "claude", "cursor", "ai"],
|
|
6
|
+
"author": "pirua-game",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/pirua-game/gdep.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/pirua-game/gdep",
|
|
13
|
+
"bin": {
|
|
14
|
+
"gdep-mcp": "./bin/gdep-mcp.js"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"postinstall": "node bin/postinstall.js"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin/",
|
|
24
|
+
"README.md"
|
|
25
|
+
]
|
|
26
|
+
}
|