semantica.mcp_server exposes Semantica’s knowledge graph, decision intelligence, semantic extraction, and reasoning capabilities as an MCP (Model Context Protocol) server over stdio:
- 12 MCP tools exposed: extract entities, query graph, record decisions, run reasoning, export results
- No Python code required after launch: configure once, use from any MCP-aware client
- Compatible with Claude Desktop, Windsurf, Cline, Continue, VS Code, Roo Code, Cursor
Server Interface
What You Get
12 MCP Tools
Extract entities, extract relations, record decisions, query decisions, find precedents, trace causal chains, add entities, add relationships, run analytics, summarise graph, run reasoning, export graph.
3 Readable Resources
Live graph JSON (
semantica://graph/summary), decision list, and schema/version info: readable by any MCP client.Zero Infrastructure
Runs over stdio: no server, no port, no Docker required. One config block to activate in any MCP client.
Persistent Graphs
Point
SEMANTICA_KG_PATH at a saved graph file to reload it automatically on every server startup.Decision Intelligence
Record decisions, find precedents via hybrid similarity search, and trace causal chains across agent runs.
REST Alternative
The Explorer module offers a full HTTP API and browser dashboard if you prefer programmatic access.
Installation
Configuration
Find your MCP client's settings file
| Client | Settings file |
|---|---|
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
| Cursor | .cursor/mcp.json in your project, or ~/.cursor/mcp.json globally |
| VS Code / Continue | .vscode/mcp.json or user settings |
| Windsurf / Cline / Roo Code | App-specific settings → MCP Servers |
Environment Variables
| Variable | Default | Description |
|---|---|---|
SEMANTICA_KG_PATH | (none: in-memory graph) | Path to a persisted graph file to load on startup |
SEMANTICA_LOG_LEVEL | WARNING | Log verbosity: DEBUG, INFO, WARNING |
Tools
The MCP server exposes 12 tools that any connected AI assistant can call:| Tool | Category | Description |
|---|---|---|
extract_entities | Extraction | NER: find people, places, organisations, concepts |
extract_relations | Extraction | Typed relation and triplet extraction |
record_decision | Decision Intelligence | Save a decision with reasoning and outcome |
query_decisions | Decision Intelligence | Search recorded decisions by natural language or category |
find_precedents | Decision Intelligence | Hybrid similarity search over past decisions |
get_causal_chain | Decision Intelligence | Trace upstream / downstream causal chains |
add_entity | Graph Operations | Add a node to the live graph |
add_relationship | Graph Operations | Add a directed edge between two nodes |
get_graph_summary | Graph Operations | Node count, decision count, graph status |
get_graph_analytics | Graph Operations | PageRank centrality and community detection |
run_reasoning | Reasoning | Forward-chain IF/THEN rules over facts |
export_graph | Reasoning & Export | Serialise the graph (turtle/ttl: RDF Turtle aliases, nt, xml, json-ld, json) |
Knowledge Extraction
extract_entities
extract_entities
Extract named entities (people, places, organisations, concepts) from text using Semantica NER.Input:Output:
extract_relations
extract_relations
Extract typed relations and Output:
(subject, predicate, object) triplets from text.Input:Decision Intelligence
record_decision
record_decision
Record a decision with full context, reasoning, and metadata into the knowledge graph.Input:Required fields:
category, scenario, reasoning, outcome, confidence.
Optional: decision_maker (defaults to "mcp_client"), valid_from, valid_until.Output:query_decisions
query_decisions
Query recorded decisions by natural language or category filter.Input:All fields are optional.
limit defaults to 10. When query is provided, similarity search is used. When omitted, category filter applies.find_precedents
find_precedents
Find past decisions similar to a given scenario using hybrid similarity search.Input:
max_results defaults to 5, maximum 50.get_causal_chain
get_causal_chain
Trace the causal chain upstream or downstream from a decision.Input:
direction accepts "upstream" or "downstream" (default: "downstream").
max_depth defaults to 5, maximum 20.Graph Operations
add_entity
add_entity
Add a node/entity to the live knowledge graph.Input:Only
id is required. label defaults to the id value. type defaults to "Entity".add_relationship
add_relationship
Add a directed relationship (edge) between two existing entities.Input:
source and target are required. type defaults to "RELATED_TO".get_graph_summary
get_graph_summary
Return a high-level summary of the current knowledge graph.Output:Takes no input parameters.
get_graph_analytics
get_graph_analytics
Compute PageRank centrality and community detection over the current graph. Returns top nodes by PageRank, community count, and overall node/edge counts.Takes no input parameters.
Reasoning
run_reasoning
run_reasoning
Run forward-chaining IF/THEN rules over a set of facts to derive new facts.Input:Output:
Export
export_graph
export_graph
Export the current knowledge graph to a serialisation format.Input:Supported formats:
turtle, ttl, nt, xml, json-ld, json. Default is json-ld.Resources
The MCP server exposes three readable resources:| URI | Description |
|---|---|
semantica://graph/summary | High-level graph statistics |
semantica://decisions/list | All recorded decisions (up to 50) |
semantica://schema/info | Server version and available tools |
Context
The ContextGraph that the MCP server operates on.
Semantic Extract
NER and relation extraction powering the MCP tools.
Reasoning
Forward-chaining engine behind run_reasoning.
Agno Integration
Use Semantica inside Agno multi-agent teams.
