rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
PROJECT README
Give your agent a map of the codebase instead of a bag of greps.
English · 中文 · Whitepaper · Docs

grep finds text. It does not know that Object.handler is called by three tools, that apply is the entry point, or that src/engine.mjs is imported by src/index.mjs and nothing else. Every time your agent needs to answer "who calls this", it greps, reads five files, and guesses.
This plugin gives DeepSeek Harness a real code graph. It bridges to codebase-memory-mcp, keeps the daemon running, and registers six tools that answer structural questions directly. The agent asks once and gets the call chain.
# 1. Install the plugin into your DSH profile
dsh plugin --profile web add @lovedolove/dsh-codebase-memory-mcp
# 2. Make sure the binary is on your PATH (or set CBM_EXE)
codebase-memory-mcp --version
# 3. Start the harness. The daemon starts with it.
dsh web
On startup you should see this on stderr:
[codebase-memory] 🔍 codebase-memory UI is live: http://localhost:9749/
Open http://localhost:9749/ in a browser and the graph UI is already waiting. Build an index once, then ask the agent about any symbol.
# Index a repository (the tools do not index on their own)
codebase-memory-mcp cli --quiet index_repository '{"repo_path":"/absolute/path/to/repo"}'
Then just ask, or call a tool directly:
cbm_search { name_pattern: ".*Handler.*" }
cbm_trace { symbol: "Object.handler", direction: "inbound" }
cbm_snippet { qualified_name: "app.auth.login" }
| Tool | Answers |
|---|---|
cbm_projects |
What has been indexed, and how fresh is it |
cbm_search |
Which symbols match a name, label, or path pattern |
cbm_trace |
Who calls this, or what this calls, to a chosen depth |
cbm_snippet |
The exact source of one symbol |
cbm_arch |
How a directory is structured and what depends on what |
cbm_search_code |
A text search for literals, errors, and config values |
Above the tools, the plugin also gives you:
/cbm command. Prints the executable path, the UI URL, and every indexed project with its status.DSH agent ──▶ cbm_* tool ──▶ engine ──▶ JSON-RPC over stdio ──▶ codebase-memory-mcp
│
browser ──▶ http://localhost:9749/ ──▶ graph UI ◀────────────────────┘
Three layers, each replaceable on its own:
src/index.mjs) reads the config, starts the daemon, and registers tools, prompt guidance, the skill, and the command.src/engine.mjs) translates DSH argument names into upstream names, guards the repository boundary, and returns a degraded shape when the binary is missing.src/client.mjs) spawns the binary, speaks MCP JSON-RPC 2.0, and owns the process lifecycle.Read the architecture doc for the reasoning, and the whitepaper for why the boundary sits where it does.
Every deployment can set these in cordis.yml:
plugins:
codebase-memory:
exePath: /usr/local/bin/codebase-memory-mcp # falls back to CBM_EXE, then PATH
uiEnabled: true # default true
port: 9749 # default 9749
eagerStart: true # default true
Environment variables win where they apply. See docs/configure.md for the full discovery order.
| Variable | Purpose |
|---|---|
CBM_EXE |
Path to the codebase-memory-mcp binary |
CODEBASE_MEMORY_EXE |
Legacy alias for CBM_EXE |
DSH_HOME |
Where DSH stores state, including index metadata |
import { CodeIntelligenceEngine } from '@lovedolove/dsh-codebase-memory-mcp/engine'
const engine = new CodeIntelligenceEngine()
const result = await engine.traceCallPath({
repoRoot: '/path/to/repo',
symbol: 'Object.handler',
direction: 'inbound',
depth: 3,
})
if (result.degraded) {
console.error('No graph available:', result.message)
} else {
console.log(result.raw)
}
The full surface is documented in docs/library-api.md.
| Requirement | Version |
|---|---|
| DeepSeek Harness | >=0.2.0 <0.3.0 (engines.dsh) |
| Node.js | >=18.0.0 <25.0.0 (engines.node) |
codebase-memory-mcp |
Any recent release |
The binary is required for indexing and queries. It is not required for the plugin to load.
The plugin declares five optional peers: @deepseek-ai/cordis at >=4.0.1-rc.1 <5.0.0-0, plus @deepseek-ai/dsh-tools, @deepseek-ai/dsh-system-prompt, @deepseek-ai/dsh-skill, and @deepseek-ai/dsh-commands at >=0.2.0 <0.3.0-0. A missing peer disables the matching feature and logs a warning. It never blocks startup.
| Document | Kind | Read it when |
|---|---|---|
| Install | How-to | You want the steps only |
| Configure | Reference | You need a flag, a variable, or a path |
| Tools | Reference | You are choosing a tool or an argument |
| Architecture | Explanation | You want to know why it is built this way |
| Library API | Reference | You are driving the engine yourself |
| Troubleshooting | How-to | Something does not work |
| Whitepaper | Explanation | You want the design argument and the evidence |
| Whitepaper (中文) | Explanation | 你要读中文版的设计论证和证据 |
| AGENTS.md | Reference | You are an agent working in this repo |
npm ci # install dev dependencies
npm test # 44 tests, node --test
npm run pack:check
The suite covers the client, engine, discovery, tools, watcher, bridge, and plugin lifecycle. Two tests boot a fake MCP server and assert the real handshake.
publish-npm.yml runs on every push to main. It stages the package with npm stage publish, which does not make a release public by itself. A human approves the staged version in an authenticated npm session. Release notes come from CHANGELOG.md.
MIT. See LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: mcp、model-context-protocol、deepseek、mcp-client、deepseek-harness。