The Semantica MCP server exposes 12 tools and 3 read-only resources. All tools accept and return JSON. No configuration beyond an optional environment variable for graph persistence is required.
Starting the Server
Install Semantica, then launch the MCP server. It starts in stdio mode by default — the protocol used by Claude Desktop, Windsurf, VS Code extensions, and most MCP clients.SEMANTICA_KG_PATH the server initialises an empty in-memory graph — sufficient for testing. For a persistent graph that survives restarts, set the path:
Without
SEMANTICA_KG_PATH, the graph resets when the server process exits. Always set this path for any session whose data should survive a restart.Connecting to Claude Desktop
Edit the Claude Desktop config file — on macOS at~/Library/Application Support/Claude/claude_desktop_config.json, on Windows at %APPDATA%\Claude\claude_desktop_config.json:
semantica-mcp is not on your system PATH (for example, if it is installed in a virtualenv), use the full binary path in "command": "/path/to/venv/bin/semantica-mcp".
Connecting to Other Clients
Windsurf — in Settings → MCP Servers → Add Server, or edit~/.windsurf/mcp_servers.json:
.mcp.json in your project root:
What the Agent Can Do: The 12 Tools
Once connected, the LLM can call any of these tools during a conversation. The agent chains them automatically — you do not orchestrate the sequence, you just describe what you want. Entity and relation extraction —extract_entities pulls named entities from free text; extract_relations extracts semantic relationships and RDF triplets. These two tools turn a raw OSINT report into structured graph inputs without any preprocessing.
Knowledge graph manipulation — add_entity adds a node, add_relationship adds a directed edge. After extraction, the agent calls these to persist what it found into the live graph.
Decision intelligence — record_decision writes a decision as a provenance node with confidence score, reasoning, and decision maker identity. query_decisions retrieves past decisions by query or category. find_precedents finds the most similar past decisions by semantic similarity. get_causal_chain traces decision causality upstream or downstream.
Reasoning — run_reasoning applies forward-chaining IF/THEN rules over a set of facts and returns derived conclusions.
Analytics and export — get_graph_analytics computes PageRank centrality and community detection. get_graph_summary returns node count, decision count, and server status. export_graph serializes the current graph to Turtle, JSON-LD, N-Triples, or plain JSON.
Watching a Real Agent Session
Here is what happens when an analyst types a prompt into Claude Desktop and the graph is live. The prompt is:“Extract entities and relationships from this OSINT report, add them to the knowledge graph, then record an attribution decision for APT29 with confidence 0.88 and export the full graph as Turtle.”Claude chains five tool calls automatically:
The Three Read-Only Resources
Resources expose graph state without a tool call — the client can read them at any point:| URI | Description |
|---|---|
semantica://graph/summary | Node count, edge count, server status |
semantica://decisions/list | Up to 50 most recent recorded decisions |
semantica://schema/info | Server version, capabilities, available tool list |
Domain Examples
- Defense — CTI/Threat
- Security — SOC/Incident
- Life Science — Clinical/Pharma
- Banking — Risk/Compliance
The CTI team uses Claude Desktop to correlate new OSINT reports against the existing threat graph, record attribution decisions, and query causal chains — all through natural language, with the graph updated live.Analyst prompt:
“Extract entities from this Mandiant report on APT40, add them to the knowledge graph, find any past decisions about APT40 attribution, and record a new attribution decision with confidence 0.84.”Claude chains automatically:
extract_entities+extract_relationson the report textadd_entityfor each extracted entity (APT40, CVEs, infrastructure nodes)add_relationshipfor each extracted relationquery_decisions(query="APT40 attribution", category="threat_attribution")find_precedents(scenario="APT40 targeting maritime sector", max_results=3)record_decision(category="threat_attribution", outcome="attributed_to_apt40", confidence=0.84, decision_maker="analyst_zhang")
Troubleshooting
Server does not appear in Claude Desktop — fully quit and reopen Claude Desktop after editing the config (close the window is not enough). Verify the binary is on PATH:which semantica-mcp on Unix, where semantica-mcp on Windows. If using a virtualenv, use the absolute binary path in "command". Set SEMANTICA_LOG_LEVEL=DEBUG and check stderr for startup errors.
Graph data not persisting between sessions — set SEMANTICA_KG_PATH to an absolute file path. Without it the graph is in-memory only and resets on every server restart.
Tool calls returning empty results — get_graph_summary returning "node_count": 0 means the graph is empty. Populate it via add_entity and add_relationship, or run extract_entities on text first and then add_entity for each result.
Permission errors on SEMANTICA_KG_PATH — the server process needs read/write access to the file and its parent directory. If running inside Docker, verify the volume mount and file ownership.
Related Guides
- Reasoning & Rules — the engine behind the
run_reasoningtool - Decision Intelligence — how decisions are stored as causal graph nodes
- Context Graphs — the graph that
add_entityandadd_relationshipwrite to - Export & Serialization — all export formats available via
export_graph - Ontology Management — generate OWL ontologies from the graph built via MCP
