@graphpilot-oss/graphpilot 0.0.1 → 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/CHANGELOG.md +73 -126
- package/README.md +359 -101
- package/dist/cli.js +20 -0
- package/dist/cli.js.map +1 -1
- package/dist/indexer.js +3 -3
- package/dist/indexer.js.map +1 -1
- package/dist/init.d.ts +28 -0
- package/dist/init.js +112 -0
- package/dist/init.js.map +1 -0
- package/dist/interactions.d.ts +5 -4
- package/dist/interactions.js +0 -0
- package/dist/interactions.js.map +1 -1
- package/dist/mcp.js +126 -46
- package/dist/mcp.js.map +1 -1
- package/dist/repo-resolve.d.ts +47 -0
- package/dist/repo-resolve.js +195 -0
- package/dist/repo-resolve.js.map +1 -0
- package/dist/storage.js +10 -1
- package/dist/storage.js.map +1 -1
- package/dist/validation.js +30 -4
- package/dist/validation.js.map +1 -1
- package/dist/watcher.d.ts +10 -0
- package/dist/watcher.js +70 -7
- package/dist/watcher.js.map +1 -1
- package/examples/README.md +105 -0
- package/examples/claude-code/README.md +125 -0
- package/examples/claude-code/claude-routing.md +102 -0
- package/examples/claude-code/claude_config.json +8 -0
- package/examples/cline/.clinerules +39 -0
- package/examples/cline/README.md +104 -0
- package/examples/cline/cline_mcp_settings.json +10 -0
- package/examples/continue/.continuerules +39 -0
- package/examples/continue/README.md +98 -0
- package/examples/continue/config.json +13 -0
- package/examples/cursor/.cursorrules +39 -0
- package/examples/cursor/README.md +98 -0
- package/examples/cursor/mcp.json +11 -0
- package/examples/windsurf/.windsurfrules +39 -0
- package/examples/windsurf/README.md +85 -0
- package/examples/windsurf/mcp_config.json +8 -0
- package/package.json +12 -3
- package/.editorconfig +0 -15
- package/.github/CODEOWNERS +0 -22
- package/.github/FUNDING.yml +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
- package/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -19
- package/.github/dependabot.yml +0 -15
- package/.github/workflows/ci.yml +0 -62
- package/.github/workflows/release.yml +0 -50
- package/.prettierignore +0 -19
- package/.prettierrc.json +0 -20
- package/CODE_OF_CONDUCT.md +0 -83
- package/CONTRIBUTING.md +0 -111
- package/bench/README.md +0 -544
- package/bench/results/agent-tier-2026-05-22.md +0 -28
- package/bench/results/agent-tier-summary.md +0 -44
- package/bench/results/baseline-tier-2026-05-22.md +0 -23
- package/bench/results/baseline.json +0 -810
- package/bench/results/baseline.md +0 -28
- package/bench/run-agent-tier-automated.ts +0 -234
- package/bench/run-agent-tier.md +0 -125
- package/bench/run-baseline-tier.ts +0 -200
- package/bench/run.ts +0 -210
- package/bench/runner-baseline.ts +0 -177
- package/bench/runner-graphpilot.ts +0 -131
- package/bench/score-agent-tier.ts +0 -191
- package/bench/score.ts +0 -59
- package/bench/tasks.ts +0 -236
- package/dist/provenance.d.ts +0 -74
- package/dist/provenance.js +0 -95
- package/dist/provenance.js.map +0 -1
- package/docs/architecture.md +0 -311
- package/docs/limitations.md +0 -156
- package/docs/mcp-setup.md +0 -231
- package/docs/quickstart.md +0 -202
- package/eslint.config.js +0 -148
- package/lefthook.yml +0 -81
- package/pnpm-workspace.yaml +0 -6
- package/scripts/smoke-stdio.mjs +0 -97
- package/src/cli.ts +0 -171
- package/src/edges.ts +0 -202
- package/src/git.ts +0 -255
- package/src/graph-schema.ts +0 -229
- package/src/impact.ts +0 -218
- package/src/indexer.ts +0 -152
- package/src/interactions.ts +0 -0
- package/src/mcp.ts +0 -652
- package/src/parser.ts +0 -138
- package/src/provenance.ts +0 -115
- package/src/query.ts +0 -148
- package/src/redact.ts +0 -122
- package/src/storage.ts +0 -115
- package/src/symbols.ts +0 -173
- package/src/validation.ts +0 -69
- package/src/validators.ts +0 -253
- package/src/watcher.ts +0 -383
- package/tests/edges.test.ts +0 -175
- package/tests/fixtures/sample.ts +0 -32
- package/tests/git.test.ts +0 -303
- package/tests/graph-schema.test.ts +0 -321
- package/tests/impact.test.ts +0 -454
- package/tests/interactions.test.ts +0 -180
- package/tests/lint-policy.test.ts +0 -106
- package/tests/mcp-stdio.test.ts +0 -171
- package/tests/mcp.test.ts +0 -335
- package/tests/parser.test.ts +0 -31
- package/tests/provenance.test.ts +0 -132
- package/tests/query.test.ts +0 -160
- package/tests/redact.test.ts +0 -167
- package/tests/security.test.ts +0 -144
- package/tests/symbols.test.ts +0 -78
- package/tests/validators.test.ts +0 -193
- package/tests/watcher.test.ts +0 -250
- package/tsconfig.json +0 -18
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# GraphPilot — Editor & Agent Examples
|
|
2
|
+
|
|
3
|
+
Ready-to-paste configurations for every MCP-compatible coding agent we've tested.
|
|
4
|
+
|
|
5
|
+
Each subfolder follows the same shape:
|
|
6
|
+
|
|
7
|
+
- `README.md` — step-by-step install for that client (the file you're skimming this for)
|
|
8
|
+
- A sample config file (`.claude.json`, `mcp.json`, `cline_mcp_settings.json`, etc.) you can copy verbatim and edit the path in
|
|
9
|
+
- Where the client supports it: a `CLAUDE.md` / `.cursorrules` / equivalent routing template that nudges the agent to use GraphPilot tools automatically
|
|
10
|
+
|
|
11
|
+
## Pick your client
|
|
12
|
+
|
|
13
|
+
| Client | Folder | Config file location |
|
|
14
|
+
| --------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| Claude Code | [`claude-code/`](claude-code/) | `~/.claude.json` |
|
|
16
|
+
| Cursor | [`cursor/`](cursor/) | `~/.cursor/mcp.json` |
|
|
17
|
+
| Cline (VS Code) | [`cline/`](cline/) | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
18
|
+
| Windsurf | [`windsurf/`](windsurf/) | `~/.codeium/windsurf/mcp_config.json` |
|
|
19
|
+
| Continue.dev | [`continue/`](continue/) | `~/.continue/config.json` |
|
|
20
|
+
| Anything else | [`docs/mcp-setup.md`](../docs/mcp-setup.md) | n/a — generic stdio MCP instructions |
|
|
21
|
+
|
|
22
|
+
## Two ways GraphPilot can be launched
|
|
23
|
+
|
|
24
|
+
Every example shows both forms. Pick whichever matches how you installed GraphPilot.
|
|
25
|
+
|
|
26
|
+
### A) Local build (pre-npm, contributors, dev mode)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
30
|
+
cd graphpilot && pnpm install && pnpm build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then point your client at:
|
|
34
|
+
|
|
35
|
+
```jsonc
|
|
36
|
+
{
|
|
37
|
+
"command": "node",
|
|
38
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> **Replace `/absolute/path/to/graphpilot/`** with the real path on your machine. Tilde (`~`) is _not_ expanded by most MCP clients — use the full absolute path.
|
|
43
|
+
|
|
44
|
+
### B) Once v0.1.0 ships to npm
|
|
45
|
+
|
|
46
|
+
```jsonc
|
|
47
|
+
{
|
|
48
|
+
"command": "npx",
|
|
49
|
+
"args": ["graphpilot", "mcp"],
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or install globally and reference by name:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install -g @graphpilot-oss/graphpilot
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Cross-platform notes
|
|
60
|
+
|
|
61
|
+
| Platform | Path style |
|
|
62
|
+
| -------- | ------------------------------------------------------------------------------- |
|
|
63
|
+
| macOS | `/Users/<you>/code/graphpilot/dist/cli.js` |
|
|
64
|
+
| Linux | `/home/<you>/code/graphpilot/dist/cli.js` |
|
|
65
|
+
| Windows | `C:\\Users\\<you>\\code\\graphpilot\\dist\\cli.js` (escape backslashes in JSON) |
|
|
66
|
+
|
|
67
|
+
On Windows in particular, **use double-backslashes in JSON paths** or use forward slashes — both work, single backslashes don't.
|
|
68
|
+
|
|
69
|
+
## Verifying the connection
|
|
70
|
+
|
|
71
|
+
After editing the config and **fully restarting** the client (quitting completely, not just closing the window), trigger the client's MCP listing:
|
|
72
|
+
|
|
73
|
+
- **Claude Code:** type `/mcp` in chat
|
|
74
|
+
- **Cursor:** Settings → MCP
|
|
75
|
+
- **Cline:** the Cline panel → MCP Servers
|
|
76
|
+
- **Windsurf:** Cascade panel → MCP tools
|
|
77
|
+
- **Continue:** Settings → MCP Servers
|
|
78
|
+
|
|
79
|
+
You should see `graphpilot` with **5 tools** (`gp_index`, `gp_recall`, `gp_callers`, `gp_impact`, `gp_stats`). If not, see [`docs/mcp-setup.md`](../docs/mcp-setup.md#troubleshooting).
|
|
80
|
+
|
|
81
|
+
## Indexing your first repo
|
|
82
|
+
|
|
83
|
+
Once the MCP server is connected, ask the agent to index your project — or run it directly:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
node /abs/path/to/graphpilot/dist/cli.js index /path/to/your/repo
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then keep the index fresh as you edit:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
node /abs/path/to/graphpilot/dist/cli.js watch /path/to/your/repo
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Watch mode produces sub-10 ms incremental updates on every save. The on-disk `graph.json` is rewritten atomically — the agent always sees a consistent view, even mid-edit.
|
|
96
|
+
|
|
97
|
+
## End-to-end smoke test
|
|
98
|
+
|
|
99
|
+
From inside the agent:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
Use graphpilot's gp_stats tool to show the index for this repo.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
If the response includes a repo id, file/symbol/edge counts, and an `indexedAt` timestamp — the wire is healthy.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Claude Code (Anthropic) + GraphPilot
|
|
2
|
+
|
|
3
|
+
Step-by-step install of GraphPilot as an MCP server inside Claude Code.
|
|
4
|
+
|
|
5
|
+
## 1. Build GraphPilot
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
9
|
+
cd graphpilot && pnpm install && pnpm build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The compiled CLI lands at `dist/cli.js`. Verify:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node dist/cli.js --help
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 2. Edit `~/.claude.json`
|
|
19
|
+
|
|
20
|
+
Create the file if it doesn't exist. Add the `mcpServers` block:
|
|
21
|
+
|
|
22
|
+
```jsonc
|
|
23
|
+
{
|
|
24
|
+
"mcpServers": {
|
|
25
|
+
"graphpilot": {
|
|
26
|
+
"command": "node",
|
|
27
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
A copy-paste-ready sample is in [`claude_config.json`](./claude_config.json). Replace `/absolute/path/to/graphpilot/` with the real path on your machine.
|
|
34
|
+
|
|
35
|
+
Once v0.1.0 ships to npm, you can simplify to:
|
|
36
|
+
|
|
37
|
+
```jsonc
|
|
38
|
+
{
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"graphpilot": {
|
|
41
|
+
"command": "npx",
|
|
42
|
+
"args": ["graphpilot", "mcp"],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 3. Fully restart Claude Code
|
|
49
|
+
|
|
50
|
+
Quit completely — don't just close the window. `~/.claude.json` is read on launch only.
|
|
51
|
+
|
|
52
|
+
## 4. Verify the wire
|
|
53
|
+
|
|
54
|
+
In any Claude Code session, type:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
/mcp
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You should see:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
graphpilot
|
|
64
|
+
5 tools: gp_index, gp_recall, gp_callers, gp_impact, gp_stats
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If the server doesn't appear, run `node /abs/path/to/graphpilot/dist/cli.js mcp` in a terminal and check stderr for the error — most config bugs surface immediately.
|
|
68
|
+
|
|
69
|
+
## 5. Index a repo
|
|
70
|
+
|
|
71
|
+
From the terminal of any TS/JS project:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
node /abs/path/to/graphpilot/dist/cli.js index .
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Or ask Claude:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
Use graphpilot's gp_index tool on this repo.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 6. Make Claude reach for GraphPilot automatically
|
|
84
|
+
|
|
85
|
+
Copy [`CLAUDE.md`](./CLAUDE.md) (the routing template in this folder) into the **root of the repo you indexed**. Restart Claude one more time. From that point on, structural questions route to GraphPilot without you having to say _"use graphpilot to…"_.
|
|
86
|
+
|
|
87
|
+
Try:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
Who calls authenticate in this repo?
|
|
91
|
+
|
|
92
|
+
What breaks if I rename parseFile?
|
|
93
|
+
|
|
94
|
+
Find every function whose name contains 'parse'.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
You should see a `Calling graphpilot/gp_*` line in the response — that's the tool firing.
|
|
98
|
+
|
|
99
|
+
## 7. Keep the index fresh (optional)
|
|
100
|
+
|
|
101
|
+
In a side terminal:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
node /abs/path/to/graphpilot/dist/cli.js watch /path/to/your/repo
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Sub-10 ms incremental updates on every save. Ctrl+C to stop.
|
|
108
|
+
|
|
109
|
+
## Troubleshooting
|
|
110
|
+
|
|
111
|
+
| Symptom | Fix |
|
|
112
|
+
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
113
|
+
| `/mcp` doesn't list `graphpilot` | Edits to `~/.claude.json` don't hot-reload. Fully quit Claude Code and relaunch. |
|
|
114
|
+
| Tools list but every call says "no index" | Path mismatch — pass an explicit `path: "/abs/repo"` argument, or index from the same `cwd` Claude uses. |
|
|
115
|
+
| `pnpm install` fails on native modules | `pnpm approve-builds --all && pnpm rebuild`. On Node 23+, drop to Node 22 LTS — tree-sitter is finicky on 23. |
|
|
116
|
+
|
|
117
|
+
Anything not listed: [open an issue](https://github.com/graphpilot-oss/graphpilot/issues) with the stderr from `node dist/cli.js mcp`.
|
|
118
|
+
|
|
119
|
+
## Files in this folder
|
|
120
|
+
|
|
121
|
+
| File | Purpose |
|
|
122
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
123
|
+
| [`README.md`](./README.md) | This walkthrough |
|
|
124
|
+
| [`claude_config.json`](./claude_config.json) | Sample `~/.claude.json` content — copy the `mcpServers` block into yours |
|
|
125
|
+
| [`CLAUDE.md`](./CLAUDE.md) | Drop-in routing template — copy to your indexed repo's root so Claude auto-uses GraphPilot |
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# GraphPilot + Claude Code
|
|
2
|
+
|
|
3
|
+
This routing template directs structural code questions to the `graphpilot` MCP server instead of grep/LSP, unlocking the core benefits: branch-aware differential analysis, evidence anchors, and single-call blast-radius computation.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
1. Install GraphPilot locally:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
11
|
+
cd graphpilot && pnpm install && pnpm build
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
2. Index your repo:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node dist/cli.js index /path/to/your/repo
|
|
18
|
+
node dist/cli.js watch /path/to/your/repo & # keeps index fresh
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. Configure Claude Code MCP server (in `~/.claude.json`):
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"graphpilot": {
|
|
27
|
+
"command": "node",
|
|
28
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
4. Copy this file into your repo root (or a `.claude/` dir).
|
|
35
|
+
|
|
36
|
+
## Routing rules
|
|
37
|
+
|
|
38
|
+
**For "who calls X?" questions:**
|
|
39
|
+
|
|
40
|
+
- Use `gp_callers` instead of grep / LSP.
|
|
41
|
+
- Single call returns both direct + transitive callers with evidence anchors.
|
|
42
|
+
- Example: _"What functions call `validateUser`?"_ → `gp_callers(validateUser)`
|
|
43
|
+
|
|
44
|
+
**For "what breaks if I rename/delete X?" questions:**
|
|
45
|
+
|
|
46
|
+
- Use `gp_impact` instead of composing grep + git.
|
|
47
|
+
- Returns direct callers + transitive callers + tests affected + public-API flag.
|
|
48
|
+
- Single call, no chaining.
|
|
49
|
+
- Example: _"What breaks if I rename `parseFile`?"_ → `gp_impact(parseFile)`
|
|
50
|
+
|
|
51
|
+
**For "what does my PR touch?" (diff-scoped refactors):**
|
|
52
|
+
|
|
53
|
+
- Use `gp_impact({since: 'main'})` to filter the blast radius to only your branch.
|
|
54
|
+
- Cuts noise: only callers in files _you actually changed_ are returned.
|
|
55
|
+
- Example: _"On this feature branch, if I rename `fooHelper`, which of my changed files will break?"_ → `gp_impact(fooHelper, {since: 'main'})`
|
|
56
|
+
|
|
57
|
+
**For "find all functions matching a pattern:"**
|
|
58
|
+
|
|
59
|
+
- Use `gp_recall` for exact or substring search.
|
|
60
|
+
- Fast, structural, no false positives from comments.
|
|
61
|
+
- Example: _"List every function whose name contains 'parse'"_ → `gp_recall({kind: 'function', name: 'parse'})`
|
|
62
|
+
|
|
63
|
+
**For "enumerate all X of kind Y:"**
|
|
64
|
+
|
|
65
|
+
- Use `gp_recall` with a kind filter.
|
|
66
|
+
- Example: _"List every TypeScript interface"_ → `gp_recall({kind: 'interface'})`
|
|
67
|
+
|
|
68
|
+
**Fallback: grep or text search:**
|
|
69
|
+
|
|
70
|
+
- Use grep only for string-literal searches (constants, error messages, comments).
|
|
71
|
+
- GraphPilot doesn't index text content, only structure.
|
|
72
|
+
- Example: _"Find every place `MAX_FILE_SIZE` is mentioned"_ → grep
|
|
73
|
+
|
|
74
|
+
## Evidence anchors
|
|
75
|
+
|
|
76
|
+
Every `gp_*` tool response includes `file:line @ sha` citations. Example output:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
1. analyzeImpact (function) src/impact.ts:168 @ ab12cd3
|
|
80
|
+
export function analyzeImpact(idx: GraphIndex, ...): ImpactResult | null
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
When citing results to your user, include these anchors verbatim. They're verifiable: paste `src/impact.ts:168` into your editor's goto-line command and the code will match the quoted excerpt.
|
|
84
|
+
|
|
85
|
+
**Why it matters:** If a tool ever hallucinated a symbol or a caller, you'd spot it instantly by jumping to the file. No more "the tool said this exists but I can't find it" dead ends.
|
|
86
|
+
|
|
87
|
+
## Scope & limitations
|
|
88
|
+
|
|
89
|
+
GraphPilot v0.1 indexes **TypeScript/JavaScript only**. For Python/Rust/Go repos, fall back to grep or your IDE's LSP.
|
|
90
|
+
|
|
91
|
+
- **Fast:** sub-second recall on repos up to ~100k LOC.
|
|
92
|
+
- **Deterministic:** same repo = same index (not language-model based, no flakiness).
|
|
93
|
+
- **Structural only:** no semantic search, no taint analysis, no control-flow analysis (yet).
|
|
94
|
+
|
|
95
|
+
See [`docs/limitations.md`](../../docs/limitations.md) in the GraphPilot repo for the full boundary conditions.
|
|
96
|
+
|
|
97
|
+
## Tips for agent use
|
|
98
|
+
|
|
99
|
+
1. **Always check the SHA.** If the index SHA is old (> a few hours), ask the user to re-run `graphpilot watch` or re-index.
|
|
100
|
+
2. **On cache miss.** If `gp_recall` returns no results, confirm the symbol name and kind — it may be spelled differently or exported as a type alias.
|
|
101
|
+
3. **Test the evidence.** Before recommending a refactor, jump to one of the cited file:line anchors yourself to confirm the code matches.
|
|
102
|
+
4. **Diff-scoped analysis.** For PR review, always use `gp_impact({since: 'main'})` instead of the raw impact — it cuts false positives.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# GraphPilot routing rules for Cline
|
|
2
|
+
|
|
3
|
+
This repo has a GraphPilot structural code-graph available via MCP. Use it before grep on structural questions.
|
|
4
|
+
|
|
5
|
+
## When the user asks any of:
|
|
6
|
+
|
|
7
|
+
- "who calls X" / "what uses X" / "where is X called from"
|
|
8
|
+
- "what does X call" / "what does X depend on"
|
|
9
|
+
- "rename X — what breaks" / "impact of changing X" / "what depends on X"
|
|
10
|
+
- "find function X" / "where is X defined" / "list all interfaces"
|
|
11
|
+
|
|
12
|
+
→ **Use the graphpilot MCP tools BEFORE grep or reading files.**
|
|
13
|
+
|
|
14
|
+
| Question kind | Tool to call |
|
|
15
|
+
| ---------------------- | ------------------------------------------------------- |
|
|
16
|
+
| Define / locate symbol | `gp_recall({ query, substring?, path? })` |
|
|
17
|
+
| Callers / callees | `gp_callers({ symbol, direction, path? })` |
|
|
18
|
+
| Blast radius / rename | `gp_impact({ symbol, depth?, path? })` |
|
|
19
|
+
| PR-scoped blast radius | `gp_impact({ symbol, since: 'main', path? })` |
|
|
20
|
+
| Index health probe | `gp_stats({ path? })` |
|
|
21
|
+
| Refresh after edits | `gp_index({ path? })` |
|
|
22
|
+
|
|
23
|
+
## When NOT to use GraphPilot
|
|
24
|
+
|
|
25
|
+
Fall back to grep / read for:
|
|
26
|
+
|
|
27
|
+
- Comments, JSDoc, string literals, error messages
|
|
28
|
+
- Config files (package.json, tsconfig.json, .env)
|
|
29
|
+
- Markdown / docs
|
|
30
|
+
- Languages other than TypeScript / JavaScript
|
|
31
|
+
- Git history (blame, log)
|
|
32
|
+
|
|
33
|
+
## After heavy editing
|
|
34
|
+
|
|
35
|
+
After ~10+ file edits, call `gp_index` once before further structural questions, or run `graphpilot watch` in a side terminal for sub-10 ms incremental updates.
|
|
36
|
+
|
|
37
|
+
## Citing evidence
|
|
38
|
+
|
|
39
|
+
Every GraphPilot response carries `file:line @ sha` anchors. When citing results to the user, **include the anchor verbatim** — it's verifiable: the user can jump to that line and the code will match.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Cline (VS Code extension) + GraphPilot
|
|
2
|
+
|
|
3
|
+
Step-by-step install of GraphPilot as an MCP server inside Cline.
|
|
4
|
+
|
|
5
|
+
## 1. Build GraphPilot
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
9
|
+
cd graphpilot && pnpm install && pnpm build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Open Cline's MCP settings
|
|
13
|
+
|
|
14
|
+
The easy way:
|
|
15
|
+
|
|
16
|
+
1. Open VS Code
|
|
17
|
+
2. Open the **Cline panel** (sidebar icon)
|
|
18
|
+
3. Click **MCP Servers**
|
|
19
|
+
4. Click the ⚙ gear icon → **Edit MCP Settings**
|
|
20
|
+
|
|
21
|
+
That opens `cline_mcp_settings.json`. Direct paths if you prefer to edit it manually:
|
|
22
|
+
|
|
23
|
+
| OS | Path |
|
|
24
|
+
| ------- | --------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| macOS | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
26
|
+
| Linux | `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
27
|
+
| Windows | `%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json` |
|
|
28
|
+
|
|
29
|
+
## 3. Add the GraphPilot block
|
|
30
|
+
|
|
31
|
+
Paste the contents of [`cline_mcp_settings.json`](./cline_mcp_settings.json) and replace `/absolute/path/to/graphpilot/` with the real path:
|
|
32
|
+
|
|
33
|
+
```jsonc
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"graphpilot": {
|
|
37
|
+
"command": "node",
|
|
38
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
|
|
39
|
+
"disabled": false,
|
|
40
|
+
"autoApprove": [],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Post-npm:
|
|
47
|
+
|
|
48
|
+
```jsonc
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"graphpilot": {
|
|
52
|
+
"command": "npx",
|
|
53
|
+
"args": ["graphpilot", "mcp"],
|
|
54
|
+
"disabled": false,
|
|
55
|
+
"autoApprove": [],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> The `autoApprove` array lets you list tool names that Cline will call without per-call confirmation. Add e.g. `["gp_recall", "gp_stats"]` once you're comfortable — leave it empty until then.
|
|
62
|
+
|
|
63
|
+
## 4. Verify
|
|
64
|
+
|
|
65
|
+
In the Cline panel → **MCP Servers** section, `graphpilot` should appear with a **green status dot** and 5 tools listed underneath. If it doesn't, restart VS Code.
|
|
66
|
+
|
|
67
|
+
## 5. Index a repo
|
|
68
|
+
|
|
69
|
+
From the integrated terminal:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
node /abs/path/to/graphpilot/dist/cli.js index .
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 6. Try it
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
Use graphpilot to find who calls authenticate.
|
|
79
|
+
|
|
80
|
+
Use gp_impact to show the blast radius of renaming parseFile.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Cline will surface a tool-call card with the request → response → "Approve" button. Once approved, the result appears in the chat with `file:line @ sha` evidence anchors.
|
|
84
|
+
|
|
85
|
+
## 7. Keep the index fresh
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
node /abs/path/to/graphpilot/dist/cli.js watch .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Troubleshooting
|
|
92
|
+
|
|
93
|
+
| Symptom | Fix |
|
|
94
|
+
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| Server shows red / disconnected | Check `disabled: false`. Then try VS Code: Command Palette → "Developer: Reload Window". |
|
|
96
|
+
| Cline can't find tools after a restart | The settings file is JSON-strict — a trailing comma will silently disable the entire `mcpServers` block. Validate the JSON. |
|
|
97
|
+
| Tool calls return "no index" | Pass an explicit `path: "/abs/repo"`, or run `gp_index` first. |
|
|
98
|
+
|
|
99
|
+
## Files in this folder
|
|
100
|
+
|
|
101
|
+
| File | Purpose |
|
|
102
|
+
| ------------------------------------------------------ | ------------------------------------------------------ |
|
|
103
|
+
| [`README.md`](./README.md) | This walkthrough |
|
|
104
|
+
| [`cline_mcp_settings.json`](./cline_mcp_settings.json) | Sample config — copy the `mcpServers` block into yours |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# GraphPilot routing rules for Continue
|
|
2
|
+
|
|
3
|
+
This repo has a GraphPilot structural code-graph available via MCP. Use it before grep on structural questions.
|
|
4
|
+
|
|
5
|
+
## When the user asks any of:
|
|
6
|
+
|
|
7
|
+
- "who calls X" / "what uses X" / "where is X called from"
|
|
8
|
+
- "what does X call" / "what does X depend on"
|
|
9
|
+
- "rename X — what breaks" / "impact of changing X" / "what depends on X"
|
|
10
|
+
- "find function X" / "where is X defined" / "list all interfaces"
|
|
11
|
+
|
|
12
|
+
→ **Use the graphpilot MCP tools BEFORE grep or reading files.**
|
|
13
|
+
|
|
14
|
+
| Question kind | Tool to call |
|
|
15
|
+
| ---------------------- | ------------------------------------------------------- |
|
|
16
|
+
| Define / locate symbol | `gp_recall({ query, substring?, path? })` |
|
|
17
|
+
| Callers / callees | `gp_callers({ symbol, direction, path? })` |
|
|
18
|
+
| Blast radius / rename | `gp_impact({ symbol, depth?, path? })` |
|
|
19
|
+
| PR-scoped blast radius | `gp_impact({ symbol, since: 'main', path? })` |
|
|
20
|
+
| Index health probe | `gp_stats({ path? })` |
|
|
21
|
+
| Refresh after edits | `gp_index({ path? })` |
|
|
22
|
+
|
|
23
|
+
## When NOT to use GraphPilot
|
|
24
|
+
|
|
25
|
+
Fall back to grep / read for:
|
|
26
|
+
|
|
27
|
+
- Comments, JSDoc, string literals, error messages
|
|
28
|
+
- Config files (package.json, tsconfig.json, .env)
|
|
29
|
+
- Markdown / docs
|
|
30
|
+
- Languages other than TypeScript / JavaScript
|
|
31
|
+
- Git history (blame, log)
|
|
32
|
+
|
|
33
|
+
## After heavy editing
|
|
34
|
+
|
|
35
|
+
After ~10+ file edits, call `gp_index` once before further structural questions, or run `graphpilot watch` in a side terminal for sub-10 ms incremental updates.
|
|
36
|
+
|
|
37
|
+
## Citing evidence
|
|
38
|
+
|
|
39
|
+
Every GraphPilot response carries `file:line @ sha` anchors. When citing results to the user, **include the anchor verbatim** — it's verifiable: the user can jump to that line and the code will match.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Continue.dev + GraphPilot
|
|
2
|
+
|
|
3
|
+
Step-by-step install of GraphPilot as an MCP server inside Continue.
|
|
4
|
+
|
|
5
|
+
> Continue's MCP support is flagged **experimental** at the time of writing. If the config key below isn't recognized, check the [Continue docs](https://docs.continue.dev) for the current schema.
|
|
6
|
+
|
|
7
|
+
## 1. Build GraphPilot
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
11
|
+
cd graphpilot && pnpm install && pnpm build
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 2. Edit Continue's config
|
|
15
|
+
|
|
16
|
+
Two scopes — pick one:
|
|
17
|
+
|
|
18
|
+
- **Global:** `~/.continue/config.json`
|
|
19
|
+
- **Per-project:** `<your-repo>/.continue/config.json`
|
|
20
|
+
|
|
21
|
+
Create the file if it doesn't exist. Paste the contents of [`config.json`](./config.json) and replace `/absolute/path/to/graphpilot/` with the real path:
|
|
22
|
+
|
|
23
|
+
```jsonc
|
|
24
|
+
{
|
|
25
|
+
"experimental": {
|
|
26
|
+
"modelContextProtocolServers": [
|
|
27
|
+
{
|
|
28
|
+
"transport": {
|
|
29
|
+
"type": "stdio",
|
|
30
|
+
"command": "node",
|
|
31
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Post-npm:
|
|
40
|
+
|
|
41
|
+
```jsonc
|
|
42
|
+
{
|
|
43
|
+
"experimental": {
|
|
44
|
+
"modelContextProtocolServers": [
|
|
45
|
+
{
|
|
46
|
+
"transport": {
|
|
47
|
+
"type": "stdio",
|
|
48
|
+
"command": "npx",
|
|
49
|
+
"args": ["graphpilot", "mcp"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 3. Restart Continue
|
|
58
|
+
|
|
59
|
+
Reload the VS Code / JetBrains window after editing the config.
|
|
60
|
+
|
|
61
|
+
## 4. Verify
|
|
62
|
+
|
|
63
|
+
Continue → Settings → **MCP Servers** panel. `graphpilot` should be listed with 5 tools.
|
|
64
|
+
|
|
65
|
+
## 5. Index a repo
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
node /abs/path/to/graphpilot/dist/cli.js index .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 6. Try it
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
Use graphpilot's gp_recall to find parseToken.
|
|
75
|
+
|
|
76
|
+
Use gp_impact to compute the blast radius of renaming authenticate.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 7. Keep the index fresh
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
node /abs/path/to/graphpilot/dist/cli.js watch .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Troubleshooting
|
|
86
|
+
|
|
87
|
+
| Symptom | Fix |
|
|
88
|
+
| ------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
89
|
+
| `modelContextProtocolServers` reported as "unknown key" | Your Continue version is on an older schema. Check the current docs for the new key name. |
|
|
90
|
+
| Server appears but tools aren't called | Continue's MCP autorouting is conservative. Be explicit: _"Use graphpilot's gp_callers…"_ |
|
|
91
|
+
| `pnpm install` native-module errors | `pnpm approve-builds --all && pnpm rebuild`. Drop to Node 22 LTS if on 23+. |
|
|
92
|
+
|
|
93
|
+
## Files in this folder
|
|
94
|
+
|
|
95
|
+
| File | Purpose |
|
|
96
|
+
| ------------------------------ | ------------------------------------------------------------ |
|
|
97
|
+
| [`README.md`](./README.md) | This walkthrough |
|
|
98
|
+
| [`config.json`](./config.json) | Sample `~/.continue/config.json` — copy the block into yours |
|