DM Code Agent MCP Server
Local-first, auditable Python code agent. Ships its own 30-task hidden-test benchmark plus SWE-bench Verified scored by the official harness -- every number reproducible, negative results included.
DM Code Agent is an open-source mcp server by hwfengcs, written mainly in Python, with 153 GitHub stars and the MIT license. Its code was last updated Aug 27, 2026.
DM-Code-Agent works in your local repository and keeps an append-only record of each run. Follow the evidence in the terminal or browser, then export a report another developer can open.
- See the change. Reads, edits, commands, and test output in one execution trail.
- Find the gap. Inspect failures, recovery attempts, and completion without recorded verification.
- Make it yours. Extend tools, providers, and lifecycle hooks around a readable Python agent.
Watch the evidence
Two runs. The same edit. Only one runs the tests.
<a href="https://hwfengcs.github.io/DM-Code-Agent/"> <picture> <source media="(prefers-reduced-motion: reduce)" srcset="docs/media/demo-preview.png"> <img src="docs/media/readme-demo.gif" alt="A tested repair shows failing then passing checks; an untested repair shows a verification gap. Open the interactive demo to inspect both." width="880"> </picture> </a>10-second excerpt of the real browser walkthrough. Scripted assistant decisions; real file edits and unittest checks. No model key required. Watch all 38 seconds.
Try it without an API key
Python 3.10+, three commands. The release wheel includes the browser console; no Node.js needed.
pip install "dm-code-agent[web] @ https://github.com/hwfengcs/DM-Code-Agent/releases/download/v2.1.1/dm_code_agent-2.1.1-py3-none-any.whl"
dm-agent-demo --output demo-run
dm-agent-web --sessions-dir demo-run/sessions --read-only
Open the complete local URL printed by the server. Choose verified.jsonl or unverified.jsonl
and inspect the difference. Use a new or empty output directory.
| Run | Evidence |
|---|---|
verified.jsonl | A retry-boundary bug, a failing test, an edit, and passing checks |
unverified.jsonl | The same edit without a test run; the analyzer flags the verification gap |
The scripted client drives the real agent, file tools, and Python unittest. It makes no model calls, reads no user configuration or extensions, and writes only to the chosen new or empty directory. It demonstrates inspectability, not model performance.
dm-agent-trace analyze demo-run/sessions/unverified.jsonl
dm-agent-trace export demo-run/sessions/verified.jsonl --output report.html --include-content
Open report.html without a server. The demo contains only bundled sample code. For real sessions,
export defaults to a structural summary; --include-content adds redacted task, tool, and edit
excerpts. Review those reports before sharing: redaction cannot recognize every secret.
Use it in your repository
Set your provider's key: DEEPSEEK_API_KEY, OPENAI_API_KEY, CLAUDE_API_KEY, or GEMINI_API_KEY.
Run from a Git checkout you can review:
dm-agent "Inspect this repository and identify the modules that most need tests" --provider deepseek --trace sessions/review.jsonl --show-steps
dm-agent-trace analyze sessions/review.jsonl
Configuration and first task · Xinference / local-model recipe · Web console
The agent can modify files and run commands with your local permissions; it is not a sandbox.
--trace is redacted by default. Full model I/O, checkpoints, and tool replay have separate,
explicit controls. Session privacy and replay.
What makes a run inspectable?
| Your question | The evidence you can inspect |
|---|---|
| What changed? | Ordered tool calls, arguments, observations, and replacement excerpts |
| Where did it fail? | Failure-stage analysis and recovery attempts |
| Did it verify? | Recorded validation actions and a verification-gap signal |
| What changed between runs? | Trace comparison and per-task benchmark regressions |
| What happened to old context? | Compaction appends derived records; originals remain available |
The CLI and console share the same analysis functions. Standalone HTML reports need no server. Recorded checks are not a proof of correctness, and replacement excerpts are not a complete Git diff. Explicit replay and checkpoint-based forks are available for local investigation.
A real repair, with the rough edges left in
12 targeted checks passed. The broader suite still failed.
A live model attempted to repair a historical defect in this repository. Two broader checks remained failing, and the agent exhausted its step budget. The incomplete result is preserved with its patch, supplied tests, token usage, and an independent offline reproduction.
Inspect the live run · Read and reproduce the case
Field notes
Small failures, useful lessons. Each article links its original evidence and an offline reproduction.
| Story | What we learned |
|---|---|
| More steps did not establish a better agent | Pass counts rose from 22 to 24, alongside four regressions and 30.6% more estimated tokens. |
| When source code says “error” | from errors import NotFound was mistaken for tool failure; reclassification removed 38 false positives in the inspected traces. |
| Find the text before changing the code | Content-anchored edits addressed a line-range failure mode, then exposed another bug. |
The bundled benchmark has 30 hidden-test tasks across coding and maintenance. Historical runs support conclusions about those configurations, not a leaderboard claim. The demo is not an evaluation. Methodology · Project status · Research logs.
Build and verify
<details> <summary><strong>Develop from source — tests and deterministic evals need no API key</strong></summary>git clone https://github.com/hwfengcs/DM-Code-Agent.git
cd DM-Code-Agent
uv sync --frozen --extra dev
uv run --frozen dm-agent-demo --output demo-run
uv run --frozen python -m pytest
uv run --frozen python -m dm_agent.evals.cli --variant full --task direct_finish
The contribution guide and agent instructions list the complete checks. Extension examples show how to add behavior outside the kernel.
</details>Find your next step
The homepage, setup guide, local-model recipe, and articles are bilingual; deeper reference docs are mostly in Chinese. Reproducible issues and focused contributions are welcome.
<div align="center">If the evidence helps, give the project a star.
</div>DM Code Agent alternatives
View more →Similar mcp servers in Security & Testing, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.
| Name | Stars | Licence | Last updated | Scan |
|---|---|---|---|---|
| DM Code Agent (this page) hwfengcs | 153 | MIT | Aug 27, 2026 | Scanned, no flagged issues |
| Hexstrike AI 0x4m4 | 13k | MIT | Aug 3, 2026 | Scanned, no flagged issues |
| Viper FunnyWolf | 5.3k | None found | May 31, 2026 | Not scanned yet |
| Open Ontologies fabio-rovai | 2.7k | MIT | Oct 30, 2026 | Scanned, no flagged issues |
| Qu1cksc0pe CYB3RMX | 2.1k | GPL-3.0 | Sep 18, 2026 | Scanned, no flagged issues |
| Cve MCP Server mukul975 | 1.7k | Apache-2.0 | Oct 1, 2026 | Scanned, no flagged issues |