# wikidata-mcp-server MCP server

Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers.

## Links
- Registry page: https://www.getdrio.com/mcp/io-github-cyanheads-wikidata-mcp-server
- Repository: https://github.com/cyanheads/wikidata-mcp-server

## Install
- Command: `npx -y @cyanheads/wikidata-mcp-server`
- Endpoint: https://wikidata.caseyjhand.com/mcp
- Auth: Not captured

## Setup notes
- Package: Npm @cyanheads/wikidata-mcp-server v0.1.5
- Environment variable: WIKIDATA_USER_AGENT (default wikidata-mcp-server/0.1 (https://github.com/cyanheads/wikidata-mcp-server))
- Environment variable: WIKIDATA_SPARQL_TIMEOUT_MS (default 55000)
- Environment variable: WIKIDATA_REST_TIMEOUT_MS (default 10000)
- Environment variable: MCP_LOG_LEVEL (default info)
- Package: Npm @cyanheads/wikidata-mcp-server v0.1.5
- Environment variable: MCP_HTTP_HOST (default 127.0.0.1)
- Environment variable: MCP_HTTP_PORT (default 3010)
- Environment variable: MCP_HTTP_ENDPOINT_PATH (default /mcp)
- Environment variable: MCP_AUTH_MODE (default none)
- Environment variable: WIKIDATA_USER_AGENT (default wikidata-mcp-server/0.1 (https://github.com/cyanheads/wikidata-mcp-server))
- Environment variable: WIKIDATA_SPARQL_TIMEOUT_MS (default 55000)
- Environment variable: WIKIDATA_REST_TIMEOUT_MS (default 10000)
- Environment variable: MCP_LOG_LEVEL (default info)
- Remote endpoint: https://wikidata.caseyjhand.com/mcp

## Tools
- wikidata_search_entities (Search Wikidata Entities) - Search Wikidata for items or properties by text query. Returns QIDs or PIDs with labels, descriptions, and match metadata indicating whether the hit was on a label or alias. Use type="item" for real-world concepts (people, places, works) and type="property" to find predicate P-IDs. The API returns no total count — pagination is offset-based with no result ceiling indicator. Endpoint: https://wikidata.caseyjhand.com/mcp
- wikidata_get_entity (Get Wikidata Entity) - Fetch a Wikidata entity (item or property) by QID or PID. Use the fields parameter to trim what is returned to the caller — major items can be large. Omit fields to get all data. Q-IDs (e.g. Q76) fetch items; P-IDs (e.g. P31) fetch properties from the correct endpoint automatically. Use wikidata_get_statements for deep claim traversal with label resolution. Endpoint: https://wikidata.caseyjhand.com/mcp
- wikidata_get_labels (Get Wikidata Labels) - Resolve one or more QIDs or PIDs to their human-readable labels and descriptions. Lightweight — returns no claim data. Supports up to 50 IDs per call (batched automatically). Designed for the common agent pattern: receive QIDs from a SPARQL query, then humanize them. Endpoint: https://wikidata.caseyjhand.com/mcp
- wikidata_get_statements (Get Wikidata Statements) - Fetch property claims for a Wikidata entity with qualifier and reference detail. Value QIDs are resolved to human-readable labels by default. Use the properties parameter to fetch only specific P-IDs — omitting it returns all statements, which can be large. Designed for fact verification: "what does Wikidata say about this entity's {property}?". Preferred-rank statements are the most current values. Endpoint: https://wikidata.caseyjhand.com/mcp
- wikidata_get_sitelinks (Get Wikidata Sitelinks) - Fetch Wikipedia and Wikimedia project article URLs for a Wikidata item. A sitelink maps a site code (e.g., "enwiki") to a Wikipedia article title and URL. Major items can have 300+ sitelinks across languages. Use sites to filter to specific language editions, or wikis_only to return only Wikipedia links. Only Q-IDs (items) have sitelinks — properties (P-IDs) do not. Endpoint: https://wikidata.caseyjhand.com/mcp
- wikidata_sparql_query (Wikidata SPARQL Query) - Execute a SPARQL SELECT query against the Wikidata Query Service. Full graph power: multi-hop traversals, aggregations, subqueries, OPTIONAL, FILTER, UNION, BIND. Standard Wikidata prefixes (wd:, wdt:, p:, ps:, pq:, wikibase:, bd:) are auto-injected. The wikibase:label SERVICE is also auto-injected when language is set and the query includes ?<var>Label variables — so you can use ?itemLabel without writing the boilerplate. Hard server timeout is 60s; use LIMIT to keep queries fast. Bindings use the SPARQL 1.1 JSON format: each value is { type, value, "xml:lang"? }. Use wikidata_get_labels to humanize QID results from this tool. Endpoint: https://wikidata.caseyjhand.com/mcp
- wikidata_resolve_external_id (Resolve Wikidata External ID) - Look up a Wikidata entity by an external identifier such as a DOI, PubMed ID, ORCID iD, or OpenAlex ID. Returns match=<entity> on success, match=null when not found, and match=null with multipleMatches populated when a Wikidata data integrity issue causes more than one entity to claim the same external ID. Common cross-server join use cases: CrossRef DOI → Wikidata paper QID (P356), PubMed PMID → Wikidata paper QID (P698), ORCID → author QID (P496), OpenAlex ID → entity QID (P10283). Known value normalization is applied automatically: DOIs are uppercased, PMID prefixes stripped, ORCID hyphens normalized. Endpoint: https://wikidata.caseyjhand.com/mcp

## Resources
- wikidata://entity/Q76 - wikidata-entity Example: Wikidata entity for Barack Obama MIME type: text/markdown
- wikidata://entity/Q42 - wikidata-entity Example: Wikidata entity for Douglas Adams MIME type: text/markdown
- wikidata://entity/P31 - wikidata-entity Example: Wikidata property "instance of" MIME type: text/markdown

## Prompts
Not captured

## Metadata
- Owner: io.github.cyanheads
- Version: 0.1.5
- Runtime: Npm
- Transports: STDIO, HTTP
- License: Not captured
- Language: Not captured
- Stars: Not captured
- Updated: May 24, 2026
- Source: https://registry.modelcontextprotocol.io
