Introduction¶
In DeepSeek Harness (DSH), Agents often rely on numerous grep, glob, and read_file calls to reconstruct the structure of a codebase. This approach consumes expensive context and is inefficient. dsh-simple-codegraph aims to address this pain point by providing each DSH Agent with an isolated, project-scoped CodeGraph MCP connection, allowing Agents to obtain relevant source code, call hierarchies, and impact scope with a single centralized exploration call.
Plugin Overview¶
dsh-simple-codegraph is a DSH plugin maintained by QuantumKuba. It provides production-grade, agent-isolated CodeGraph integration and is released under the MIT license.
Core Features¶
- True Agent Isolation: Each active Agent receives a scoped CodeGraph MCP stdio process pinned to its own working directory.
- Concurrent Multi-Project Support: Multiple Agents can work concurrently in separate repositories with zero cross-project leakage.
- Single-Tool Philosophy: By default, only
codegraph_exploreis exposed to minimize schema overhead and eliminate tool-selection confusion. - Zero-Configuration Bundling: Installed natively via
dsh plugin add, with automatic upward discovery of the repository root (.codegraph/). - Compression-Safe Architecture:
CODEGRAPH_EXPLORE_DEDUPremains disabled, ensuring DSH context pruning does not invalidate subsequent model queries. - First-Turn Handshake Guarantee: Tool prompts are preassembled, ensuring the MCP stdio handshake completes before first-turn prompt dispatch.
Installation and Prerequisites¶
Before installing the plugin, ensure that the CodeGraph CLI is installed and that the target project has been indexed.
- Check Installation
codegraph --version
- Initialize the Project
cd /path/to/my-project
codegraph init
- Install the Plugin
Add the plugin to the specified DSH profile (for example,web,coding, or the default profile):
dsh plugin --profile web add dsh-simple-codegraph
Typical Usage¶
After installation, start DSH inside an indexed repository. The plugin automatically starts a CodeGraph MCP server for each Agent session and exposes mcp__codegraph__codegraph_explore in the first turn.
cd /path/to/my-project
dsh --profile web
Notes¶
- Environment Requirement: The CodeGraph CLI must be installed first.
- Model Optimization: The plugin is optimized for local 20B–30B models (for example, Qwen 2.5/3.x 27B/32B and DeepSeek distilled models). In resource-constrained environments, tool schemas consume valuable context, repeated file reads are slow, and unnecessary Agent loops can cause drift.
- License: The plugin is released under the MIT license.
Summary¶
This plugin simplifies how Agents understand codebases by providing isolated MCP connections and a single-tool interface. Developers can enable it directly with standard DSH plugin commands, without manually configuring complex MCP connection parameters.