KARP Inspector

au.com.souldriver由 souldriver.com.au 发布v0.5.0更新于 Nov 21, 2026

52 tools for Claude Desktop: filesystem, knowledge graph and code search. Runs locally. Free, MIT.

发布方自己的服务:KARP Research by SoulDriver

概览

AI 生成的概览

面向 Claude Desktop 的本地 MCP 服务器,为助手提供文件系统访问、持久知识图谱和跨项目文件夹的混合代码搜索。

可以做什么
  • 在授权的项目文件夹内读取、写入、打补丁、移动、复制、软删除和搜索文件,支持 glob 查找、跨文件替换、校验和与磁盘占用分析
  • 构建并查询语义代码索引:语义与字面混合搜索、grep、文件结构大纲、项目统计、索引状态、导出与导入
  • 分析代码结构:仓库地图、依赖图与循环依赖检测、影响分析、死代码、TODO 扫描以及密钥与凭据审计
  • 在知识图谱中保存和检索决策、待办与笔记,支持自定义节点类型、关系、语义召回和快照
  • 执行预先批准的终端命令,创建 git 或 SQLite 检查点,并从快照撤销文件改动
  • 报告服务器状态、目录边界和已批准命令
适用场景
适合希望 Claude Desktop 直接处理本地代码库的场景:浏览、编辑和搜索代码,跨会话记住项目决策,并在改动文件前评估影响,且无需任何外部服务或 API 密钥。
运行要求
作为 stdio 进程在 Claude Desktop(Windows 或 macOS)中本地运行,手动配置需 Node.js 18+。需要一个数据文件夹存放 SQLite 数据库,以及一个或多个项目文件夹作为文件边界;手动配置使用 ALLOWED_DIRS 和 DATA_PATH,可选 ALLOWED_COMMANDS 与 TRASH_DIR。约 33MB 的嵌入模型随扩展提供,无需账号、API 密钥或网络访问。
安装前请注意
服务器可在配置的项目文件夹内写入、打补丁、移动、复制和删除文件,run_check 会执行终端命令——加入测试或构建命令会让项目执行自身代码,仅对可信仓库开放。软删除会进入回收站,但也可能永久删除。同一数据库只应有一个实例使用;恢复快照前须完全退出 Claude Desktop,以免被覆盖。

安装

在 SourceWeft 中

  1. 打开 控制台中的 KARP Inspector,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

KARP Inspector

The Complete Development Intelligence Server for Claude Desktop

[Smoke Test]

Version: 0.5.0
Author: SoulDriver (Adelaide, Australia)
Licence: MIT — free and open source, every tool included

Formerly KARP Inspector Premium. Up to v0.4.0 it was a paid extension with a licence key. From v0.5.0 all 52 tools are free for everyone.


What Is This?

KARP Inspector is a single MCP server that gives Claude everything it needs to understand, navigate, modify, and reason about your codebase — plus a persistent knowledge graph that remembers decisions, tracks changes, and connects code to context.

52 tools. One server. One database. Zero external services.

Everything runs locally. Your code never leaves your machine.


Inspector vs Inspector Lite

Inspector Lite is the lightweight, search-only sibling. Inspector is the full toolkit.

CapabilityInspector LiteInspector
Semantic code search✅✅
Grep / file outline / diff✅✅
Read files❌✅
Write / patch files❌✅ (atomic, corruption-safe)
Move / copy / delete❌✅ (soft delete with trash)
Find files (glob + filters)❌✅
Search & replace (cross-file)❌✅ (with dry-run preview)
Knowledge graph❌✅ (remember, recall, connect)
Custom node types❌✅ (propose any schema)
Semantic graph search❌✅ (ONNX embeddings)
Repo map (compressed overview)❌✅
Dependency graph❌✅ (with circular dep detection)
Impact analysis❌✅ (blast radius + symbol tracking)
Dead code detection❌✅
TODO / FIXME scanner❌✅
Security audit❌✅ (secrets, keys, high-entropy)
Git checkpoint❌✅ (or SQLite fallback)
Undo / rollback❌✅ (snapshot-based revert)
Run terminal commands❌✅ (pre-approved patterns only)
Disk usage analysis❌✅
File checksums❌✅ (SHA256)
Unified database❌✅ (single SQLite file)
Version historyFile snapshotsSQLite snapshots (searchable)
Index observability❌✅ (list, status, forget, export/import)
Server diagnostics❌✅ (server_status)
Total tools952

Installation

Extension Install (Recommended)

  1. Download karp-inspector.mcpb from the latest release.
  2. In Claude Desktop, open Settings (on Windows: File → Settings), click Desktop app in the left panel, scroll to the bottom and choose Extensions → Manage → Advanced settings → Install extension, then select the downloaded file.
  3. Choose a Data Folder (where the database lives) and one or more Project Folders (the code Claude can read and edit).
  4. Click Enable, then Configure, and choose Allow all on the permissions screen.

Then ask Claude to run server_status: it should report version 0.5.0 and 52 tools.

The server runs directly via stdio (no proxy, no background process) — same pattern as every other KARP MCP server.

Upgrading from Inspector Premium

The new extension installs under a different name, so it sits alongside the old one. Disable or remove KARP Inspector Premium first so the two never write to the same database at once, then install KARP Inspector and choose the same Data Folder you used before. Your knowledge graph, code index and snapshots carry straight over: the database file names (premium.db, premium-*.db) are unchanged for exactly this reason. There are no licence fields any more, so there's nothing to enter.

Manual Config (Development)

  1. git clone https://github.com/souldriver007/karp-inspector.git
  2. Inside the folder, run npm install, then npm run download-model (the embedding model isn't committed to git; about 33MB)
  3. Add to your claude_desktop_config.json:
json
{  "mcpServers": {    "karp-inspector": {      "command": "node",      "args": ["C:\\path\\to\\karp-inspector\\server\\index.js"],      "env": {        "ALLOWED_DIRS": "C:\\Users\\You\\Projects;D:\\Code",        "DATA_PATH": "C:\\path\\to\\your\\chosen\\data\\folder",        "ALLOWED_COMMANDS": "node --check"      }    }  }}

ALLOWED_COMMANDS above is the safe default. Adding npm test, npm run build or pytest lets the project you point at execute its own code — only do that for repositories you trust.

  1. Restart Claude Desktop
  2. Say: "Set project to C:\path\to\my\project and index it"

Build the extension yourself

bash
npm installnpm run download-modelnpm run build

The extension is written to dist/karp-inspector.mcpb.

Linux (x64): run installs as ONNXRUNTIME_NODE_INSTALL_CUDA=skip npm install (or npm ci). Otherwise onnxruntime-node's install script tries to download optional GPU binaries, and that download currently fails. Inspector only needs the CPU binaries, which are already in the package.


Testing

bash
npm run smoke

Spawns the server and drives it over stdio with a real JSON-RPC client — no Claude Desktop, no GUI, no SDK dependency. 32 assertions, a few seconds.

Every assertion corresponds to something that actually broke during development, so this is a regression net rather than a formality:

AssertionThe bug it guards against
set_project outside the boundary is deniedThe directory sandbox once covered only one module in four, making grep_code an arbitrary-file reader
Two roots sharing a README.md both indexChunk ids were filepath:line, so any two projects sharing a relative path collided on the primary key
A one-line const a = () => {}, b = () => {} indexesTwo chunks with the same start line produced duplicate ids
index_project returns chunks > 0File hashes committed before chunks; an interrupted run left the index claiming N files with zero chunks, unrecoverable
search_code ranks the right file firstProves the vectors are meaningful, not merely present
Hybrid finds a file semantic search missescount-lines.js contains totalLines; semantic search returned countFiles and countRows instead
Export records embedding_dtypeAn index recording only the model name imports cleanly into a server on the other precision and returns plausible nonsense
Deleting a file yields pruned: 1Deleted files' chunks previously survived forever
Ambiguous relative path errorsresolveInRoots used to return the first match and call it an answer
security_audit, git_checkpoint, run_check and export → import all runBefore v0.5.0 these were licence-gated, so CI only reached them when licence secrets were set, and import_index shipped broken because nothing exercised it

The fixture is created under the OS temp directory, which on macOS is a symlink into /private/var/... — so the run also exercises the realpath handling in assertAllowed.

CI runs the same suite on macOS, Windows and Linux on every push, covering every tool, including run_check's non-Windows which branch. See .github/workflows/smoke-test.yml.


How search works

search_code runs two rankers over the same chunks and fuses the results.

Semantic compares the query's embedding against each chunk's. Good at concepts — "validate a token before the request runs" finds the middleware even though it never uses those words.

Literal scores term frequency over each chunk's text and name, with identifiers split on camelCase and snake_case so totalLines matches "total lines". Good at the thing semantic search is worst at: you half-remember an identifier, a config key, or an error string.

Fusion uses Reciprocal Rank Fusion — Σ 1/(60 + rank) across both lists. RRF works on ranks rather than raw scores, which matters because cosine similarity and term frequency aren't on comparable scales. Every result reports semantic_score, lexical_score and the fused rrf value, so a ranking can be explained rather than taken on trust.

Why both: on a real codebase, a query for "count the number of lines of code" returned countFiles, countRows and getRecordCounts from semantic search alone — and missed a file named count-lines.js containing totalLines. Literal matching finds it instantly. Neither ranker is sufficient by itself.

Pass mode: "semantic" or mode: "literal" to force one.

A note on queries. Search quality depends more on vocabulary than on any setting. Search the way the code is written, not the way you'd describe it to a colleague — "service worker cache" rather than "works offline". The embedding model matches vocabulary in context; it does not reliably infer that caches.match() means offline support.


Indexed file types

Text and source files up to 1MB:

.py .js .jsx .ts .tsx .html .css .md .txt.sql .sh .ps1 .bat.go .rs .java .cs .rb .php .vue .svelte .kt .swift.c .h .cpp .hpp .scala .ex .exs

Config and data formats (.json, .yaml, .toml, .ini) are deliberately not indexed: generated files like package-lock.json crowd out real code in search results. grep_code reads straight from disk, so literal lookups in those files still work.

Three of these get structural parsing rather than fixed-size windows:

  • Python — functions and classes become individual chunks
  • JavaScript / TypeScript — parsed with acorn
  • HTML — inline <script> is parsed as JavaScript with correct absolute line numbers, inline <style> is skipped, and remaining markup is chunked as prose only when it reads like prose rather than a navigation menu

Everything else is chunked into overlapping windows, which works acceptably for uniform content.

.gitignore is respected, along with a default skip list (node_modules, .git, dist, build, __pycache__ and similar). If a root contains nothing indexable, index_project says so and lists what it looks for, rather than reporting a successful index of nothing.


Configuration Reference

Environment VariableRequiredDescriptionExample
ALLOWED_DIRSRequired (manual config)Semicolon-separated list of directories the server may access. There is no unrestricted mode — if this is empty and no project_dirs are passed, every filesystem, search and analysis tool refuses to run. The .mcpb extension config uses project_dirs (a folder picker, see below) instead of this env var — both feed the same boundary.C:\Users\Me\Desktop;D:\Projects
DATA_PATHRequired via .mcpb config screen (Data Folder); optional in manual configWhere the unified SQLite database is stored, including automatic snapshots (DATA_PATH/snapshots/). Manual-config default is ~/.karp-premium (the name dates from the Premium release and is kept so existing data still loads).C:\path\to\data
ALLOWED_COMMANDSOptionalSemicolon-separated command prefixes for run_check. Defaults to node --check only. Leave empty to disable terminal execution entirely. Adding test or build runners lets a project execute its own code — npm test/npm run build run scripts from that project's package.json, and pytest runs its conftest.py. Only add them for repositories you trust.node --check;npm test;pytest
TRASH_DIROptionalWhere soft-deleted files go. Defaults to DATA_PATH/trash.C:\path\to\trash

MCPB Extension Config (as actually shipped)

Users configure these two fields via Claude Desktop's built-in settings UI when installing the .mcpb. data_path is a single folder picker; project_dirs is a multi-select folder picker ("multiple": true) — click it again to add more folders, and it expands to as many directories as you pick:

json
{  "user_config": {    "data_path": {      "type": "directory",      "title": "Data Folder",      "description": "Choose where to store your knowledge graph and code index. Pick any folder — your data stays on your machine and survives extension updates.",      "required": true    },    "project_dirs": {      "type": "directory",      "title": "Project Folders",      "description": "Choose one or more top-level folders Claude can read, write, and search within (subfolders included). This is the file boundary for all filesystem tools — Claude can't touch anything outside these. Click again to add more.",      "multiple": true,      "required": true    }  }}

Under the hood, multi-select directory fields expand into separate command-line arguments (per the MCPB spec — arrays aren't passed through env as a single string), so project_dirs is wired into args rather than env. server/index.js reads both process.argv (for the .mcpb path) and the ALLOWED_DIRS env var (for manual config), merges and dedupes them.


All 52 Tools

Filesystem (20 tools)

ToolDescription
list_allowed_directoriesShow which directories the server can access
read_fileRead a text file with optional head/tail line limits
read_filesRead multiple files in a single call
write_fileAtomic write (temp file + rename) with parent dir creation
patch_fileEdit a file by replacing one exact text match
list_directoryList files and dirs with type, size, modification date
directory_treeRecursive tree view respecting .gitignore
file_infoDetailed metadata: size, dates, permissions, MIME type
move_fileMove or rename files and directories
copy_fileCopy files or directories (recursive)
create_directoryCreate directories (and parents)
delete_fileSoft delete to trash (or permanent)
find_filesGlob pattern search with date/size filters
search_replaceCross-file find and replace with dry-run preview
disk_usageBiggest files, directory sizes, breakdown by extension
checksumSHA256 hash of one or more files
run_checkExecute pre-approved terminal commands (syntax check, tests, linter)
list_allowed_commandsShow which commands are approved for run_check
git_checkpointSafety checkpoint: git commit or SQLite snapshot fallback
karp_undoRevert file changes using saved snapshots

Knowledge Graph (11 tools)

ToolDescription
rememberStore a memory, decision, todo, insight, changelog, or custom type
recallSemantic search across the knowledge graph by meaning
forgetDelete a node permanently
connectCreate a named relationship between two nodes
updateEdit a node in place — preserves its id, created_at and edges, re-embeds only if the text changed
graph_searchKeyword search across node summaries and details
graph_listBrowse nodes by type, tags, or date
propose_node_typeCreate a custom node type with icon and description
kg_statusHealth check: node counts, DB size, embedding coverage
graph_snapshotBackup the entire database
re_embedRebuild all vector embeddings

Code Intelligence (14 tools)

ToolDescription
search_codeHybrid code search — fuses semantic similarity with literal term matching. mode accepts hybrid (default), semantic, or literal
grep_codeExact string or regex search with context lines
file_outlineStructural overview: classes, functions, signatures, line numbers. Takes an absolute path or one relative to a root
index_projectBuild or rebuild the semantic search index across every configured root
reindex_fileRe-index a single file after editing. Takes an absolute path or one relative to a root
file_historyList saved snapshots of a file
file_diffDiff between snapshots or against the live file. Refuses rather than guess when the same path exists under several roots
project_statsIndex statistics: files, chunks, extensions
set_projectSet one root, or several at once for a monorepo — all search, grep and index tools then span every root
list_projectsEvery indexed root with chunk/file counts, last indexed date, and whether it still exists on disk
index_statusWhat's new, changed or deleted since the last index — tells you whether indexing is needed at all
forget_projectDelete one root's index and reclaim the space. Dry run by default
export_indexExport a root's chunks and embeddings to a portable file
import_indexImport an exported index, optionally remapping the root path

Server (1 tool)

ToolDescription
server_statusVersion, uptime, directory boundary, allowed commands, database size, index totals, snapshot health

Developer Intelligence (6 tools)

ToolDescription
repo_mapCompressed structural map — function signatures and class names across a directory, without implementation code. 10,000 lines → 500 tokens.
dependency_graphImport/require mapping across the project. Finds circular dependencies.
impact_analysis"If I change this file, what breaks?" Blast radius + symbol reference tracking.
dead_codeFind exported symbols that nothing imports
todo_scanExtract TODO, FIXME, HACK, XXX, NOTE comments across the codebase
security_auditScan for API keys, tokens, private keys, high-entropy strings, hardcoded credentials

Architecture

┌─────────────────────────────────────────────┐│            KARP Inspector v0.5.0            ││         52 tools • 1 server • 1 database    │├─────────────────────────────────────────────┤│                                             ││  server/index.js ─ MCP Protocol (hand-rolled) ││     │              runs directly via stdio  ││     │              (Desktop's entry_point)  ││     ├── filesystem.js   (20 tools)          ││     ├── graph.js        (11 tools)          ││     ├── inspector.js    (14 tools)          ││     └── intelligence.js ( 6 tools)          ││                                             ││  database.js ── Unified SQLite (WAL mode)   ││     ├── nodes          (knowledge graph)    ││     ├── edges          (relationships)      ││     ├── type_definitions                    ││     ├── chunks         (code index)         ││     ├── file_hashes    (change detection)   ││     └── snapshots      (version history —   ││                          auto + manual)     ││                                             ││  utils.js ── Shared helpers + dir boundary  ││                                             │├─────────────────────────────────────────────┤│  Stack: Node.js • SQLite • ONNX • Acorn    ││  Protocol: Hand-rolled MCP (no SDK dep)     ││  Embeddings: bge-small-en-v1.5 (local)      ││  External services: None                    │└─────────────────────────────────────────────┘

What makes this different

  • Unified database — Code index, knowledge graph, and version history in one SQLite file. A file write, an index update, and a changelog entry happen in the same transaction.
  • Multi-root projects — set_project takes one directory or several. A monorepo's frontend/ and api/, or a project plus its shared library, are searched and indexed together instead of switching back and forth. Chunk ids are namespaced by root, so two roots holding the same README.md or src/index.js coexist cleanly.
  • The index is visible and reversible — index_status says whether indexing is even needed, list_projects shows what's stored, and forget_project removes a root you indexed by mistake. Most tools in this space let you build an index and never look inside it again.
  • No SDK dependency — Hand-rolled MCP protocol over stdio. Fewer dependencies, fewer failure modes.
  • No external services — No Docker, no Qdrant, no PostgreSQL, no API keys. Everything runs in-process.
  • Knowledge + code in one tool — Ask "why did we change the auth flow?" and get both the reasoning (graph) AND the code diff (inspector).

Performance

ScenarioTime
First index — 12 files, 117 chunks, model load included~17s
Re-index — 12 files, 117 chunks, model cached~13s
Incremental index — 1 changed file0.1s (11 skipped via SHA256)
No-op index — nothing changed0.02s
Semantic search<1s
Grep searchInstant
Repo mapInstant
Dependency graph (first call / cached)Instant / cached 60s
Project switching (cached)Instant
Git checkpoint (SQLite fallback, 19 files)<1s

Embedding runs at roughly 9 chunks/sec on CPU with the full-precision bge-small model. That is the dominant cost of a first index and it scales linearly — 1,800 chunks is about 200 seconds. The fastest index is the one you don't run, which is what index_status and the pre-flight guard on index_project are for. Measured on Windows, Node 24, no GPU acceleration (onnxruntime-node ships CPU-only binaries by default).


Supported Languages

Full AST parsing: JavaScript, TypeScript, JSX, TSX (via Acorn)
Regex parsing: Python (classes, functions, decorators, multi-line signatures)
Section-based chunking: HTML, CSS, Markdown, plain text
Dependency analysis: JavaScript/TypeScript (import/require), Python (import/from)


Requirements

  • Claude Desktop (Windows or macOS)
  • Node.js 18+ (ships with Claude Desktop)
  • Windows — developed and tested here
  • macOS / Linux — core functionality verified by CI on every commit; the .mcpb install flow in Claude Desktop has not yet been walked through by hand on a Mac
  • ~33MB disk for the bundled embedding model (quantized bge-small, ships inside the extension — no download, works offline)
  • No Python, Docker, API keys, or external services

How Is This Different?

ToolFilesystemKnowledge GraphCode IntelligenceTerminal
Anthropic Filesystem Extension✅❌❌❌
KARP Inspector Lite❌❌✅ (9 tools)❌
KARP Graph Lite❌✅ (11 tools)❌❌
Cline✅❌Partial✅
Aider✅❌Partial✅
KARP Inspector✅ (20 tools)✅ (11 tools)✅ (20 tools)✅ (pre-approved commands)

Key differentiators:

  • Filesystem, knowledge graph and code intelligence in one server
  • Unified SQLite database — code changes and decisions in the same store
  • Terminal execution limited to the command prefixes you pre-approve
  • Impact analysis with blast radius — knows what breaks before you break it
  • Repo map — 10,000 lines compressed to 500 tokens
  • Security audit built in — catches secrets before they ship
  • Free and MIT licensed — read the code, fork it, change it

Privacy Policy

KARP Inspector is fully local. No data is collected, transmitted, or shared.

  • No telemetry, analytics, or tracking
  • No network requests after initial model download
  • No API keys or external services
  • Your code never leaves your machine
  • Database stored locally in your configured DATA_PATH

Restoring from a Snapshot

If the database gets corrupted, wiped, or bloated, here's how to actually restore from a snapshot:

  1. Fully quit Claude Desktop first. Toggling the extension off/on in Desktop's UI is not sufficient — the underlying node.exe process can stay running with the old (bad) database already loaded in memory, and any write from that stale process will silently overwrite whatever file you restore. On Windows, if Desktop doesn't close cleanly, end it via Task Manager. Confirmed this the hard way: a toggle left kg_status still reporting the pre-restore state; only a full close did.
  2. With Desktop closed, copy the snapshot you want over the live database: <DATA_PATH>\snapshots\auto-<timestamp>.db (or premium-<timestamp>.db for a manual graph_snapshot) → <DATA_PATH>\premium.db, overwriting it.
  3. Start Claude Desktop back up. server/index.js reads premium.db fresh on process start — this is the point where your restored snapshot actually takes effect.
  4. Verify with kg_status — check total_nodes/total_chunks and db_size match what you expect from the snapshot you restored, not the state you were trying to get away from.

Licence

MIT. See LICENSE. Use it, fork it, ship it.

Up to v0.4.0 this project was sold as KARP Inspector Premium, with 25 of its 52 tools behind an offline licence key. From v0.5.0 the licence check is gone and every tool is free.

Third-party components

ComponentLicence
bge-small-en-v1.5 embedding model (BAAI), bundled in the .mcpbMIT
@huggingface/transformersApache-2.0
acorn and acorn-walkMIT
sql.jsMIT

Contributing

Issues and pull requests are welcome. Please run npm run smoke before opening a pull request; CI runs the same suite on Windows, macOS and Linux.


Support


Built in Adelaide, Australia by SoulDriver
Part of the KARP ecosystem — Knowledge Acquisition Research Protocol
Democratising access to intelligent tools.

来源:README.md,提交 c9a9ec5

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:该软件包类型无法在沙箱中运行。

版本历史

1
  1. v0.5.0最新Nov 21, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Souldriver 集成