callgraph-mcp 1.4.0 → 1.4.1
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 +23 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Most AI coding tools answer structural questions about your codebase by reading
|
|
|
29
29
|
|
|
30
30
|
## Setup
|
|
31
31
|
|
|
32
|
-
### Option 1 — VS Code
|
|
32
|
+
### Option 1 — VS Code via `npx` (no install required)
|
|
33
33
|
|
|
34
34
|
Add to your project's `.vscode/mcp.json`:
|
|
35
35
|
|
|
@@ -79,26 +79,21 @@ Then point your client at it:
|
|
|
79
79
|
|
|
80
80
|
## Tools Reference
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|------|----------------|----------|-----------------|
|
|
84
|
-
| `flowmap_analyze_workspace` | `workspacePath` | `exclude`, `language` | Full call graph: all nodes, edges, flows, orphans |
|
|
85
|
-
| `flowmap_analyze_file` | `filePath` | — | Functions and call sites in a single file |
|
|
86
|
-
| `flowmap_get_callers` | `functionName`, `workspacePath` | — | Every function across the workspace that directly calls the named function |
|
|
87
|
-
| `flowmap_get_callees` | `functionName`, `workspacePath` | — | Every function the named function directly calls |
|
|
88
|
-
| `flowmap_get_flow` | `functionName`, `workspacePath` | `maxDepth` (default 10) | Full BFS subgraph reachable from a function — the complete execution path |
|
|
89
|
-
| `flowmap_list_entry_points` | `workspacePath` | — | All entry points: mains, route handlers, CLI commands, React roots |
|
|
90
|
-
| `flowmap_find_orphans` | `workspacePath` | — | Functions unreachable from any entry point — potential dead code |
|
|
91
|
-
| `flowmap_find_cycles` | `workspacePath` | `minCycleLength`, `exclude` | All call cycles (circular dependencies / mutual recursion) with exact member functions and the edges forming each loop |
|
|
82
|
+
Optional parameters shown in `[brackets]`.
|
|
92
83
|
|
|
93
|
-
|
|
84
|
+
| Tool | Parameters | Returns |
|
|
85
|
+
|------|-----------|---------|
|
|
86
|
+
| `flowmap_analyze_workspace` | `workspacePath`, [`exclude`], [`language`] | Full call graph: nodes, edges, flows, orphans |
|
|
87
|
+
| `flowmap_analyze_file` | `filePath` | Functions and call sites in one file |
|
|
88
|
+
| `flowmap_get_callers` | `functionName`, `workspacePath` | Direct callers of the function |
|
|
89
|
+
| `flowmap_get_callees` | `functionName`, `workspacePath` | Functions the named function calls |
|
|
90
|
+
| `flowmap_get_flow` | `functionName`, `workspacePath`, [`maxDepth`=10] | Full BFS subgraph reachable from a function |
|
|
91
|
+
| `flowmap_list_entry_points` | `workspacePath` | Mains, route handlers, CLI commands, React roots |
|
|
92
|
+
| `flowmap_find_orphans` | `workspacePath` | Functions unreachable from any entry point |
|
|
93
|
+
| `flowmap_find_cycles` | `workspacePath`, [`minCycleLength`], [`exclude`] | All circular call chains with exact edges |
|
|
94
|
+
| `flowmap_find_duplicates` *(experimental)* | `workspacePath`, [`similarityThreshold`=0.75], [`minCallees`=2], [`exclude`] | Function clusters with similar callee sets |
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
| Tool | Required params | Optional | What it returns |
|
|
98
|
-
|------|----------------|----------|-----------------|
|
|
99
|
-
| `flowmap_find_duplicates` | `workspacePath` | `similarityThreshold` (default `0.75`), `minCallees` (default `2`), `exclude` | Clusters of functions with similar callee sets — different names, same business logic. Candidates for extraction into a shared utility. |
|
|
100
|
-
|
|
101
|
-
**`workspacePath`** is the absolute path to the repository root (e.g. `/home/user/my-project` or `C:\projects\my-app`).
|
|
96
|
+
**`workspacePath`** — absolute path to the repo root (e.g. `/home/user/my-project` or `C:\projects\my-app`).
|
|
102
97
|
|
|
103
98
|
---
|
|
104
99
|
|
|
@@ -106,31 +101,29 @@ Then point your client at it:
|
|
|
106
101
|
|
|
107
102
|
| Variable | Default | Description |
|
|
108
103
|
|----------|---------|-------------|
|
|
109
|
-
| `FLOWMAP_TRANSPORT` | `stdio` |
|
|
110
|
-
| `FLOWMAP_PORT` | `3100` | HTTP
|
|
111
|
-
| `FLOWMAP_GRAMMARS` | *(bundled)* | Override path to
|
|
112
|
-
| `FLOWMAP_DUP_THRESHOLD` | `0.75` |
|
|
113
|
-
| `FLOWMAP_DUP_MIN_CALLEES` | `2` |
|
|
104
|
+
| `FLOWMAP_TRANSPORT` | `stdio` | `stdio` or `http` |
|
|
105
|
+
| `FLOWMAP_PORT` | `3100` | HTTP port (http transport only) |
|
|
106
|
+
| `FLOWMAP_GRAMMARS` | *(bundled)* | Override path to WASM grammar files |
|
|
107
|
+
| `FLOWMAP_DUP_THRESHOLD` | `0.75` | Jaccard similarity threshold for `find_duplicates` (0–1) |
|
|
108
|
+
| `FLOWMAP_DUP_MIN_CALLEES` | `2` | Min callee count for `find_duplicates` |
|
|
114
109
|
|
|
115
110
|
---
|
|
116
111
|
|
|
117
112
|
## Example Use Cases
|
|
118
113
|
|
|
119
|
-
These prompts work because the answers come from the call graph index — not from the model's memory of what your code might look like. Every result is exact, reproducible, and complete regardless of codebase size.
|
|
120
|
-
|
|
121
114
|
---
|
|
122
115
|
|
|
123
116
|
### PR review and change safety
|
|
124
117
|
|
|
125
118
|
> *"I just modified `processPayment`. Without reading any code, tell me every function that could break and rank them by how many hops away they are from the change."*
|
|
126
119
|
|
|
127
|
-
The agent calls `flowmap_get_callers("processPayment", workspacePath)` for the direct impact radius (1 hop), then recursively traverses callers-of-callers to build a ranked list by distance.
|
|
120
|
+
The agent calls `flowmap_get_callers("processPayment", workspacePath)` for the direct impact radius (1 hop), then recursively traverses callers-of-callers to build a ranked list by distance.
|
|
128
121
|
|
|
129
122
|
---
|
|
130
123
|
|
|
131
124
|
> *"We're about to merge a PR that touches `validateCart`. Give me an impact report — what's the worst case if this function throws."*
|
|
132
125
|
|
|
133
|
-
The agent calls `flowmap_get_flow("validateCart", workspacePath)` to map every function reachable downstream, then `flowmap_get_callers("validateCart", workspacePath)` to map every upstream caller.
|
|
126
|
+
The agent calls `flowmap_get_flow("validateCart", workspacePath)` to map every function reachable downstream, then `flowmap_get_callers("validateCart", workspacePath)` to map every upstream caller.
|
|
134
127
|
|
|
135
128
|
---
|
|
136
129
|
|
|
@@ -160,7 +153,7 @@ The agent calls `flowmap_find_orphans(workspacePath)`. This returns every functi
|
|
|
160
153
|
|
|
161
154
|
> *"I just joined this team. Walk me through this codebase starting from the entry points — explain each major flow in plain English without me having to read a single file."*
|
|
162
155
|
|
|
163
|
-
The agent calls `flowmap_list_entry_points(workspacePath)` to find every main, route handler, CLI command, and React root. Then it calls `flowmap_get_flow` on each one to trace the execution.
|
|
156
|
+
The agent calls `flowmap_list_entry_points(workspacePath)` to find every main, route handler, CLI command, and React root. Then it calls `flowmap_get_flow` on each one to trace the execution.
|
|
164
157
|
|
|
165
158
|
---
|
|
166
159
|
|
|
@@ -168,7 +161,7 @@ The agent calls `flowmap_list_entry_points(workspacePath)` to find every main, r
|
|
|
168
161
|
|
|
169
162
|
> *"I want to extract the payment logic into its own module. Based purely on call relationships, which functions naturally belong together and which ones would need to stay behind."*
|
|
170
163
|
|
|
171
|
-
The agent calls `flowmap_analyze_workspace(workspacePath)` and uses the graph to find the connected component of functions reachable from payment-related entry points.
|
|
164
|
+
The agent calls `flowmap_analyze_workspace(workspacePath)` and uses the graph to find the connected component of functions reachable from payment-related entry points.
|
|
172
165
|
|
|
173
166
|
---
|
|
174
167
|
|