inspect-mcp 0.1.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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3839 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yuri
|
|
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,252 @@
|
|
|
1
|
+
# inspect-mcp
|
|
2
|
+
|
|
3
|
+
An MCP server that gives AI coding agents instant, structured understanding of any codebase.
|
|
4
|
+
|
|
5
|
+
One tool call. Full project context. No more fumbling.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## The problem
|
|
10
|
+
|
|
11
|
+
AI coding agents (Claude Code, Cursor, Aider, Cline, Windsurf) waste significant time and tokens orienting themselves every session:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Agent: Let me look at package.json... # tool call 1
|
|
15
|
+
Agent: Now let me see the directory structure... # tool call 2
|
|
16
|
+
Agent: Let me check tsconfig.json... # tool call 3
|
|
17
|
+
Agent: What's in the src/ folder? # tool call 4
|
|
18
|
+
Agent: How is the auth module structured? # tool call 5
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
That's 5 tool calls, ~30 seconds, and hundreds of tokens burned before any real work begins. Multiply that across every task, every session, every day.
|
|
22
|
+
|
|
23
|
+
## The solution
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Agent: inspect scan /path/to/project # 1 tool call, <3 seconds
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Returns everything the agent needs in structured JSON:
|
|
30
|
+
|
|
31
|
+
| What | Why it matters |
|
|
32
|
+
|------|---------------|
|
|
33
|
+
| **Project identity** | Language, framework, package manager, runtime — no guessing |
|
|
34
|
+
| **Smart file tree** | Full structure with noise collapsed (node_modules, dist, .git) |
|
|
35
|
+
| **Symbol index** | Every exported function, class, type with signatures and line numbers |
|
|
36
|
+
| **Dependency map** | Who imports what — bidirectional, internal files only |
|
|
37
|
+
| **Health baseline** | Existing linter/type errors so the agent knows what it inherited vs introduced |
|
|
38
|
+
|
|
39
|
+
## Three commands
|
|
40
|
+
|
|
41
|
+
### `scan` — understand the project
|
|
42
|
+
|
|
43
|
+
First call does a full scan. Subsequent calls are incremental (only re-processes what git says changed). Cached and fast.
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"command": "scan",
|
|
48
|
+
"path": "/path/to/project",
|
|
49
|
+
"include_health": false
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### `changed` — what moved since last scan?
|
|
54
|
+
|
|
55
|
+
After a `git pull`, branch switch, or teammate's push. Returns deltas, blast radius, and new/removed/modified symbols.
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"command": "changed",
|
|
60
|
+
"path": "/path/to/project"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `impact` — before I edit this, what depends on it?
|
|
65
|
+
|
|
66
|
+
Point it at a file or symbol. Get direct dependents, transitive dependents, usage sites with line numbers, and test coverage status.
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"command": "impact",
|
|
71
|
+
"path": "/path/to/project",
|
|
72
|
+
"target": "src/lib/auth.ts:getUserById"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Why this matters
|
|
77
|
+
|
|
78
|
+
### For developers using AI agents
|
|
79
|
+
|
|
80
|
+
- **Fewer wasted tool calls** — 1 call replaces 3-5 exploratory ones
|
|
81
|
+
- **Fewer broken edits** — the agent knows the dependency graph before touching anything
|
|
82
|
+
- **Faster sessions** — orientation in seconds, not minutes
|
|
83
|
+
- **Better context** — agents make smarter decisions with structured project knowledge
|
|
84
|
+
|
|
85
|
+
### For agent framework builders
|
|
86
|
+
|
|
87
|
+
- **Drop-in MCP tool** — standard protocol, works with any MCP client
|
|
88
|
+
- **Structured JSON** — consistent, machine-parseable output with stable keys
|
|
89
|
+
- **Incremental by design** — stays useful throughout a session, not just the first call
|
|
90
|
+
|
|
91
|
+
### For teams with large codebases
|
|
92
|
+
|
|
93
|
+
- **Scales to thousands of files** — tree-sitter parsing with smart collapsing
|
|
94
|
+
- **Git-native** — handles pulls, rebases, branch switches correctly
|
|
95
|
+
- **Zero config** — works out of the box for TypeScript, JavaScript, Python, Rust, Go, Java, Ruby
|
|
96
|
+
- **Fully local** — no network calls, no cloud, no telemetry
|
|
97
|
+
|
|
98
|
+
## Installation
|
|
99
|
+
|
|
100
|
+
### Claude Code
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
claude mcp add inspect-mcp -- npx inspect-mcp
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Claude Desktop
|
|
107
|
+
|
|
108
|
+
Add to `claude_desktop_config.json`:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"mcpServers": {
|
|
113
|
+
"inspect-mcp": {
|
|
114
|
+
"command": "npx",
|
|
115
|
+
"args": ["inspect-mcp"]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Cursor
|
|
122
|
+
|
|
123
|
+
Add to MCP settings:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"mcpServers": {
|
|
128
|
+
"inspect-mcp": {
|
|
129
|
+
"command": "npx",
|
|
130
|
+
"args": ["inspect-mcp"]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Global install
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npm install -g inspect-mcp
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Build from source
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
git clone https://github.com/ykushch/inspecta.git
|
|
146
|
+
cd inspecta
|
|
147
|
+
pnpm install
|
|
148
|
+
pnpm build
|
|
149
|
+
node dist/index.js
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
When using a source build with MCP clients, replace `npx inspect-mcp` with `node /absolute/path/to/inspecta/dist/index.js`.
|
|
153
|
+
|
|
154
|
+
## Agent instructions
|
|
155
|
+
|
|
156
|
+
Add to your `CLAUDE.md` or agent system prompt:
|
|
157
|
+
|
|
158
|
+
```markdown
|
|
159
|
+
## Codebase awareness
|
|
160
|
+
|
|
161
|
+
- At the start of any coding task, call `inspect scan` to understand the project
|
|
162
|
+
- Before editing a function used elsewhere, call `inspect impact` to see dependents
|
|
163
|
+
- After `git pull` or branch switch, call `inspect changed` to see what moved
|
|
164
|
+
|
|
165
|
+
## Token efficiency
|
|
166
|
+
|
|
167
|
+
Pair with [RTK](https://github.com/rtk-ai/rtk) to reduce token usage by 60-90% on
|
|
168
|
+
CLI operations (git, test runners, linters). inspect-mcp gives structured codebase
|
|
169
|
+
context in a single tool call; RTK compresses everything else.
|
|
170
|
+
|
|
171
|
+
Install: `brew install rtk && rtk init --global`
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## How it works
|
|
175
|
+
|
|
176
|
+
- **Project detection** — reads config files (package.json, pyproject.toml, Cargo.toml, go.mod, etc.) to identify language, framework, package manager, and available tools
|
|
177
|
+
- **File tree** — recursive walk with smart collapsing (node_modules → `{ _collapsed: true, file_count: 48210 }`)
|
|
178
|
+
- **Symbols** — tree-sitter WASM parses source files to extract functions, classes, types with full signatures
|
|
179
|
+
- **Dependencies** — tree-sitter extracts imports, resolves paths, builds a bidirectional adjacency map
|
|
180
|
+
- **Health** — runs the project's own configured linters/type-checkers and structures the output
|
|
181
|
+
- **Cache** — results cached in `.inspect/` anchored to git HEAD; incremental updates on subsequent calls
|
|
182
|
+
|
|
183
|
+
## Performance targets
|
|
184
|
+
|
|
185
|
+
| Operation | Target |
|
|
186
|
+
|-----------|--------|
|
|
187
|
+
| Initial scan (500 files) | < 3 seconds |
|
|
188
|
+
| Impact query | < 500ms |
|
|
189
|
+
| Incremental update | < 1 second |
|
|
190
|
+
|
|
191
|
+
## Monorepo & workspace support
|
|
192
|
+
|
|
193
|
+
inspecta automatically detects and handles multi-project layouts:
|
|
194
|
+
|
|
195
|
+
- **Monorepos** — when the root has no config file, sub-projects are detected in child directories
|
|
196
|
+
- **Workspace directories** — recurses into `packages/`, `libs/`, `apps/`, `modules/`, `services/`, etc.
|
|
197
|
+
- **Python** — builds a package index from all `__init__.py` files, resolving absolute imports (`from mylib.config import settings`) regardless of nesting depth
|
|
198
|
+
- **Java** — builds a fully-qualified class index from all `.java` files, resolving cross-module imports
|
|
199
|
+
- **TypeScript/JS** — resolves relative imports and path aliases from `tsconfig.json`
|
|
200
|
+
|
|
201
|
+
Works with any directory structure — no configuration needed.
|
|
202
|
+
|
|
203
|
+
## Supported languages
|
|
204
|
+
|
|
205
|
+
| Language | Project detection | Symbols | Dependencies |
|
|
206
|
+
|----------|-------------------|---------|-------------|
|
|
207
|
+
| TypeScript | Yes | Yes | Yes |
|
|
208
|
+
| JavaScript | Yes | Yes | Yes |
|
|
209
|
+
| Python | Yes | Yes | Yes |
|
|
210
|
+
| Java | Yes | Yes | Yes |
|
|
211
|
+
| Rust | Yes | No | No |
|
|
212
|
+
| Go | Yes | No | No |
|
|
213
|
+
| Ruby | Yes | No | No |
|
|
214
|
+
| Kotlin | Build detection only | No | No |
|
|
215
|
+
|
|
216
|
+
## Design principles
|
|
217
|
+
|
|
218
|
+
1. **Speed over completeness** — fast partial answers beat slow perfect ones
|
|
219
|
+
2. **Structured JSON only** — every response is machine-parseable, no prose
|
|
220
|
+
3. **Local and private** — no network calls, no cloud, no telemetry
|
|
221
|
+
4. **Git-native** — anchored to commits, not filesystem watchers
|
|
222
|
+
5. **Incremental by default** — only re-process what changed
|
|
223
|
+
6. **Zero config** — works out of the box, optional config for customization
|
|
224
|
+
|
|
225
|
+
## Configuration
|
|
226
|
+
|
|
227
|
+
Optional `inspect.config.json` in your project root:
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"collapse_dirs": ["node_modules", "dist", "build", ".next", "target"],
|
|
232
|
+
"ignore_patterns": ["*.min.js", "*.generated.*", "*.d.ts"],
|
|
233
|
+
"max_file_size_kb": 100,
|
|
234
|
+
"tree_depth": 6,
|
|
235
|
+
"health_timeout_ms": 15000
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Maintainer release flow
|
|
240
|
+
|
|
241
|
+
1. Update `version` in `package.json`.
|
|
242
|
+
2. Merge the release commit and confirm CI is green.
|
|
243
|
+
3. Create and push a matching tag such as `v0.1.1`.
|
|
244
|
+
4. GitHub Actions verifies the tag, runs `pnpm lint`, `pnpm test`, `pnpm build`, packs the tarball, creates a GitHub Release, and publishes to npm.
|
|
245
|
+
|
|
246
|
+
**Setup:**
|
|
247
|
+
1. On npm: go to **Settings → "Trusted Publishing"** → link the `ykushch/inspecta` repository.
|
|
248
|
+
2. On GitHub: add your npm automation token as the `NPM_TOKEN` secret in **Settings → Secrets → Actions**.
|
|
249
|
+
|
|
250
|
+
## License
|
|
251
|
+
|
|
252
|
+
MIT
|
package/dist/index.d.ts
ADDED