Wikidata MCP
Provides entity resolution and knowledge graph grounding against a local Wikidata Truthy QLever SPARQL endpoint, enabling retrieval of curated entity triples, cross-links, inbound relations, and execution of read-only SPARQL queries for OSINT and executive brief enrichment.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Wikidata MCP
Model Context Protocol (MCP) server for local Wikidata Truthy knowledge grounding, entity resolution, and Executive Intelligence Brief (EIB) enrichment.
Designed as an MCP companion to the MacronX OSINT pipeline and the self-hosted local-wikidata QLever instance (~2.93B best-rank triples on localhost:7001/sparql).
What It Does
wikidata-mcp transitions the manual, prompt-heavy wikidata-brief-enrich skill into a fast, deterministic, batch-oriented knowledge graph server:
Single-Shot Brief Grounding (
ground_entities): Resolves all named entity mentions in an article or SITREP, retrieves curated outbound triples, discovers direct and shared connections (alliances, conflicts, water bodies), and pulls inbound rosters in a single composite call.Layered Deterministic Disambiguation (
resolve_entities): Matches exact labels, short names (P1813), and official names (P1448), filters against curatedP31domain class presets and 1-hopP279subclasses, filters Wikimedia noise (disambiguation pages, taxa, scholarly articles, songs), and computes disambiguation fingerprints (head of state, inception, HQ, country) to resolve homonyms deterministically without LLM hallucination.Batched Label Hydration &
@en/@mulDeduplication: Structural graph queries never join multipleOPTIONAL { ?x rdfs:label ?label }clauses inline. A dedicatedLabelHydratorbatch-resolves QIDs into clean English labels with an in-memory TTL cache, prioritizing@enover@muland eliminating row duplication.Sports & Entertainment Hub Filtering: Strips recurring athletic tournaments, curling championships, and cups when discovering shared
P710conflict/event hubs so sovereign states and leaders cross-reference only geopolitical summits, treaties, and conflicts.Guarded SPARQL Escape Hatch (
query_sparql): Allows agents to run custom read-onlySELECT/ASKqueries with auto-injected standard prefixes (wd:,wdt:,rdfs:,xsd:), enforced row limits (max 500), and automated QID/PID label hydration.Editorial Prompts & Schema Resources: Includes MCP prompts (
enrich_brief,verify_claims,extract_and_ground_entities) and resources (wikidata://schema/predicates,wikidata://schema/domains,wikidata://entities/{qid}) that instruct any connected agent to produce MacronX-compliant flat-bullet executive briefs with inline`QID`tags and▸ Wikidata grounding:lines.
Related MCP server: andish-mcp
Installation & Build
cd /Users/leonid/src/wikidata-mcp
npm install
npm run build
npm testEnvironment Configuration
Variable | Required | Default | Description |
| No |
| URL of the local QLever SPARQL endpoint (e.g. |
| No |
| Per-query HTTP timeout in milliseconds. |
| No |
| When |
| No |
| In-memory label cache TTL in milliseconds (5 minutes). Set to |
MCP Client Configuration
1. Antigravity IDE / Claude Desktop / Cursor
Add to your mcpServers configuration:
{
"mcpServers": {
"wikidata": {
"command": "node",
"args": ["/Users/leonid/src/wikidata-mcp/dist/index.js"],
"env": {
"WIKIDATA_SPARQL_URL": "http://100.96.219.81:7001/sparql"
}
}
}
}2. Claude Code CLI
claude mcp add wikidata \
-e WIKIDATA_SPARQL_URL=http://100.96.219.81:7001/sparql \
-- node /Users/leonid/src/wikidata-mcp/dist/index.js3. OpenCode (opencode.json)
{
"mcp": {
"wikidata": {
"command": "node",
"args": ["/Users/leonid/src/wikidata-mcp/dist/index.js"],
"env": {
"WIKIDATA_SPARQL_URL": "http://100.96.219.81:7001/sparql"
}
}
}
}MCP Surface Reference
Tools (7 Domain Tools)
check_health: Verifies connectivity to the local QLever SPARQL endpoint and reports total indexed triples (~2.93B) and query latency.ground_entities: Single composite tool for brief enrichment: resolves a batch of entity mentions, retrieves curated outbound triples, discovers direct links and shared alliances/conflicts, and pulls inbound rosters.resolve_entities: Resolves free-text mentions to Wikidata QIDs using label matching (rdfs:label,P1813,P1448), domain class filtering (country,person,company,conflict,geographic_feature,infrastructure,military,organization, etc.), and disambiguation fingerprints.get_entity_triples: Retrieves curated outbound triples for one or more entity QIDs with human-readable property and object labels (covering 48 OSINT predicates across all MacronX sectors).find_cross_links: Identifies direct edges (A -> P -> B) and shared group/conflict hubs between a set of resolved entities while filtering out sports and entertainment competitions.get_inbound_relations: Retrieves inbound rosters (e.g. member countries viaP463, conflict participants viaP710, basin countries viaP205) with accurate total counts and truncation flags.query_sparql: Executes arbitrary read-only SPARQLSELECTorASKqueries with auto-injected prefixes, row limit clamping (max 500), and automated QID/PID label annotation.
Resources (wikidata://)
wikidata://schema/predicates— JSON catalog of all 48 default OSINT predicates and the ~200-property static English label dictionary.wikidata://schema/domains— JSON catalog of supported domain presets and their mapped root Wikidata class QIDs.wikidata://guidelines/brief-enrichment— Full editorial guidelines and formatting rules for grounding executive intelligence briefs.wikidata://entities/{qid}— Live outbound triple profile for any Wikidata entity QID.
Guided Workflow Prompts
enrich_brief(brief_text,eib_flat_bullets) — Guides the agent through extracting mentions, callingground_entities, preserving wording verbatim, tagging first mentions inline (Russia `Q159`), and placing▸ Wikidata grounding:lines following MacronX flat-bullet rules.extract_and_ground_entities(text) — Generates a structured knowledge catalog (entities, outbound triples, cross-links, unmapped items) from a source document.verify_claims(claims_text) — Fact-checks specific claims (memberships, alliances, borders, leadership, ownership) against the local Wikidata knowledge store.
Development & Testing
# Typecheck
npm run typecheck
# Run unit and end-to-end test suite (vitest)
npm test
# Build production bundles (tsup)
npm run buildLicense
MIT © 2026 Leonid Medovyy leonid@macron1.io
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Machine-readable entity discovery with provenance, trust and verified source evidence.
Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers.
Knowledge graph for AI agents. Query concepts, walk edges, get advisories.
Read-only Wikidata tools and identity evidence. Local optional Google KG; bounded public remote.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables semantic search and exploration of a business glossary knowledge graph, allowing users to query terms, expand related concepts, trace dependencies, and resolve physical table mappings.-
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible clients to search and query a team knowledge graph, retrieve document context, upload files for indexing, explore entities and connections, and monitor workspace usage and server health.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to inspect ontology schemas, search typed objects, and execute read-only SPARQL queries against an RDF triple store.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to query a single-source ontology of types, entities, statements, evidence, and controlled vocabulary, including bitemporal "as of" and "as recorded" fact lookups. Supports writing by letting agents propose candidate statements while keeping approval, review transitions, and authoritative reasoning restricted to approved facts.MIT