Tool

Wikidata MCP

A provenance-first Wikidata MCP server. Every answer carries its receipt: the statement node, rank, references, retrieved_at, and backend — reproducible from primary source.

Tools

resolve
Ranked candidates for a term or property. Never auto-picks; returns all matches with confidence scores so you choose.
get_claims
Fetch statements from an entity, optionally filtered by property. Returns the full receipt: rank, references, retrieved timestamp, and backend.
entity_seo_pack
Query by name or QID. Returns sameAs identifiers, JSON-LD ready, plus conflicts and external-ID mappings. Useful for knowledge graph alignment.
query_sparql
Raw SPARQL queries against WDQS. Automatically wraps results with provenance metadata (retrieved_at, backend).

Resource: wikidata://sparql-cheatsheet for query help.

Install and run

Wikidata MCP runs as a standard Model Context Protocol server over stdio.

pip install -e ".[dev]"
wikidata-mcp

Requires Python 3.8+.

Tests

Pure module tests run in isolation:

pytest -q

Add live smoke tests against WDQS (the real Wikidata Query Service):

WIKIDATA_MCP_LIVE=1 pytest -q

What it can't claim

  • Freshness equals WDQS lag. retrieved_at is fetch time, not edit time. The server reflects what WDQS reports at query time, which may lag live edits by seconds to minutes.
  • External ID sameAs are confidence-reviewed, not resolved. entity_seo_pack returns external-ID mappings as confidence: review with no formatter-URL resolution (formatter-URL resolution is out of v1 scope).
  • No SPARQL repair, caching tiers, or local mirror. The server always queries WDQS directly. No query optimization, no local cache, no offline mode. By design — see the spec.

Where it fits

Reach for Wikidata MCP over the raw Wikidata API when you need to keep the provenance: fact-checking, entity enrichment, and any audit trail where "where did this number come from" has to be answerable later. Because every answer carries its statement node, rank, references, and retrieval time, you can cite each fact you add and re-check it, rather than copying a value that was true once.

To find which entities a knowledge graph is missing about a site, use Entity Gap X-Ray. For the same provenance idea applied to on-chain text, see Cold Storage. For the full workflow of making a site resolvable, read the guide on building entity-rich sites.