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.
┌─────────────────────────────────────────────┐
│ 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 │ │ │ │ │
└──────────────┘ └─────────────┘ └────────────┘ └────────────────┘
| 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 |
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
docker-compose up -dThis starts Neo4j, MongoDB, PostgreSQL, and ChromaDB.
pip install -e ".[dev]"opencrab init # creates .env from template
# Edit .env if your credentials differ from defaultspython scripts/seed_ontology.pyopencrab statusclaude mcp add opencrab -- opencrab serveOr add to your .claude/mcp.json manually (see below).
opencrab query "system performance and error rates"
opencrab manifest # see the full grammarAdd 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"]
}
}
}Returns the full MetaOntology grammar: spaces, meta-edges, impact categories, active metadata layers, and ReBAC configuration.
{}Add or update a node in the ontology.
{
"space": "subject",
"node_type": "User",
"node_id": "user-alice",
"properties": {
"name": "Alice Chen",
"role": "analyst"
}
}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.
Hybrid vector + graph search.
{
"question": "What factors degrade system performance?",
"spaces": ["concept", "outcome"],
"limit": 10
}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.
Relationship-based access control check.
{
"subject_id": "user-alice",
"permission": "edit",
"resource_id": "ds-events"
}Returns { "granted": true/false, "reason": "...", "path": [...] }.
Predict downstream outcome changes from a lever movement.
{
"lever_id": "lever-cache-ttl",
"direction": "lowers",
"magnitude": 0.7
}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"
}
}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
| 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? |
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 |
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 connectionsIntegration tests require live services:
OPENCRAB_INTEGRATION=1 pytest tests/ -vopencrab/
├── 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
MIT — see LICENSE.
OpenCrab: resistance is futile. Your agent will become an ontology.
