ozagia
OfficialThis 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.
ozagia
Ozma advanced graph integration agent. A live code graph for LLM coding agents: index a repository into typed nodes (files, symbols, tests, docs, imports, call edges), keep it current while the agent edits, and put it in the agent's path. MIT licensed.
Status: alpha. The library, the MCP server, the OpenCode capture plugin and
the agent harnesses work; the Claude Code, Codex and Kiro hooks are implemented
but untested against a live host. Measurements are in docs/results/; plans in docs/plans/; release sequencing
and the current plan audit in docs/roadmap.md.
A generated reference for this repository's own shape (layout, modules, docs,
entry points and commands) is REPO_SHAPE.md, produced by
ozagia overview (docs/repo_shape.md).
The Ozma protocol research is preserved here as a design basis for Ozagia's future model interfaces. Its historical drafts and implementation are reference material, not a claim of current protocol conformance.
Install
curl -fsSL https://ozagia.com/install | bash
cd /path/to/your/repo
ozagia # OpenCode's TUI with the ozagia graph in its pathThe installer puts a self-contained ozagia (its own Python, with the
tree-sitter parsers) and a pinned OpenCode release under ~/.ozagia, checks
every download's sha256, and adds ~/.ozagia/bin to PATH. Linux (x64, arm64,
glibc) and macOS (arm64, x64). ozagia self check --tui verifies the install;
ozagia self upgrade and ozagia self uninstall manage it. See
docs/install.md; releases are made as in
docs/release.md.
Related MCP server: codegraph-mcp
What it does
Graph index: files, symbols, tests, docs, imports, git history and known failures as one graph snapshot, with project-specific nodes added by adapters.
Retrieval: ranked repo map (PageRank over references), fused lexical and graph code search, symbol-level callers, callees and impact, architecture summary. Optional language-server refinement (pyright, rust-analyzer).
Graph-addressed edits: Python symbol and AST ops, Rust/Lua CST ops, Markdown section ops, JSON path ops, HCL block/attribute ops and optional comment-preserving YAML path ops. Preview by default, base hash check, atomic write, backup. A diff is output only, never input.
Review: deterministic review of a commit range (
ozagia-review) or of the whole repository (ozagia review-repo: import cycles, test gaps, dead symbols, stale doc references, security hygiene, ops sources, lock files), with stable finding ids and graph keys. No model calls.Deep review:
ozagia deep-reviewcomposes an offline-by-default, subject-based report across security, performance, failure modes, data structures, scalability, architecture, tests, dependencies, operations, docs/API and correctness; per-subject coverage, boundedevidence/excerpts,findings.json, a manifest, baseline deltas and a caller-selected--fail-ongate.--profile change(aliasreview-change) is a compactHEAD~1..HEADrange preset;--rangeadds change-set review and--profile-reportadds measured profile evidence. External scanners run only when named with--security-tool;--security-networkis a separate opt-in, and per-tool provenance is recorded. Dependencies include local licence/version inventory, optional exact-version matching or OSV-style introduced/fixed ranges against an explicit local advisory file (range matching supports Node/Rust strict SemVer,v-prefixed Go and Python PEP 440; Ruby, Composer and Maven are exact-version only; Ruby matches only BundlerGEMsource pins, not Git/path pins), andsbom.jsonwith CVE state unknown.ozagia-statushas a read-onlyreviewssection. An optional--model-pass(requires--liveandOZAGIA_EVAL_LIVE=1) writes advisory, unverified, role-mapped candidates tomodel-review.jsonunder time/request/token/cost budgets, with optional Ocelot candidate clustering; candidates never block. (docs/deep_review.md)Evals: a leakage-checked retrieval eval, a break/fix agent eval with selectable agent backends (OpenCode, Claude Code), and an index bench.
Profiles:
ozagia profilereads existing cProfile, Speedscope/py-spy, Chrome/Node CPU, foldedperf, OTLP trace/metric and Prometheus text artifacts; joins active frames to graph symbols, callers and impact; and reports hotspots, paths, service operations, metrics and baseline changes.ozagia profile run --allow-execcollects one explicitly approved cProfile, py-spy or Node run under the resource policy. Offline by default (docs/profiling.md).
Ways to use it
depth | how | status |
Library |
| works |
MCP server |
| works |
Engine surface |
| new; no model-task gain measured |
External tools |
| discovery only; never installs |
OpenCode plugin | captures | works (OpenCode 2.3, live smoke runs) |
Claude Code hooks | partial capture: graph context after each tool, git ref refusal; | implemented, untested live |
Codex hooks | graph context after shell commands and patches, git ref refusal, a session brief, the MCP server and an | implemented, untested live |
Kiro CLI hooks | git ref refusal, node-key reads answered from the graph, graph refresh after edits, a session brief, the MCP server; | implemented, untested live |
Harness |
| implemented; the eval's live runs use the same pieces |
Infrastructure | Opt-in source-only Terraform, Kubernetes and related infrastructure graph/context (docs/iac_context.md) | experimental, partial static analysis |
SRE/IaC operations | Opt-in job waiting, nested command/network relays, ops receipts, supplied live-state snapshots, offline IaC checks and dry-run preflight (docs/sre_operations.md, docs/relay.md) | experimental; live paths default off |
Workspace checks |
| read-only; cleanup is dry-run |
OpenCode GUI add-in | Graph, status and test-plan side panel plus commands, backed by a server RPC over the ozagia CLIs (docs/opencode_addin.md) | read-only; build/typecheck verified against OpenCode 2.3 |
Goals |
| new; no live harness runs yet |
Python environments |
| new; probes interpreters only with |
Quick start (from source)
uv pip install -e '.[all]' # or: pip install -e '.[all]'
cd /path/to/your/repo
ozagia index # builds or refreshes .ozagia/graph.json
ozagia-memory search "retry backoff"
ozagia-memory context "make the retry loop give up after five attempts"Add .ozagia/ to the repository's .gitignore.
OpenCode with the graph in its path (needs opencode on PATH):
ozagia agent --prompt "make tests/test_retry.py pass" -m vllm/qwen3.8-27b
ozagia agent --clone --prompt-file task.txt # in a throwaway clone of HEAD
ozagia agent # the interactive TUIEach session builds or refreshes the snapshot, starts the graph daemon, installs the plugin, runs OpenCode, and removes the plugin and stops the daemon afterwards, also on Ctrl-C. See docs/harness.md.
When OpenCode exposes its V2 session context hook, the plugin also uses the current request and recent conversation to retrieve a small, source-attributed graph hint before a model call. It omits hints when the snapshot cannot be verified as fresh. The hint is capped at 1,600 characters (an approximate, model-dependent token budget), and can recur on later model calls; its effect on total tokens and elapsed time depends on the task. Prompts and history are not written to the daemon journal. The hook is optional and falls back if the daemon or hook is unavailable.
MCP (OpenCode opencode.json):
{
"mcp": {
"ozagia": {
"type": "local",
"command": ["/path/to/venv/bin/python", "-m", "ozagia.integrations.mcp.server"],
"environment": {"OZAGIA_ROOT": "/path/to/your/repo"}
}
}
}Configuring a repository
Without configuration ozagia indexes the whole checkout, skipping the usual
build and cache directories. A .ozagia.toml at the root narrows the source
directories, sets the docs to index, extra import roots and skip names, and
names adapters. The full schema is in src/ozagia/config.py.
[index]
source_dirs = ["src", "tools"]
test_dirs = ["tests"]
docs = ["README.md", "docs/**/*.md"]
[adapters]
modules = ["tools.my_adapter:register"]An adapter is a register(registry) function that adds indexers (extra node
and edge types), edit engines, MCP tools or graph queries. See
src/ozagia/adapters.py. Ocelot's adapter
(tools/ozagia_ocelot_adapter.py in https://github.com/ozmalabs/ocelot) is a
worked example: it adds seed manifests and rules as graph nodes.
Research mode
Use ozagia-mcp --mode research --root /path/to/workspace for source-backed
research graphs, or --mode combined to expose research and coding tools
together. Coding mode remains the default. Research mode includes bibliography
import/export, open-access artifact fetch with content hashes, PDF/TEI text
extraction, BM25 and optional hybrid vector search, citation-graph traversal,
citation-context candidates, evidence tables, screening decisions,
manuscript bundles with citation checks, structured review plans with
multi-model runs and reconciliation, steelman/red-team arguments, structured
extraction with effect sizes, risk-of-bias/certainty appraisal, contradiction
scanning, living-review alerts and a theory-competition ledger with graded
compatibility and shared-evidence analysis. See
research mode for setup, optional dependencies and
model/Lean limitations, structured review for the
review matrix, synthesis for
extraction/appraisal/alerts, theory competition for
rivals and evidence basis, paper review for the
end-to-end structured review, PDF extraction for
claim candidates, source formats for books, notes,
websites and epistemic holdings, and
external providers for the opt-in scraper
boundary.
Origin
ozagia was extracted, with its history, from the Ocelot repository, where it
was built as Ocelot's dev tooling. Most docs under docs/ still use Ocelot as
the example repository, and docs/results/ holds the measurements made on
Ocelot.
Development
See AGENTS.md.
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.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to efficiently understand and navigate a codebase by providing semantic search over symbols and a reference graph, replacing expensive grep/glob calls with structured tools like definition lookup, caller/callee queries, and change-impact analysis.4MIT
- FlicenseNot gradedqualityBmaintenanceProvides efficient code navigation and graph-based analysis for AI agents, enabling symbol resolution, callers, implementations, and type schemas with minimal token usage.-
- AlicenseNot gradedqualityDmaintenanceProvides semantic codebase understanding via a graph, enabling AI agents to search, explore, and plan changes with whole-repo context in a single tool call.33MIT
- 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.24 npmMIT