OKFGraph MCP Server
Ingests Confluence documentation into the local knowledge graph so business rules and entities can be linked with tickets and code.
Scans Git history and commit metadata to link code changes with tickets and specifications in the knowledge graph.
Ingests GitHub issues/tickets and links them to code symbols, specs, and commits in the knowledge graph.
Ingests GitLab issues/tickets and links them to code symbols, specs, and commits in the knowledge graph.
Ingests Jira tickets into the knowledge graph, enabling cross-domain links between requirements, code, and commits.
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.
MCP-First & Zero Cloud API Bills: OKFGraph runs 100% locally on NetworkX + inverted BM25 (no Docker, no Neo4j, no paid LLM pipeline required). Your existing IDE/Host LLM (Antigravity, Cursor, Claude Desktop) or local Ollama/LM Studio drives graph creation and reasoning directly through OKFGraph's MCP tools.
What it does
Software requirements live in .docx/.pptx/Markdown specs, delivery history lives in Jira/GitHub/GitLab/Azure DevOps tickets, and the actual behavior lives in source code. Plain vector RAG chunks text blindly and loses the structural connections between them.
OKFGraph deterministically ingests all three domains into a single local Knowledge Graph, links business rules and tickets directly to classes, methods, and commits, and serves it through:
A Model Context Protocol (MCP) server (
okfgraph mcp) for AI coding agents.An interactive offline HTML Documentation Portal + Knowledge Graph Map (
okfgraph serve).
flowchart LR
subgraph Sources["Data Sources"]
T["🎫 Tickets\nJira · GitHub · GitLab\nAzure DevOps · CSV/JSON/MD"]
D["📄 Business Docs\n.docx · .pptx · .md · .txt\nGDrive · OneDrive · Confluence"]
C["💻 Source Code\nPython AST · JS/TS/React\nCustom Language Plugins"]
end
subgraph Engine["OKFGraph Local Engine (Zero Cloud API Cost)"]
B["Graph Builder & Cross-Domain Linker\nFile · imports · inherits · contains · calls\nimplements · applies_to · mentions_entity"]
R["SOTA GraphRAG Retriever (~10 ms)\n4-Way RRF · Inverted BM25\n2-Hop PPR · Louvain Communities"]
end
subgraph Outputs["Interfaces"]
M["🔌 MCP Server\nAntigravity · Cursor · Claude\nOllama · LM Studio"]
P["🗺️ Offline HTML Portal\nSearchable Docs +\nInteractive Graph Map"]
end
T --> B
D --> B
C --> B
B --> R
R --> M
B --> PRelated MCP server: Symbra
Features
Benchmarks
All localization scores use the strict LocAgent / Agentless protocol (zero partial credit — 1 iff all ground-truth modified files or (file, leaf_function) pairs appear in the top-k predictions).
1. Turn-1 Zero-LLM Retrieval (benchmarks/run_strict_loc_eval.py)
Dataset | Engine | N | File Acc@1 | File Acc@3 | File Acc@5 | Func Acc@5 | Func Acc@10 |
SWE-bench Lite ( | Flat Keyword (TF-IDF) | 114 | 15.8% | 28.9% | 34.2% | 6.9% | 9.9% |
SWE-bench Lite ( | OKFGraph SOTA (Zero-LLM) | 114 | 39.5% | 58.8% | 65.8% | 25.7% | 31.7% |
Loc-Bench_V1 ( | Flat Keyword (TF-IDF) | 35 | 14.3% | 22.9% | 28.6% | 5.9% | 8.8% |
Loc-Bench_V1 ( | OKFGraph SOTA (Zero-LLM) | 35 | 42.9% | 68.6% | 74.3% | 47.1% | 47.1% |
Loc-Bench_V1 ( | Flat Keyword (TF-IDF) | 20 | 10.0% | 25.0% | 35.0% | 15.0% | 30.0% |
Loc-Bench_V1 ( | OKFGraph SOTA (Zero-LLM) | 20 | 55.0% | 60.0% | 60.0% | 45.0% | 60.0% |
Loc-Bench_V1 ( | Flat Keyword (TF-IDF) | 19 | 5.3% | 10.5% | 15.8% | 5.3% | 10.5% |
Loc-Bench_V1 ( | OKFGraph SOTA (Zero-LLM) | 19 | 26.3% | 36.8% | 42.1% | 21.1% | 21.1% |
2. 2-Turn LLM + OKFGraph vs. Published Baselines (Loc-Bench_V1, django/django)
Pairing OKFGraph's graph tools with just 2 turns of a local 4B–8B model or a frontier Host LLM via MCP closes the vocabulary gap without needing a 10-turn custom agent:
System / Mode | LLM Backbone | Turns / Cost | Scope | File Acc@1 | File Acc@5 | Func Acc@5 | Func Acc@10 |
OKFGraph SOTA (Turn-1) | None (Zero-LLM) | 1 (~10 ms) | Django ( | 40.0% | 60.0% | 40.0% | 40.0% |
OKFGraph + | Local 4B (LM Studio) | 2 ($0) | Django ( | 60.0%* | 80.0% | 40.0% | 40.0% |
OKFGraph + | Local 8B (Ollama) | 2 ($0) | Django ( | 60.0%* | 80.0% | 60.0% | 60.0% |
OKFGraph + Host LLM (MCP) | Frontier Host LLM | 2 (MCP) | Django ( | 60.0%* | 100.0% | 80.0% | 80.0% |
Published Agentless (ref.) | GPT-4o / Claude-3.5 | ~4–6 (Paid) | Full SWE / Loc-Bench | — | ~78–82% | ~55–65% | ~62–70% |
Published LocAgent (ref.) | Qwen-2.5-32B (FT) | ~10 (GPU) | Full Loc-Bench ( | — | ~84–88% | ~65–70% | ~70–74% |
Published LocAgent (ref.) | Claude-3.5-Sonnet | ~10 (Paid) | Full Loc-Bench ( | ~70–75% | ~90–93% | ~70–75% | ~75–80% |
*On the 5-issue blind slice, 2 issues modify 2 files simultaneously, so the theoretical ceiling for strict File Acc@1 is 60.0% (3/5). Evaluated against a Django HEAD graph snapshot; see Run the Benchmarks Yourself to reproduce on larger slices (N=35+) with any local or external LLM.
Quickstart
Requires Python 3.10+ (and optionally Node.js 18+ if indexing JS/TS repositories with Graphify).
1. Install & Verify
# Clone and install in editable mode with dev/test dependencies
git clone https://github.com/ywateba/okfgraph.git
cd okfgraph
python -m venv .venv
# Windows (PowerShell): .venv\Scripts\Activate.ps1
# macOS / Linux: source .venv/bin/activate
pip install -e ".[dev]"
# Run the test suite (96 tests)
pytest -qOr install directly into another project:
pip install git+https://github.com/ywateba/okfgraph.git2. Initialize, Build, and Explore Any Project
cd /path/to/my-project
# 1. Scaffold project.yaml (schema v2), llm_config.json, and .env
okfgraph init --name "My Project"
# 2. Build the Knowledge Graph & cross-domain links
okfgraph build
# 3. Export & launch the offline HTML portal + interactive Knowledge Graph map
okfgraph export --format html
okfgraph serve --port 8080 # Open http://localhost:8080/graph.html
# 4. Query or trace call chains from the CLI
okfgraph chat "Which service handles payment authorizations and refunds?"
okfgraph trace "ProcessPayment" --depth 4# project.yaml (schema v2)
schema_version: 2
project_name: "My Project"
project_folder: "."
tickets:
output_dir: "inputs/tickets"
scan_git_log: true
sources:
- name: main
type: github # jira | github | gitlab | azure_devops | file | python
options:
owner: "your-org"
repo: "your-repo"
auth:
token: "${GITHUB_TOKEN}"
inputs:
source_code:
repository_path: "./src"
file_extensions: [".py", ".ts", ".js"]
business:
business_docs_dir: "inputs/business_docs"
structuring_mode: "deterministic" # deterministic | hybrid | llm
artifacts:
knowledge_graph_json: "artifacts/knowledge_graph_nodes_edges.json"
exported_html_dir: "artifacts/exported_html"{
"active_provider": "mcp",
"enforce_mcp_only": true,
"embedding_provider": "ollama",
"providers": {
"mcp": {
"description": "All LLM interactions are routed through the OKFGraph MCP Server",
"active": true
},
"ollama": {
"chat_model": "llama3.1",
"embedding_model": "nomic-embed-text",
"base_url": "http://localhost:11434",
"active": false
}
}
}MCP Server
Add okfgraph to your IDE or AI client MCP configuration (.mcp.json, Antigravity, Cursor, Claude Desktop, or LM Studio):
{
"mcpServers": {
"okfgraph": {
"command": "python",
"args": ["-m", "okfgraph.query.mcp_server", "--project", "project.yaml"],
"env": {
"OKFGRAPH_MCP_ONLY": "true",
"PYTHONUTF8": "1"
}
}
}
}Or run over local HTTP SSE (pass --read-only to disable mutation tools, or --disable-plugins for core-only mode):
okfgraph mcp --project project.yaml --transport sse --port 8765 --read-onlyGraphRAG Query & Reasoning Tools
query_subgraph— 4-way RRF + Personalized PageRank + minimum-cost semantic paths + Louvain communitiesgraph_summary/graph_communities— Topology overview and domain clusterssearch_nodes/get_node_details/get_neighbors— Direct node & edge inspectionfind_path— Shortest semantic reasoning path between any two nodestrace_call_hierarchy— Upstream callers and downstream callees with depth controlget_ticket— Canonical ticket details + connected graph neighborhoodread_code_snippet— Symbol-grounded source code snippets (with path-containment & secret-file guards)list_plugins— Lists installedokfgraph.code_extractorsand loadedokfgraph.mcp_plugins
Graph Creation & Mutation Tools (disabled in --read-only mode)
migrate_project_config— Upgrades legacyproject.yamlto schema v2sync_tickets— Pulls & normalizes tickets intoTicketStoreextract_raw_documents/get_raw_document_text/submit_structured_document— MCP-driven document structuringextract_code_ast— Runs built-in (python/graphify) or installedokfgraph.code_extractorspluginsupsert_graph_knowledge/build_and_reload_graph— Live graph updates with hot-reloaded BM25 index
Plugin Architecture
OKFGraph is a generic core extensible via 4 standard Python entry-point groups — install any plugin package alongside okfgraph with zero core edits.
Want to build your own plugin? Follow the step-by-step guide (package layout,
pyproject.toml,CodeExtractor, MCP tools, security & verification): Plugin Authoring & Architecture Guide →docs/plugin_architecture.md.
Entry-Point Group | Base Contract | What It Extends |
|
| Custom language AST extractors (e.g., Rust, Go, Java, proprietary DSLs) |
|
| Domain-specific MCP tools with live access to graph, retriever & read-only state |
|
| Custom issue trackers (built-ins: |
|
| Remote document sources (built-ins: |
# In your external plugin package's pyproject.toml
[project.entry-points."okfgraph.code_extractors"]
mylang = "okfgraph_mylang:MyLangExtractor"
[project.entry-points."okfgraph.mcp_plugins"]
mylang = "okfgraph_mylang.mcp:register_mcp_tools"Run the Benchmarks Yourself
1. Built-In Offline Golden Benchmark (No Downloads Required)
python benchmarks/run_benchmark.py2. Index Any Python Repo & Run the Strict Turn-1 Scorecard
import json
from pathlib import Path
from okfgraph.ingestion.code.python_ast import extract_python_repo_graph
kg = extract_python_repo_graph("path/to/django/django")
Path("benchmarks/external/django_kg.json").write_text(json.dumps(kg), encoding="utf-8")python benchmarks/run_strict_loc_eval.py3. LocAgent-Protocol N-Turn Runner (Local or External LLM)
Run benchmarks/run_locagent_bench.py with any --turns N and any OpenAI-compatible endpoint (File@1/3/5, Mod@5/10, Func@5/10, latency & token telemetry):
Local Ollama (http://localhost:11434/v1):
python benchmarks/run_locagent_bench.py \
--dataset benchmarks/external/locbench_v1.jsonl \
--kg benchmarks/external/django_kg.json \
--repo django/django --pkg-prefix django \
--turns 3 --limit 35 \
--base-url http://localhost:11434/v1 \
--model llama3.1:latest \
--out benchmarks/external/report_ollama_3t.jsonLocal LM Studio (http://localhost:1234/v1):
python benchmarks/run_locagent_bench.py \
--dataset benchmarks/external/locbench_v1.jsonl \
--kg benchmarks/external/django_kg.json \
--repo django/django --pkg-prefix django \
--turns 3 --limit 35 --max-tokens 2048 \
--base-url http://localhost:1234/v1 \
--model google/gemma-4-e4b \
--out benchmarks/external/report_gemma4_3t.jsonExternal OpenAI-Compatible API (requires explicit --allow-external):
export OPENAI_API_KEY="sk-..."
python benchmarks/run_locagent_bench.py \
--dataset benchmarks/external/locbench_v1.jsonl \
--kg benchmarks/external/django_kg.json \
--repo django/django --pkg-prefix django \
--turns 5 --limit 35 \
--base-url https://api.openai.com/v1 \
--model gpt-4o \
--api-key-env OPENAI_API_KEY \
--allow-external \
--out benchmarks/external/report_gpt4o_5t.jsonReference & Security
Command | Arguments | Description |
|
| Scaffolds |
|
| Migrates legacy |
|
| Runs extraction, AST parsing, and cross-domain graph linking |
|
| Exports offline HTML portal (+ Graph Map) and/or Word docs |
|
| Serves the local HTML portal & Knowledge Graph map |
|
| Starts the extensible MCP server |
|
| Answers questions via Multi-Hop GraphRAG |
|
| Traces downstream callees or upstream callers |
|
| Manages pluggable ticket connectors |
|
| Manages remote document connectors |
okfgraph/
├── src/okfgraph/
│ ├── cli.py # Unified CLI (`okfgraph`)
│ ├── core/ # Config loader, security guards, LLM/MCP factory
│ ├── ingestion/
│ │ ├── business/ # Spec extraction (.docx/.pptx/.md) & structuring
│ │ ├── code/ # 4-edge Python AST, Graphify & CodeExtractor registry
│ │ └── documents/ # Remote doc connectors (GDrive, OneDrive, Confluence, HTTP)
│ ├── tickets/ # Canonical TicketStore & connectors (Jira/GH/GL/ADO/File)
│ ├── graph/ # Knowledge Graph builder & cross-domain linker
│ ├── docs/export/ # Offline HTML portal, interactive Graph Map & Word export
│ ├── query/ # SOTA RRF/BM25/PPR retriever, MCP server & MCP plugin loader
│ └── pipeline/ # 6-phase pipeline orchestrator
├── benchmarks/ # Golden, strict Loc-Bench/SWE-bench & N-turn runners
├── docs/
│ ├── brand/ # Light/dark SVG logos & icon
│ └── plugin_architecture.md # Official 4-pillar plugin standard
├── tests/ # 96 unit, security, plugin & connector contract tests
├── AGENTS.md # MCP-first agent operational rules
├── SECURITY.md # Security architecture & threat model
├── LICENSE # MIT License
└── pyproject.tomlSecurity: Path-containment checks, SSRF protection, secret-file filtering, HTML XSS sanitization, and read-only MCP enforcement are built in — see SECURITY.md.
License: Licensed under the MIT License. Copyright (c) 2026
ywateba.
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
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Codebase knowledge graph — architectural awareness for AI coding agents via MCP
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to query a codebase as a knowledge graph, providing token-budgeted context, search, and impact analysis via MCP tools.27 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI coding agents to query a local, continuously updated symbol graph of a codebase, providing ranked search, caller/callee exploration, dependency paths, and git-diff impact analysis through MCP tools.9 npmApache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to query a local, multi-repo code graph for symbol exploration, blast radius analysis, co-change mining, and durable code-anchored memory via MCP tools.247 npm16Business Source 1.1
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to retrieve hyper-targeted, token-efficient context from a codebase by querying a locally built AST knowledge graph, and to persist cross-session agent memory through 17 MCP tools. All indexing and retrieval run entirely offline, so proprietary code never leaves the machine.18 PyPI2MIT