OpenCrab
OpenCrab provides an MCP interface for the MetaOntology OS, enabling structured knowledge management across graph, vector, and document databases. It allows agents to perform hybrid searches, manage complex entity relationships, and conduct impact analysis within a multi-space ontological framework.
README
<p align="center"> <img src="logo.png" alt="OpenCrab Logo" width="260"/> </p>
OpenCrab
MetaOntology OS MCP Server Plugin
Carcinization is the evolutionary tendency for crustaceans to converge on a crab-like body plan. OpenCrab applies the same principle to agent environments: all sufficiently advanced AI systems eventually evolve toward ontology-structured forms.
OpenCrab is an MCP (Model Context Protocol) server that exposes the MetaOntology OS grammar to any OpenClaw-compatible agent environment — Claude Code, n8n, LangGraph, and beyond.
Architecture
┌─────────────────────────────────────────────┐
│ OpenCrab MCP Server │
│ (stdio JSON-RPC) │
└──────────────────┬──────────────────────────┘
│
┌────────────────────────────┼────────────────────────────┐
│ │ │
┌───────▼──────┐ ┌────────▼───────┐ ┌────────▼───────┐
│ grammar/ │ │ ontology/ │ │ stores/ │
│ manifest.py │ │ builder.py │ │ │
│ validator.py│ │ rebac.py │ │ neo4j_store │
│ glossary.py │ │ impact.py │ │ chroma_store │
└──────────────┘ │ query.py │ │ mongo_store │
└────────────────┘ │ sql_store │
└───────┬────────┘
│
┌──────────────────────────────────────┤
│ Data Layer │
┌───────────────┼───────────────┬──────────────────────┤
│ │ │ │
┌───────▼──────┐ ┌──────▼──────┐ ┌─────▼──────┐ ┌────────────▼───┐
│ Neo4j │ │ ChromaDB │ │ MongoDB │ │ PostgreSQL │
│ (graph) │ │ (vectors) │ │ (documents)│ │ (registry + │
│ Cypher │ │ semantic │ │ audit log │ │ ReBAC policy)│
│ traversal │ │ search │ │ │ │ │
└──────────────┘ └─────────────┘ └────────────┘ └────────────────┘
MetaOntology OS — 9 Spaces
| Space | Node Types | Role |
|---|---|---|
| subject | User, Team, Org, Agent | Actors with identity and agency |
| resource | Project, Document, File, Dataset, Tool, API | Artifacts that subjects act upon |
| evidence | TextUnit, LogEntry, Evidence | Raw empirical observations |
| concept | Entity, Concept, Topic, Class | Abstract knowledge |
| claim | Claim, Covariate | Derived assertions |
| community | Community, CommunityReport | Concept clusters |
| outcome | Outcome, KPI, Risk | Measurable results |
| lever | Lever | Tunable control variables |
| policy | Policy, Sensitivity, ApprovalRule | Governance rules |
MetaEdge Relationship Grammar
subject ──[owns, manages, can_view, can_edit, can_execute, can_approve]──► resource
resource ──[contains, derived_from, logged_as]──────────────────────────► evidence
evidence ──[mentions, describes, exemplifies]────────────────────────────► concept
evidence ──[supports, contradicts, timestamps]───────────────────────────► claim
concept ──[related_to, subclass_of, part_of, influences, depends_on]────► concept
concept ──[contributes_to, constrains, predicts, degrades]──────────────► outcome
lever ──[raises, lowers, stabilizes, optimizes]───────────────────────► outcome
lever ──[affects]─────────────────────────────────────────────────────► concept
community ──[clusters, summarizes]────────────────────────────────────────► concept
policy ──[protects, classifies, restricts]─────────────────────────────► resource
policy ──[permits, denies, requires_approval]──────────────────────────► subject
Quick Start
1. Start the data services
docker-compose up -d
This starts Neo4j, MongoDB, PostgreSQL, and ChromaDB.
2. Install OpenCrab
pip install -e ".[dev]"
3. Configure environment
opencrab init # creates .env from template
# Edit .env if your credentials differ from defaults
4. Seed example data
python scripts/seed_ontology.py
5. Verify connectivity
opencrab status
6. Add to Claude Code MCP
claude mcp add opencrab -- opencrab serve
Or add to your .claude/mcp.json manually (see below).
7. Run a query
opencrab query "system performance and error rates"
opencrab manifest # see the full grammar
Claude Code MCP Configuration
Add to ~/.claude/mcp.json (or project-level .mcp.json):
{
"mcpServers": {
"opencrab": {
"command": "opencrab",
"args": ["serve"],
"env": {
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USER": "neo4j",
"NEO4J_PASSWORD": "opencrab",
"MONGODB_URI": "mongodb://root:opencrab@localhost:27017",
"MONGODB_DB": "opencrab",
"POSTGRES_URL": "postgresql://opencrab:opencrab@localhost:5432/opencrab",
"CHROMA_HOST": "localhost",
"CHROMA_PORT": "8000"
}
}
}
}
Alternatively, with uvx (no install required):
{
"mcpServers": {
"opencrab": {
"command": "uvx",
"args": ["--from", "opencrab", "opencrab", "serve"]
}
}
}
MCP Tool Reference
ontology_manifest
Returns the full MetaOntology grammar: spaces, meta-edges, impact categories, active metadata layers, and ReBAC configuration.
{}
ontology_add_node
Add or update a node in the ontology.
{
"space": "subject",
"node_type": "User",
"node_id": "user-alice",
"properties": {
"name": "Alice Chen",
"role": "analyst"
}
}
ontology_add_edge
Add a directed edge (grammar-validated before write).
{
"from_space": "subject",
"from_id": "user-alice",
"relation": "owns",
"to_space": "resource",
"to_id": "doc-spec"
}
Returns a validation error if the relation is not valid for the given space pair.
ontology_query
Hybrid vector + graph search.
{
"question": "What factors degrade system performance?",
"spaces": ["concept", "outcome"],
"limit": 10
}
ontology_impact
Impact analysis: which I1–I7 categories are triggered by a change?
{
"node_id": "lever-cache-ttl",
"change_type": "update"
}
Returns triggered impact categories, affected neighbouring nodes, and a summary.
ontology_rebac_check
Relationship-based access control check.
{
"subject_id": "user-alice",
"permission": "edit",
"resource_id": "ds-events"
}
Returns { "granted": true/false, "reason": "...", "path": [...] }.
ontology_lever_simulate
Predict downstream outcome changes from a lever movement.
{
"lever_id": "lever-cache-ttl",
"direction": "lowers",
"magnitude": 0.7
}
ontology_ingest
Ingest text into the vector and document stores.
{
"text": "The Q4 incident report shows error rates increased by 40%...",
"source_id": "incident-2026-01",
"metadata": {
"space": "evidence",
"type": "incident_report"
}
}
CLI Reference
opencrab init Create .env from template
opencrab serve Start MCP server (stdio)
opencrab status Check store connections
opencrab ingest <path> Ingest files into vector store
opencrab query <question> Run a hybrid query
opencrab manifest Print MetaOntology grammar
Global flags:
opencrab --version Show version
opencrab query --json-output <q> Raw JSON output
opencrab manifest --json-output Raw JSON grammar
opencrab ingest -r <dir> Recursive ingestion
opencrab ingest -e .txt,.md <dir> Filter by extension
Impact Categories (I1–I7)
| ID | Name | Question |
|---|---|---|
| I1 | Data impact | What data values or records change? |
| I2 | Relation impact | What graph edges are affected? |
| I3 | Space impact | Which ontology spaces are touched? |
| I4 | Permission impact | Which access permissions change? |
| I5 | Logic impact | Which business rules are invalidated? |
| I6 | Cache/index impact | Which caches or indexes must be refreshed? |
| I7 | Downstream system impact | Which external systems or APIs are affected? |
Active Metadata Layers
Every node and edge can carry orthogonal metadata attributes:
| Layer | Attributes |
|---|---|
| existence | identity, provenance, lineage |
| quality | confidence, freshness, completeness |
| relational | dependency, sensitivity, maturity |
| behavioral | usage, mutation, effect |
Development
make dev-install # install with dev extras
make up # start docker services
make seed # seed example data
make test # run test suite
make coverage # test + coverage report
make lint # ruff linter
make format # black + isort
make status # check store connections
Running integration tests
Integration tests require live services:
OPENCRAB_INTEGRATION=1 pytest tests/ -v
Project structure
opencrab/
├── grammar/ # MetaOntology grammar (manifest, validator, glossary)
├── stores/ # Store adapters (Neo4j, ChromaDB, MongoDB, PostgreSQL)
├── ontology/ # Ontology engine (builder, ReBAC, impact, query)
└── mcp/ # MCP server (stdio JSON-RPC) and tool definitions
tests/ # Test suite (grammar, stores, MCP tools)
scripts/ # Seed script
docker-compose.yml # All data services
License
MIT — see LICENSE.
OpenCrab: resistance is futile. Your agent will become an ontology.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.