onto-agent
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
๐ OntoAgent
The All-Knowing Code Brain & Architecture Contract Guard for AI Coding Agents
A repository-wide cognitive knowledge graph and architecture governance engine for AI coding agents.
๐ Why OntoAgent?
Modern coding agents face three structural problems when working with large codebases:
Blind men and the elephant: They only see the current file, not cross-module callers, API contracts, and test dependencies.
Long-context hallucination: "Brute-forcing" the entire repository into the Prompt costs a lot of tokens, has a low signal-to-noise ratio, and the model tends to ignore critical constraints.
Destructive changes are hard to trace: Changing one core class makes it hard to quickly know which upstream modules, tests, and interfaces will break together.
Traditional approaches:
Naive Raw Text: Stuff everything into the context โ huge token usage and no structured targeting.
Vector-Chunk RAG: Chunks by text similarity, compresses tokens, but loses AST-level dependencies, inheritance relationships, and contract semantics.
OntoAgent's choice:
Use AST static parsing + embedded graph database to build a repository-wide cognitive graph, so AI agents see the call network, contracts, tests, and blast radius before modifying code.
Related MCP server: code-intel
๐๏ธ Architecture Flow
graph TD
subgraph Base["ๅบๅบงๅฑ"]
Kuzu["Kรนzu Embedded Graph DB"]
AST["AST Parsers: Python / TypeScript / Markdown / JSON"]
end
subgraph Core["ๆ ธๅฟๅผๆ"]
Blast["Blast Radius Analyzer"]
Context["Smart Context Extractor"]
Compliance["Architecture Compliance Guard"]
Scanner["Codebase Scanner & Entity Ingestion"]
end
subgraph Ecosystem["ไบคไบ็ๆ"]
MCP["MCP Server"]
DSH["DSH / Cordis Plugin"]
CLI["onto-agent CLI"]
Dashboard["React 2D Canvas + Dagre Dashboard"]
end
AST --> Scanner
Scanner --> Kuzu
Kuzu --> Blast
Kuzu --> Context
Kuzu --> Compliance
Blast --> MCP
Context --> DSH
Compliance --> CLI
Scanner --> Dashboard๐ Benchmark
Reproduce with one command:
python benchmark/run_benchmark.pyBased on deterministic code fixtures, comparing three context construction strategies:
Method | Tokens | Token Reduction | Critical Dep Recall | Test & Contract Recall | Blast Precision | Blast Recall | Blast F1 |
A. Naive Raw Text | 1162 | 0.0% | 100.0% | 100.0% | 50.0% | 100.0% | 66.7% |
B. Vector-Chunk RAG | 282 | 75.7% | 0.0% | 66.7% | 60.0% | 60.0% | 60.0% |
C. OntoAgent AST Graph | 120 | 89.7% | 100.0% | 100.0% | 100.0% | 100.0% | 100.0% |
Conclusions:
OntoAgent reduces token consumption by about 89.7% compared to Naive Raw Text.
OntoAgent leads Vector-Chunk RAG across the board in critical dependency recall, test/contract recall, and blast radius targeting.
Full report:
benchmark/reports/benchmark_report.md.
๐ Quickstart
1. Install
pip install -e .[test]2. Scan the entire repository
onto-agent scan --path .3. Launch the visualization workbench
python dashboard/api_server.py
# ๆๅผ http://127.0.0.1:80004. Configure MCP
Copy integrations/cursor_mcp.json to .cursor/mcp.json, or merge it in Claude Desktop:
{
"mcpServers": {
"onto-agent": {
"command": "python",
"args": ["-m", "onto_agent.mcp"]
}
}
}5. Install the DSH native plugin
dsh plugin --profile web add ./integrations/dsh/onto-agent-plugin๐ง Agent Abilities
get_blast_radius(file_path)
Before modifying any file/symbol, returns:
Direct callers
Indirectly affected modules
Downstream dependencies
Associated API contracts
Tests that must be run
check_architecture_compliance(strict=True)
Checks:
Circular imports
Cross-layer violation calls
Core classes not covered by tests
get_smart_context(query_or_symbol)
Generates high signal-to-noise context before refactoring/generation:
Definition, line numbers, Docstring
Class/function list
imports / callers
API contracts, related tests, related documentation
๐ Ecosystem
Entry | Method |
MCP | 10 tools including |
DSH |
|
CLI |
|
REST |
|
Dashboard | React + Force Graph + Dagre hierarchical architecture diagram |
๐๏ธ Project Layout
src/onto_agent/
โโโ engine/ # Scanner, ArchitectureGuard, Context, Steering, Reflection
โโโ storage/ # Kรนzu graph storage adapter
โโโ mcp/ # MCP Server
โโโ client/ # Python SDK
โโโ cli.py # Unified CLI
dashboard/ # FastAPI + React workbench
benchmark/ # Reproducible Codex-for-Open benchmark
integrations/ # Cursor / Claude / Windsurf / DSH
docs/ # Design docs & tickets
tests/ # 48+ unit / integration tests๐ Documentation
๐ License
This project is open-sourced under Apache-2.0.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Codebase intelligence for AI agents โ dead code, blast radius, ownership.
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Related MCP Servers
- AlicenseBqualityDmaintenanceTransforms codebases into structural knowledge graphs for AI agents and developers, providing precise architectural awareness and dependency mapping.1530MIT
- AlicenseNot gradedqualityDmaintenanceProvides semantic code search and code insights via a knowledge graph, enabling AI to understand, navigate, and modify complex projects with deep dependency and architecture analysis.MIT
- AlicenseNot gradedqualityDmaintenanceSupercharges AI coding agents with semantic code intelligence, providing pre-built knowledge graphs for surgical context, faster answers, and fewer tool calls.MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI coding agents with persistent architectural memory of codebases, enabling impact analysis, test generation, and code generation with reduced token usage.MIT