Wikidata:MCP
This page is a work in progress, not an article or policy, and may be incomplete and/or unreliable.
Please offer suggestions on the talk page. বাংলা | català | čeština | Deutsch | English | español | فارسی | suomi | français | עברית | हिन्दी | magyar | italiano | 日本語 | 한국어 | Lëtzebuergesch | latviešu | македонски | Bahasa Melayu | မြန်မာဘာသာ | norsk bokmål | Nederlands | ਪੰਜਾਬੀ | polski | پنجابی | português | português do Brasil | română | Scots | shqip | slovenščina | српски / srpski | svenska | Türkçe | русский | українська | 中文(简体) | 中文(繁體) | +/− |
The Wikidata MCP provides a set of standardized tools that allow large language models (LLMs) to explore and query Wikidata programmatically. It is designed for agentic AI or AI workflows that need to search, inspect, and query Wikidata, without relying on hardcoded assumptions about its structure or content.
The Wikidata Query Service requires an understanding of SPARQL’s syntax and Wikidata’s data model. While many LLMs can generate syntactically valid SPARQL queries, they lack an understanding of Wikidata’s schema and the relationships between items within a specific domain. The Wikidata MCP connects LLMs to the Wikidata API and Wikidata Query Service to assist users in their research.
Model Context Protocol (MCP)
[edit]Model Context Protocol (MCP), often described as "USB-C for AI", is an open standard, open-source framework introduced by Anthropic to standardize the way large language models (LLMs) interact with external tools, systems, and data sources.
How to set up
[edit]- For hosted chat interfaces (no MCP config exposed), use a client/platform that supports custom MCP server configuration, then connect to:
- For MCP-configurable clients (custom server setup), add this server configuration:
{ "mcpServers": { "wikidata": { "type": "streamable_http", "url": "https://wd-mcp.wmcloud.org/mcp/" } } }
Tools
[edit]Tools are exposed as API endpoints and can be tested interactively at wd-mcp.wmcloud.org/docs.
| Tool | Function | What it does | Typical use |
|---|---|---|---|
| Search Items | search_items(
query,
lang="en",
)
|
Hybrid search combining keyword-based and vector-based search over Wikidata items (QIDs). | Use first to discover candidate items from natural-language queries. |
| Search Properties | search_properties(
query,
lang="en",
)
|
Hybrid search combining keyword-based and vector-based search over Wikidata properties (PIDs) | Use first to identify relevant properties from natural-language queries. |
| Get Statements | get_statements(
entity_id,
include_external_ids=False,
lang="en",
)
|
Lists all direct graph connections (statements) of a Wikidata entity in triplet format and their values. This tool excludes qualifiers, deprecated values, and references. | Use to verify direct relationships and get a fast structural overview. |
| Get Statement Values | get_statement_values(
entity_id,
property_id,
lang="en",
)
|
Returns full statement details for an entity-property pair, including qualifiers, deprecated values, and references. | Use when detailed claim context matters (provenance, qualifiers, deprecated values). |
| Get Instance and Subclass Hierarchy | get_instance_and_subclass_hierarchy(
entity_id,
max_depth=5,
lang="en",
)
|
Traverses an entity’s classification context through P31 (instance of) and P279 (subclass of) to show its type hierarchy up to a chosen depth. | Use to validate class/ontology context before building filters. |
| Execute SPARQL | execute_sparql(
sparql,
K=10,
)
|
Runs a SPARQL query on Wikidata and returns up to K rows or error messages.
|
Use after confirming entities/properties and relationships with the other tools. |
Wikibase MCP
[edit]For Wikibases other than Wikidata, use the Wikibase MCP at wb-mcp.wmcloud.org.
You can register your Wikibase there to get a dedicated MCP endpoint for your instance, then connect your MCP client to that endpoint.
Links
[edit]- Interactive Tool Testing Ground
- Wikidata MCP GitHub repository
- Wikibase MCP (other than Wikidata)
- Wikibase MCP GitHub repository
Presentations & blog posts
[edit]- "Wikidata MCP: Exploring Wikidata with AI" - presentation by Philippe Saadé of Wikimedia Deutschland at WikidataCon 2025, Nov 2, 2025 (slides, Etherpad Notes)
- "Fact-Checking with Wikidata" - workshop by Philippe Saadé of Wikimedia Deutschland and DataTalks.Club, January 20, 2026
Updates
[edit]- May 2026
- Released the Wikibase MCP at wb-mcp.wmcloud.org
- February 2026
- Added a tool testing environment at wd-mcp.wmcloud.org/docs
- Improvements to WikidataTextifier
- Migrated label caching from SQLite to MySQL
- Migrated the service from Toolforge to WMCloud
- Textifier now supports all 300+ languages available on Wikidata
- Fixed bugs
- Accept both /mcp and /mcp/ as endpoints
- Improve tool names and descriptions for clarity and avoid SPARQL execution before exploration
- January 2026
- Merged keyword and vector searches into a single tool
- The search now supports hybrid search combining keyword and vector search results
- Falls back to keyword search when vector search is unavailable
- Merged keyword and vector searches into a single tool
- December 2025
- Fixed bugs in statement retrieval and SPARQL execution
- November 2025
- Added the get_instance_and_subclass_hierarchy tool
- October 2025
- Release of the Wikidata MCP at [1]
