OpenCrab

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.

Category
访问服务器

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选