OCD MCP server
Commit Nov 13, 2026An open-source AI memory engine that provides semantic embeddings, session auditing, and cross-tool intelligence for AI coding environments.
Also known as Riko5652/OCD
- Stars
- 3
- Tools
- 6
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 13, 2026
- License
- —
What is OCD MCP?
OCD is an open-source AI memory engine that provides semantic embeddings, session auditing, and cross-tool intelligence for AI coding environments. It exposes 6 tools, such as get_efficiency_tips, get_routing_recommendation, get_similar_solutions.
Summary generated from the project's README
About OCD MCP server
Building a unified intelligence layer across multiple AI coding tools is what OCD enables for developers. This open-source memory engine provides semantic embeddings, session auditing, and cross-tool intelligence to create a self-building brain for your coding environment. It works entirely locally with zero API keys required, using the all-MiniLM-L6-v2 model via ONNX runtime to generate 384-dimensional semantic vectors for every session.
Users can manage their AI productivity through a dedicated dashboard or via 25 specialized MCP tools. The system supports various adapters including Claude Code, Cursor, Windsurf, and Aider. It features proactive IDE interception by monitoring terminal errors and matching them against a local vector store. Advanced setups can utilize Ollama for higher-dimensional embeddings or enable P2P team memory over a LAN or Tailscale to share knowledge without sharing source code.
Developers can implement session guards to prevent runaway loops or hallucination-prone sessions. The engine also provides token arbitrage by routing tasks to local models when historical success rates are high. Tools like get_context_stitch and get_session_health_check allow agents to maintain continuity and self-awareness across different coding platforms.
What you can do with it
- 1Retrieve past coding solutionsFind previous code fixes that match your current error using semantic vector search.
- 2Prevent agent hallucination loopsUse session guards to detect repetition and stop runaway AI sessions automatically.
- 3Automate error troubleshootingAutomatically receive notifications with solutions when a terminal stack trace is detected.
- 4Reduce API token costsRoute specific tasks to a local Ollama instance based on your historical success rates.
Written from the project's README. Every use case is checked against a quote from it.
OCD MCP tools 6
Detected from the READMEget_efficiency_tipsget_routing_recommendationget_similar_solutionsget_optimal_prompt_structureget_session_health_checkget_negative_constraints
| get_efficiency_tips | — | |
| get_routing_recommendation | — | |
| get_similar_solutions | — | |
| get_optimal_prompt_structure | — | |
| get_session_health_check | — | |
| get_negative_constraints | — |
Configuration
ANTHROPIC_API_KEYAZURE_OPENAI_API_KEYGEMINI_API_KEYOLLAMA_HOSTOLLAMA_MODELOPENAI_API_KEYP2P_SECRET
| Name | Description | |
|---|---|---|
| ANTHROPIC_API_KEY | — | |
| AZURE_OPENAI_API_KEY | — | |
| GEMINI_API_KEY | — | |
| OLLAMA_HOST | — | |
| OLLAMA_MODEL | — | |
| OPENAI_API_KEY | — | |
| P2P_SECRET | — |
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachableriko5652/ocd is public and reachablegithub.com/riko5652/ocd ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearLast commit or release 2026-11-13github.com/riko5652/ocd ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model6 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubOCD — Omni Coder Dashboard v5.6.0
The open-source AI memory engine for coding tools
A self-building brain across all your AI coding tools. Real semantic embeddings out of the box, 25 MCP tools, cross-tool routing, prompt science, proactive IDE interception, session guard, trace auditing, and a Memory dashboard — all 100% local, zero API keys required.
What's New in v5.6.0
Session Guard, Guard Effectiveness KPIs, Context Stitching, and 8 security patches.
- OCD Session Guard — Pre-tool guard with session overrun detection (hard stop at 100 turns / 300 min), repetition detection (warn at 3, block at 5), edit-without-read and SQL-without-schema warnings. Post-tool logger with fingerprinting and auto-pruning. Protects against runaway sessions and hallucination loops.
- Guard Effectiveness KPI Matrix — Tracks every guard intervention (block/warn/override) with estimated token savings. New
get_guard_effectivenessMCP tool returns a formatted KPI report with daily bar chart and quality impact delta. - Context Stitching — Single-call session bootstrap via
get_context_stitchMCP tool, replacing 5 separate MCP calls. Returns last session context, handoff notes, production errors, anti-pattern constraints, and a DIRECTIVE (CONTINUE/REDIRECT/NEW_SESSION) with suggested prompt for cross-LLM session intelligence. - Cross-IDE Session Guard — New
get_session_guard_verdictandreport_tool_callMCP tools expose the session guard to any IDE, not just Claude Code. - Dashboard Fixes — Data freshness (watcher rebuilds stats after ingestion), LLM detection (
.envloaded correctly), entity extraction accuracy, negative constraint precision, and Windows auto-start scripts. - Security — Patched 8 vulnerabilities: Vite arbitrary file read + path traversal (HIGH), 5 Hono cookie/IP/path issues (MODERATE),
@hono/node-servermiddleware bypass (MODERATE).
- Trace-to-Evidence Audit Bot — New audit engine that accepts a question (e.g. "is our mapping seed data correct?") and orchestrates parallel evidence gathering from code grep, session memory, anti-patterns, and config files. Produces structured reports with verified/broken/missing verdicts. 3 built-in templates (Mapping Validation, Ingestion Throttle, Fallback Behavior) plus ad-hoc question support. Exposed via MCP tools
run_trace_audit,get_audit_history, andlist_audit_templates. - Antigravity Session Intelligence — Deep session analysis for Gemini/Antigravity sessions: resolved artifact versioning, intent classification (plan/implement/verify/rollback/investigate), line-level version deltas, file impact analysis (by extension and module), and protobuf conversation reconstruction with gzip/inflate decompression.
- Antigravity Intelligence UI — New Workspaces panel showing version delta summaries, intent distribution bars (color-coded), and file impact breakdowns for Antigravity sessions.
- Cost Visibility — Model normalizer that maps vendor-specific model names to canonical families, cost alerting thresholds, and accurate Cursor token estimation from actual conversation data.
- Windows Launcher —
ocd-start.batdouble-click script that builds server + client, kills stale processes, starts the dashboard, verifies MCP configuration, and opens the browser.
- Real Local Embeddings — Ships
all-MiniLM-L6-v2via ONNX runtime (@xenova/transformers). Every session gets 384-dimensional semantic vectors automatically. The hash-based fallback is now a last resort, not the default. Your "semantic memory" is actually semantic now. - Memory Dashboard — New "Memory" tab in Insights showing: active embedding provider, coverage %, provider breakdown, quality labels (semantic vs keyword), and a live similarity search box to test your memory bank.
- Shell Hook Installer —
pnpm install-hook(orocd install-hook) appends aPROMPT_COMMAND/precmdhook to your.bashrc/.zshrcthat automatically captures terminal errors for proactive IDE interception. No manual log file setup. - Match Quality Labels — MCP search results now say "(semantic match)" or "(keyword match)" so you know whether you're getting real vector similarity or just keyword overlap.
- P2P Security Transparency — Dashboard shows a warning banner when P2P sync is active over plaintext HTTP, with guidance to use VPN/Tailscale for sensitive environments.
- No More 1000-Row Cap — Similarity search now scans all embeddings, not an arbitrary subset.
- Platform Parity — All adapters (Windsurf, Continue.dev, Copilot, Aider) now match Claude Code's parsing depth: turn-level analysis, code metrics, tool detection, and error tracking across every platform.
- Single-Tool User Optimization — The routing engine detects single-tool users and provides model-level recommendations instead of irrelevant cross-tool comparisons.
- Session Health Check —
get_session_health_checkMCP tool gives agents cross-session self-awareness with structuredcontinue/compact/new_sessionaction signals. - Token Efficiency Tips — Personalized
get_efficiency_tipsMCP tool: burn rate, waste detection, quick wins from your very first session. - Prompt Science — Evidence-based prompt engineering with effect sizes and sample counts mined from your best sessions.
- Architecture Hardening — Structured logging (pino), Swagger/OpenAPI docs, route modularization, DB index tuning.
- Proactive IDE Interception — Background watcher monitors your terminal for stack traces, finds matching solutions via vector search, and fires OS-level notifications + SSE pushes to your IDE instantly — no prompt needed.
- Anti-Hallucination Negative Prompt Injector — Builds an Anti-Pattern Graph from your failing sessions and injects explicit
DO NOT use Xconstraints into new prompts via theget_negative_constraintsMCP tool. - Token Arbitrage & Cost Routing — Classifies every prompt by task type and complexity, routes to local Ollama (free) when your historical success rate is ≥ 92%, and logs estimated savings per request.
- P2P Secure Team Memory — Syncs embeddings across teammates on the same LAN or Tailscale using UDP discovery + HMAC-SHA256 authentication. No cloud, no source code shared — embeddings only.
Usage by Experience Level
Whether you just installed your first AI coding tool or you're orchestrating multi-agent pipelines, OCD meets you where you are.
Beginner — "I just started using AI coding tools"
npx omni-coder-dashboard # 1. Launch — zero config, auto-detects your tools
- What you get on day one: A visual dashboard showing every session across all your AI tools, how many tokens you used, and which sessions succeeded vs. failed. Semantic memory starts building immediately — every quality session is embedded with a local neural model (no API keys needed).
- Start here: Open the Command Center tab — it shows your daily activity, top tools, and a savings estimate. Check Insights → Memory to see your embedding coverage grow.
- Key MCP tools to try:
get_efficiency_tips— personalized tips to reduce token waste, even with one session of dataget_routing_recommendation— asks "which tool + model should I use for this task?" and answers with your own dataget_similar_solutions— finds past solutions matching your current error (works after ~5 sessions)
- Tip: Just use your AI tools normally. OCD watches in the background and builds your personal knowledge base automatically. Run
ocd install-hookto also capture terminal errors for proactive matching.
Intermediate — "I use multiple AI tools and want to optimize"
npx omni-coder-dashboard --setup-mcp # Auto-configure MCP for Claude Code, Cursor, Windsurf
- Unlock cross-tool intelligence: OCD tracks sessions across all 7 supported tools. The Performance tab lets you compare win rates, token costs, and resolution speed per tool and model.
- Semantic memory is already working: Real 384-dim embeddings are generated automatically from day one. After ~20 quality sessions,
get_similar_solutionsstarts returning strong matches. Solutions from Claude Code surface in Cursor, and vice versa. Check Insights → Memory to see your coverage and test live searches. - Key MCP tools to add:
get_similar_solutions— vector search across all your past sessionsget_optimal_prompt_structure— evidence-based prompt patterns mined from your best sessions, with effect sizesget_session_health_check— periodic health signals so your agent knows when to compact or start freshget_negative_constraints— auto-injects "DO NOT" clauses from your failure history
- Tip: Check the Insights → Prompt Science tab weekly. It surfaces which prompt structures, lengths, and patterns correlate with higher quality in your sessions.
Advanced — "I want full agent orchestration and team workflows"
# Semantic embeddings work out of the box — no config needed
npx omni-coder-dashboard
# Upgrade to Ollama for 768-dim embeddings + LLM features
OLLAMA_HOST=http://localhost:11434 npx omni-coder-dashboard
# Auto-install shell hook for proactive IDE interception
ocd install-hook
# Enable P2P team memory (LAN or Tailscale)
P2P_SECRET=your-team-key npx omni-coder-dashboard
# Docker for always-on deployment
docker compose up -d
- Agent-grade MCP integration: All 25 MCP tools are designed for autonomous agent consumption — structured JSON responses, confidence scores, and action signals (
continue/compact/new_session). - Token arbitrage: Route prompts to local Ollama when your historical success rate is high enough, saving API costs automatically. Full audit trail via
get_arbitrage_recommendation. - P2P team memory: Share embeddings (never source code) across your team with HMAC-SHA256 authentication. Query teammate solutions with
get_team_memory. Dashboard shows security warnings when running over plaintext HTTP. - Proactive IDE interception: Run
ocd install-hookto auto-configure your shell. Errors are captured to~/.ocd/terminal.logand matched against your vector store in real time. Solutions are pushed via OS notifications + SSE before you open a new prompt. - Production deployment:
- Swagger/OpenAPI docs at
/docsfor REST API integration - Structured JSON logging (pino) for log aggregation pipelines
AUTH_TOKENenv var for shared/CI environments- Webhook + API endpoints for CI/CD session ingestion
- Swagger/OpenAPI docs at
- Key MCP tools for agents:
get_session_health_check— cross-session self-awareness for long-running agentsget_knowledge_context— graph neighborhood traversal for deep context injectionpush_handoff_note— cross-tool context bridge when switching between agentsget_attribution_report— AI vs. human authorship tracking for engineering managers
Screenshots
Command Center
Cross-tool KPIs, token burn rate, quick wins, daily activity, and sessions by tool — all in one view.
How You Work
Median turns, session duration, primary tool, tool usage breakdown, file context rate, and prompt length distribution.
Trends (7-Day Rolling)
Cache hit rate, quality score, re-ask rate, and error rate tracked over time with rolling averages.
Prompt Science
Evidence-based prompt engineering: effect sizes, quality correlations, and anti-patterns mined from your best sessions.
Optimize
AI-powered recommendations: subagent usage, bash overuse detection, long session warnings, caching insights, and workflow tips.
What it actively does for you
This is not a passive analytics dashboard. It's a system that makes you faster — and helps you do more within your usage caps:
Token Budget Tracker — Real-time burn rate monitoring: today's usage, 7-day average, weekly cost forecast, and efficiency-per-tool ranking (tokens per quality point). Works with any single tool from day one.
Semantic Memory — When Claude Code solves a complex migration in 15 turns, the system vectorizes the solution using a local ONNX neural model (all-MiniLM-L6-v2, 384 dimensions). Two weeks later, when you hit a similar error in Cursor, the MCP server finds the proven solution via real cosine similarity — not keyword matching — and injects it into your prompt context. Zero API keys, zero config, real semantic understanding out of the box.
Routing Recommendations — "For postgres migrations, use Claude Code + claude-sonnet-4-6 (resolves in 4 turns, 87% win rate). Cursor + gpt-4o takes 11 turns." Based on your actual session history, not benchmarks.
Real-time Coaching — SSE-pushed nudges every 60 seconds: alerts when sessions run too long, cache hit rate drops, error spikes occur, or you're idle. Dismissible, actionable, and based on your patterns.
Prompt Science — Evidence-based prompt engineering grounded in your session history. Mines your best sessions (quality > 75) to discover patterns that improve quality, reduce turns, and optimize cache hits. Every recommendation includes effect sizes and sample counts so you know exactly what works — and by how much.
Savings Report — Concrete metrics on what the system saves you: cache hit savings ($), turns saved vs baseline, time estimates. Toggle between relative metrics and dollar estimates.
Proactive IDE Interception — Watches your terminal for stack traces in the background. Run ocd install-hook to auto-configure your shell — errors are captured automatically. When a stack trace appears, the system queries your vector store and pushes a matched solution to your IDE via OS notification and SSE — before you even open a new prompt.
Anti-Hallucination Guard — Mines your failing sessions to build an Anti-Pattern Graph. The get_negative_constraints MCP tool injects DO NOT use X clauses at the start of any session, eliminating locally-known failure patterns.
Token Arbitrage — Every prompt is classified by task type and routed to the cheapest viable model. When your local Ollama has a ≥ 92% win rate on a task type, it proxies there for free. Full audit log with per-request savings estimates.
P2P Team Memory — Shares embeddings (never source code) with teammates over UDP + HMAC-SHA256. Works on LAN or Tailscale. Query peer solutions with get_team_memory — a shared brain with zero cloud dependency.
AI Attribution Reporting — Every commit is scored with an ai_percentage (0–100%) tracking how much code was AI-assisted vs. human-authored. Query per-project, per-branch, or per-timeframe via the get_attribution_report MCP tool or REST API. Built for engineering managers who need velocity tracking, code review prep, and impact reporting.
Trace-to-Evidence Audit Bot — Ask a question like "is our database seeding correct?" and the audit engine parallelizes evidence gathering from 5 sources: code grep (via ripgrep), session memory (semantic search), anti-pattern history, config file inspection, and handoff notes. Returns a structured report with verified/broken/missing/degraded verdicts and file locations. Three built-in templates (Mapping Validation, Ingestion Throttle, Fallback Behavior) cover the most common audit patterns — or ask any freeform question.
Compliance & Data Governance
OCD is built for teams that care about data residency, auditability, and security:
- 100% local-first — All data lives on your machine in SQLite. Nothing is transmitted unless you explicitly configure a cloud LLM provider.
- Read-only adapters — OCD never writes to your AI tools' files. Architectural guarantee, not a config option.
- Zero telemetry — No analytics, no tracking, no phone-home. Verified by source audit.
- Audit logging — Token arbitrage decisions, IDE interceptions, and P2P sync events are logged with timestamps for regulatory review.
- AI attribution tracking — Every commit scored with AI vs. human authorship percentage. Exportable for compliance reporting.
- Authenticated P2P — Team memory sharing uses HMAC-SHA256 authentication. Embeddings only — source code is never transmitted. Dashboard displays a security warning when P2P runs over plaintext HTTP.
- Local-only ONNX model — Semantic embeddings run entirely in-process via ONNX runtime. Model weights are cached locally (~30MB). No data leaves your machine for embedding generation.
- Prompt injection protection — All session text is sanitized before storage and display. CSP headers enforced on the dashboard.
- Authentication support — Optional
AUTH_TOKENenvironment variable for shared/CI environments. - AGPL-3.0 — Full source available for security audit. Commercial licensing available for enterprises requiring proprietary deployment.
See PRIVACY.md for the full data handling policy.
MCP Setup (30 seconds, no API key)
The dashboard exposes an MCP server with 25 tools that any AI agent can call mid-session. Zero API keys needed.
# Auto-setup for all detected MCP clients
npx omni-coder-dashboard --setup-mcp
# Or add to a specific project
npx omni-coder-dashboard --setup-mcp --project
This writes the correct config to Claude Code, Cursor, and Windsurf automatically. Or manually add to your .mcp.json:
{
"mcpServers": {
"ai-brain": {
"command": "npx",
"args": ["ocd", "--mcp"]
}
}
}
Available MCP tools:
| Tool | What it does |
|---|---|
get_similar_solutions |
Find proven solutions from past sessions matching your current error or task context |
get_knowledge_context |
Inject relevant context — returns the knowledge graph neighborhood for your current work |
get_last_session_context |
Pick up where a different tool left off |
get_routing_recommendation |
Which tool + model to use for this task |
get_efficiency_snapshot |
Cache hit rate, first-attempt %, error recovery |
get_active_recommendations |
Open optimization nudges |
get_project_stats |
Token/session/model breakdown for a project |
get_model_comparison |
claude-sonnet vs gpt-4o vs gemini on your actual sessions |
push_handoff_note |
Save a note before switching tools |
get_optimal_prompt_structure |
Evidence-based prompt science — patterns with effect sizes and confidence levels from your best sessions |
get_attribution_report |
NEW — AI vs. human authorship breakdown per project/branch/timeframe |
get_efficiency_tips |
NEW — personalized token-saving tips: burn rate, quick wins, waste detection |
get_topic_summary |
Executive summary of work on a topic within a project |
get_negative_constraints |
NEW — inject "DO NOT use X" clauses derived from your local failure history |
get_arbitrage_recommendation |
NEW — local vs cloud routing recommendation with estimated savings |
get_team_memory |
NEW — search peer-synced embeddings for solutions from your teammates |
submit_ide_trace |
NEW — manually submit a stack trace for instant proactive analysis |
get_session_health_check |
NEW — cross-session health signals: status, suggested action, quality baselines, nudges |
run_trace_audit |
NEW — run a trace audit: ask a question, get evidence from code, sessions, config, and anti-patterns |
get_audit_history |
NEW — retrieve past audit runs with filter by status or question |
list_audit_templates |
NEW — list built-in and custom audit templates (Mapping Validation, Ingestion Throttle, Fallback Behavior) |
get_context_stitch |
NEW — single-call session bootstrap: last context, handoff notes, errors, constraints, and a DIRECTIVE |
get_session_guard_verdict |
NEW — session guard status for any IDE: overrun, repetition, and quality signals |
report_tool_call |
NEW — report tool calls from external IDEs into the session guard system |
get_guard_effectiveness |
NEW — guard KPI report: interventions, token savings, quality impact, daily bar chart |
Import online sessions
Not everything lives in local files. Import sessions from web-based AI tools:
Bookmarklet — One-click capture from ChatGPT, Claude.ai, or Gemini. Visit http://localhost:3030/api/bookmarklet for setup instructions.
API Upload — POST /api/sessions/upload accepts JSON arrays of session data for bulk import.
Webhook — Push session data from CI/CD or automation:
curl -X POST http://localhost:3030/api/webhook/session \
-H "Content-Type: application/json" \
-d '{"tool":"chatgpt","title":"Debug API","turns":[{"role":"user","content":"..."}]}'
API — POST /api/sessions/import accepts the import schema.
Quick start
# No install — just run (zero config)
npx omni-coder-dashboard
# Or install globally
npm install -g omni-coder-dashboard
ocd
# Clone and run (development)
git clone https://github.com/Riko5652/OCD
cd OCD
pnpm install
pnpm run build
pnpm run start
# Docker
docker compose up
# GitHub Codespaces — one-click dev environment
OCD MCP questions
What tools does OCD MCP provide?
It exposes 6 tools, including get_efficiency_tips, get_routing_recommendation, get_similar_solutions, get_optimal_prompt_structure, get_session_health_check.
Does OCD require API keys?
No, the system is 100% local and requires zero API keys.
How does the semantic memory work?
It uses the all-MiniLM-L6-v2 model via ONNX runtime to automatically generate 384-dimensional semantic vectors for every session.
Can I use OCD with multiple AI coding tools?
Yes, it tracks sessions across multiple supported tools including Claude Code, Cursor, Windsurf, Continue.dev, Copilot, and Aider.
Is my source code shared when using P2P team memory?
No, only embeddings are shared across the team, not the source code itself.