CODYNEX Engine
Mines local Git history (git log) for architectural decisions, bug history, and churn hotspots to inform impact analysis, risk scoring, and change planning.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CODYNEX Engine what breaks if I change auth.py?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐งฌ CODYNEX Engine
๐งฌ CODYNEX Engine โ codebase intelligence: an engine that reads your entire
project and builds a structured model of it โ architecture, dependency graph,
design decisions, bug history. Blast-radius prediction โ ask what breaks if
you touch auth.py, and get a ranked impact analysis. Apply a patch in an
isolated sandbox and see the test verdict before the change ever lands.
Stdlib-only Python. Zero dependencies.
๐ Quickstart
git clone https://github.com/Thegreatprabh/codynex-engine.git
cd DNA
pip install -e . # stdlib only โ nothing else to install
dna init ./my-project # ingest โ build the DNA
dna map # architecture: components + dependency stats
dna impact "auth.py" # blast radius: what breaks if I change this?
dna plan "change the login system" # predict a natural-language change
dna verify --patch fix.diff # sandbox: apply patch, run tests, report
dna watch # keep the DNA updated as files changeThe DNA is saved as JSON at ~/.dna/<project>/dna.json (dir 0700).
Run dna watch during development, or re-run dna init after big changes.
Related MCP server: astra-mcp
๐งช How it works โ ingest โ model โ analyze โ verify
source code โโโบ INGEST โโโบ MODEL โโโบ ANALYZE โโโบ VERIFY
(.py files) ast parse ProjectDNA blast radius isolated
git log dep graph risk report sandbox
mining reverse decisions + pytest
graphIngest โ stdlib
astparses every Python file: imports (absolutepkg.suband relative.sibresolved to real files), functions, classes, call edges.git logis mined for architectural decisions, bug history, and churn hotspots. An intent extractor records what each component is for: module docstring, README mentions, and thetest_*names of tests importing it. No git? The graph still builds โ history is skipped gracefully.Model โ a
ProjectDNA: per-file components with one-line purpose summaries, a dependency graph and its reverse graph, decisions, hotspots, test coverage, and per-component intents. Persisted as JSON.dna watchkeeps it live: it polls mtimes and re-parses only changed files, so the model never goes stale.Analyze โ
dna impactruns reverse-BFS from your target over the dependency graph and scores every affected component.dna plantakes a natural-language change request, resolves it to components with a stated confidence, and returns the blast radius plus suggested tests.dna risksreports circular imports (Tarjan SCC), god-files, dead-code candidates, untested components.dna decisionslists design choices mined from commits.Verify โ
dna verifycopies the tree to a temp dir, applies your unified diff (context-verified โ mismatched hunks are refused, new-file creation rejected), and runs the project's own test suite with a timeout.
๐ฅ Blast-radius prediction
$ dna impact "auth.py"
target: auth.py โ auth.py, session.py, api/routes.py
affected components: 3
RISK SCORE DEPTH COMPONENT
------------------------------------------
high 5 1 session.py
ยท no test coverage
ยท churn hotspot
ยท depth 1
medium 3 2 api/routes.py
ยท no test coverage
low 1 1 auth.py
ยท target itself
โโ 3 components ยท 1 high-risk โโRisk scoring is explicit, not magic: no test coverage +2, circular dependency +2, churn hotspot +1, depth > 3 +1. Labels: 0โ1 low, 2โ3 medium, 4+ high. Every score comes with its reasons printed.
dna impact checkout --limit 30 # fuzzy match โ file, or even a function name๐ง Change planning โ predict before you change
$ dna plan "change the login system"
TARGET: auth.py (confidence: high)
request: change the login system
affected components: 3
RISK SCORE DEPTH COMPONENT
------------------------------------------
high 5 1 session.py
ยท no test coverage
ยท churn hotspot
medium 3 2 api/routes.py
ยท no test coverage
SUGGESTED TESTS:
tests/test_session.py
tests/test_routes.py
RISK SUMMARY: high=1 medium=1 low=0
HOTSPOTS IN BLAST:
session.py (12 commits)dna plan resolves your request to components (exact path/basename โ
high confidence, fuzzy match โ medium, keyword fallback โ low),
reuses the blast-radius engine, and suggests the tests that cover the
affected code. Confidence is always shown โ a low plan tells you the
match was a guess, not a fact.
๐งซ Sandbox verification
$ dna verify --patch fix.diff --path ./my-project
verifying patch in sandbox (project: ./my-project) ...
patched: auth.py
tests: PASS โ 42 passed, 0 failed in 1.8sThe patch is applied to a throwaway copy โ your working tree is never touched. Only verify projects you trust: the sandbox runs the project's own test suite, so it inherits your trust in that code.
๐๏ธ Live watcher โ DNA that stays current
$ dna watch --interval 2
ingesting /home/you/my-project ...
watching 38 files in /home/you/my-project (every 2s) โ Ctrl+C to stop
update #1: ~1 changed โ DNA saved (38 files)
update #2: ~1 changed, -1 deleted โ DNA saved (37 files)dna watch polls file mtimes (stdlib only โ no watchdog dependency) and
re-parses only the files that changed, then rebuilds and re-saves the
DNA. New files, deleted files, and edits are all picked up; Ctrl+C
exits cleanly. The DNA stops being a snapshot and becomes a living model.
๐ค MCP โ for AI agents
Four tools over stdio JSON-RPC. Malformed input returns -32600; the
server never crashes.
Tool | Args | Returns |
| โ | Components, dependency stats |
|
| Ranked blast radius with reasons |
|
| Full change prediction + suggested tests |
|
| Decisions mined from git history |
{ "project": { "command": "<FULL PYTHON PATH>", "args": ["-m", "dna", "mcp"] } }๐ Full per-agent setup guide: docs/SETUP_ALL_AGENTS.md โ Claude Code, Claude Desktop, Cursor, Codex, ChatGPT Desktop, Gemini CLI, Antigravity, Termux. (Golden rule: GUI apps need the full python path.)
โ ๏ธ Risk report
dna risksrisk report: my-project (38 components, 112 edges)
circular imports: 1
โป api/routes.py โ db/session.py โ api/routes.py
god-files (>500 lines): 2
legacy/parser.py (812 lines)
dead-code candidates (no inbound, no tests): 3
utils/old_helpers.py๐งฑ Honest limits โ v0.2.0
Python only. Other languages are invisible to the parser.
Fuzzy target matching is heuristic. Ambiguous names resolve to the first/best match; verify with
dna mapwhen unsure.dna planalways shows its confidence โ treatlowas a guess.Call-graph resolution is best-effort. Dynamic imports,
exec,getattr-style dispatch, and method calls on unknown receivers are not tracked. The dependency graph is file-level (imports), which is robust; function-level edges are informational.The sandbox runs the project's own test suite. Only verify projects you trust โ same trust level as running their tests locally.
Patch applier is minimal. Unified diffs with new-file creation (
/dev/nullsources) are rejected; complex renames may fail โ the tool refuses rather than mis-applying.The watcher polls. It checks mtimes on an interval (default 2s), so sub-second bursts of edits may batch into one update. It does not watch git history โ commit, then re-mine decisions with
dna init.Intent is extracted, not understood. Summaries come from docstrings, README mentions, and test names โ useful signal, not deep comprehension.
๐ Verify it yourself
python -m pytest tests/ -q # 56 tests โ should all passTests are fully mocked โ zero network, zero real git, under a second. Every badge above is checkable in this repo.
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐งฌ DNA CORE โ
โ ingest ยท model ยท analyze โ
โ ยท verify โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ INGEST โ โ MODEL โ โ ANALYZE โ
โ ast parser โ โ ProjectDNA โ โ reverse-BFS โ
โ import resolve โ โ dep + reverse โ โ risk scoring โ
โ git log miner โ โ decisions โ โ Tarjan cycles โ
โ degrades w/o โ โ hotspots โ โ god-files โ
โ git โ โ JSON @ ~/.dna โ โ dead code โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ VERIFY + MCP โ
โ temp-dir sandbox ยท context-verified โ
โ patch applier ยท pytest ยท 3 MCP tools โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ~2,000 lines of Python. No frameworks. No dependencies. The whole model fits in one JSON file you can open and read.
๐ค Contributing
New analyzers are the best contribution:
Fork โ branch โ add your analyzer under
dna/analysis/Add a test in
tests/(mocked โ no network, no real git)pytest tests/ -qmust stay greenOpen a PR explaining what it detects and why it matters
๐ License
MIT ยฉ 2026 Prabhjot Singh. Know your codebase's genome before you edit it. ๐งฌ
Available Tools
4 toolsdna_decisionsC
Architectural decisions mined from git history.
Inputs: limit, project.
dna_impactC
Predict blast radius of changing a component.
Inputs: target (required), project.
dna_mapC
Architecture summary of the ingested project.
Inputs: project.
dna_planC
Full change prediction for a natural-language request.
Inputs: request (required), project.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 4 tools
Each tool targets a distinct capability: architecture summary, component impact, historical decisions, and request-level change planning. No two tools overlap in input or output scope, so an agent can easily select the right one.
All four tools use the dna_ prefix followed by a single noun (map, impact, decisions, plan), forming a consistent and predictable naming convention.
Four tools are well-suited for a focused architecture analysis engine; each covers a unique analysis dimension without redundancy.
The set covers key analysis outputs (summary, impact, decisions, plan) but lacks a tool to ingest/refresh the project or drill into specific components/decisions, leaving minor workflow gaps.
Maintenance
Related MCP Connectors
Codebase intelligence for AI agents โ dead code, blast radius, ownership.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLive codebase intelligence for AI agents. Import graph PageRank for file importance, git forensics for co-change coupling and fragile code, convention detection across 16 domains, and blast radius analysis.21 npm3Business Source 1.1
- AlicenseBqualityBmaintenanceEnables AI agents to index local Python repositories and retrieve code intelligence through semantic search, caller lookups, hybrid context expansion, and visualization.5MIT
- AlicenseBqualityBmaintenanceIndexes a Python/JS/TS repository into a local SQLite knowledge graph so agents can trace callers, callees, imports, subclasses and covering tests, measure impact radius, rank diff risk, and summarize architecture without grepping files. Exposes these queries as MCP tools alongside an equivalent CLI, with no daemon, embeddings, or network access.10MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to query a local structural code graph, inspect relationships and impact, and retrieve focused project context before reading full files.28 npmMIT