Wikidata MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| WIKIDATA_SPARQL_URL | No | URL of the local QLever SPARQL endpoint (e.g. http://localhost:7001/sparql or Tailscale host http://100.96.219.81:7001/sparql). | http://localhost:7001/sparql |
| WIKIDATA_TIMEOUT_MS | No | Per-query HTTP timeout in milliseconds. | 30000 |
| WIKIDATA_CACHE_TTL_MS | No | In-memory label cache TTL in milliseconds (5 minutes). Set to 0 to disable caching. | 300000 |
| WIKIDATA_ALLOW_RAW_SPARQL | No | When false or 0, disables the query_sparql escape hatch tool. | true |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server connects to a local, high-performance QLever Wikidata Truthy SPARQL endpoint (~2.93B triples). Use it to ground free-text intelligence briefs, reports, and news analysis with verified Wikidata entity QIDs, outbound triples, cross-links, and inbound rosters.
Key tools:
ground_entities: Single composite tool for brief enrichment. Resolves mentions, retrieves triples, discovers cross-links, and pulls inbound alliance/conflict rosters.
resolve_entities: Batched entity resolution with domain class filtering and disambiguation fingerprints.
get_entity_triples: Outbound triples with clean labels and deduplicated values.
find_cross_links: Direct edges and shared hubs (alliances, conflicts, geographic features) between resolved entities.
get_inbound_relations: Inbound member rosters (P463), conflict participants (P710), basin countries (P205), etc.
query_sparql: Guarded read-only SPARQL query execution for custom lookups.
check_health: Test endpoint availability, triple count, and latency.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| check_healthA | Verify connectivity to the local QLever Wikidata Truthy SPARQL endpoint and return the total indexed triple count and query latency. |
| resolve_entitiesB | Resolve a batch of named entity mentions to Wikidata QIDs using deterministic label matching, domain P31/P279 class filtering, homonym scoring, and disambiguation fingerprints. |
| get_entity_triplesB | Retrieve curated outbound Wikidata triples for one or more entity QIDs. Returns grouped, deduplicated facts with human-readable predicate and object labels. |
| get_inbound_relationsA | Retrieve inbound relations for target entities (e.g. alliance members via P463, conflict participants via P710, basin countries via P205, corporate owners via P127). Includes accurate total counts and truncation flags. |
| find_cross_linksA | Discover direct relationships and shared hubs (alliances, conflicts, parent entities, shared bodies of water) between a set of resolved Wikidata entities, filtering out irrelevant entertainment/sports hubs. |
| ground_entitiesB | Single composite tool to ground a brief: resolves all mentions to Wikidata QIDs, retrieves curated outbound triples, discovers inter-entity cross-links and shared hubs, and retrieves key inbound rosters. |
| query_sparqlA | Execute an arbitrary read-only SPARQL SELECT or ASK query against the local QLever Wikidata endpoint. Auto-declares standard prefixes (wd:, wdt:, rdfs:, xsd:) and enforces query limits. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| enrich_brief | Ground an Executive Intelligence Brief or news report with Wikidata QID tags, verified triples, and cross-links. |
| extract_and_ground_entities | Extract all named entities from a document and generate a structured Wikidata knowledge grounding report. |
| verify_claims | Verify factual claims (memberships, alliances, borders, leadership, ownership) against the local Wikidata knowledge store. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| schema-predicates | Curated OSINT predicate whitelist and static English label dictionary for Wikidata properties. |
| schema-domains | Catalog of supported semantic domain presets and their mapped root Wikidata class QIDs. |
| guidelines-brief-enrichment | Editorial guidelines and formatting rules for grounding executive intelligence briefs with Wikidata. |
TDQS
Scored across 7 tools
Most tools clearly target distinct actions or resource views, but ground_entities is a composite that deliberately overlaps resolve_entities, get_entity_triples, find_cross_links, and get_inbound_relations. That overlap is explicitly described, though an agent still has to decide between the composite and granular tools.
All seven tools use snake_case with a predictable verb_noun or verb-object pattern (check_health, resolve_entities, get_entity_triples, query_sparql). The conventions are consistent throughout the set.
Seven tools is well within the appropriate range for a focused Wikidata access server and each tool covers a meaningful operation. The composite ground_entities adds redundancy, but the overall count remains well-scoped rather than bloated.
The set covers the read-only research lifecycle well: health checking, entity resolution, outbound facts, inbound relations, cross-links, composite grounding, and arbitrary SPARQL. Minor gaps such as dedicated property/class metadata lookup or explicit pagination are largely mitigated by query_sparql and truncation flags.