semantica.mcp_server exposes Semantica’s knowledge graph, decision intelligence, semantic extraction, and reasoning capabilities as an MCP (Model Context Protocol) server over stdio:
  • 15 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

semantica.mcp_server is a stdio server process, not a Python library. It exposes no importable classes: all interaction happens through MCP tool calls from a connected AI client.
The server communicates over stdio: don’t add logging to stdout. Any print() or logger output directed to stdout will corrupt the JSON-RPC message stream. All logging is written to stderr only. Configure log verbosity with the SEMANTICA_LOG_LEVEL environment variable.

What You Get

  • 15 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, query the live graph, update nodes, archive nodes.
  • 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

The MCP server is included in the base install: no extras required.

Configuration

1

Find your MCP client's settings file

2

Add the Semantica MCP server config

Configure your MCP client’s command field exactly. The command field must point to the exact executable path (use which semantica-mcp on macOS/Linux to find it). A wrong path fails silently: the server just doesn’t appear in the tools list. Test with the raw echo | semantica-mcp command first to confirm the binary works.
3

Test locally before configuring your client

Environment Variables

The graph starts empty unless you set SEMANTICA_KG_PATH. The MCP server creates a fresh in-memory ContextGraph on first use. Set SEMANTICA_KG_PATH to a previously saved graph file to restore state across server restarts. Without it, all data is lost when the process exits.
Enable debug logging for troubleshooting. Set SEMANTICA_LOG_LEVEL=DEBUG in your MCP client’s env block, or run python -m semantica.mcp_server directly and inspect stderr output.

Tools

The MCP server exposes 15 tools that any connected AI assistant can call:

Knowledge Extraction

Extract named entities (people, places, organisations, concepts) from text using Semantica NER.Input:
Output:
Extract typed relations and (subject, predicate, object) triplets from text.Input:
Output:

Decision Intelligence

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 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 past decisions similar to a given scenario using hybrid similarity search.Input:
max_results defaults to 5, maximum 50.
Use find_precedents before high-stakes decisions. The tool performs hybrid similarity search across all recorded decisions. Call it at the start of any significant decision path: it surfaces past reasoning that may be directly applicable, reducing redundant work and improving consistency across agent runs.
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 a node/entity to the live knowledge graph.Input:
Only id is required. label defaults to the id value. type defaults to "Entity".
Add a directed relationship (edge) between two existing entities.Input:
source and target are required. type defaults to "RELATED_TO".
Return a high-level summary of the current knowledge graph.Output:
Takes no input parameters.
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.
Read the live graph in one of three modes, set by mode:
  • node — return a single node by node_id.
  • neighbors (default) — traverse outward and inward from node_id up to depth hops (clamped to 1-5, default 1). Optional relationship_types filters edge types; optional limit caps results.
  • search — keyword match query against each node’s id and content. Optional node_type restricts the scan; limit defaults to 50.
Input:
Merge a set of properties onto an existing node. The change is applied in memory and, when SEMANTICA_KG_PATH is set, written back to that file so it survives a restart. Returns persisted: false when no path is configured.Input:
node_id and a non-empty properties object are required. Updating a missing node returns an error.
Soft-delete a node: it stays in the graph for history but is marked status: "archived". Persists to SEMANTICA_KG_PATH when configured.Input:

Reasoning

Run forward-chaining IF/THEN rules over a set of facts to derive new facts.Input:
Output:

Export

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:
  • 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.