cyanheads avatar

Wikidata Mcp Server

cyanheads/wikidata-mcp-server

Connects Claude to Wikidata's 100+ million structured entities through seven tools and SPARQL access. You get entity search, full entity fetches with field filtering, batch label resolution for up to 50 QIDs at once, statement extraction with automatic label resolution, sitelink lookup across Wikipedia projects, and direct SPARQL queries against Blazegraph with auto-injected prefixes. The external ID resolver is built for cross-referencing: pass a DOI, PubMed ID, ORCID, or OpenAlex ID and get back the Wikidata QID. Runs locally via stdio or from a public HTTP endpoint. Reach for this when you need structured knowledge graph queries, fact verification against canonical data, or identifier mapping between research databases.

GitHub stars
3
tools
7
transport
STDIO, HTTP
env vars
9
last updated
Oct 28, 2026

Install

From registry metadata
$ npx add-mcp https://wikidata.caseyjhand.com/mcp --name wikidata

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http wikidata https://wikidata.caseyjhand.com/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 7 tools

Verified live against the running server on Nov 6, 2026.

wikidata_search_entitiesSearch 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...5 params

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...

Parameters* required
languagestring
Wikidata language code for returned labels and descriptions (e.g., "en", "de", "zh-hant"). Case-insensitive; "_" is read as "-"; blank means "en".default: en
limitinteger
Maximum number of results to return. Range: 1–50.default: 10
offsetinteger
Pagination offset. Start at 0; increment by limit to page through results.default: 0
query*string
Search terms to match against entity labels, aliases, and descriptions.
typestring
Entity type to search. Use "item" for Q-IDs (people, places, concepts) or "property" for P-IDs (predicates).one of item · propertydefault: item
wikidata_get_entityFetch a Wikidata entity (item or property) by QID or PID. The fields parameter narrows the upstream fetch, not just the response — asking for labels alone costs a fraction of the whole entity, so name the fields you need. Omit fields for all data; a well-connected item is larg...3 params

Fetch a Wikidata entity (item or property) by QID or PID. The fields parameter narrows the upstream fetch, not just the response — asking for labels alone costs a fraction of the whole entity, so name the fields you need. Omit fields for all data; a well-connected item is larg...

Parameters* required
fieldsarray
Fields to include. Options: "labels", "descriptions", "aliases", "statements", "sitelinks". Narrows the upstream fetch as well as the response, so a narrow selection is markedly cheaper. Omit for a...
id*string
Q-ID (e.g., "Q76") or P-ID (e.g., "P31"). Case-insensitive — normalized to uppercase.
languagesarray
Wikidata language codes to include in labels, descriptions, and aliases (e.g., ["en", "de"]). Case-insensitive; "_" is read as "-"; blank entries are dropped. A requested language with no label of...
wikidata_get_labelsResolve 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.2 params

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.

Parameters* required
ids*array
Q-IDs (e.g., "Q76") or P-IDs (e.g., "P31") to resolve. 1–50 IDs per call.
languagesarray
Wikidata language codes for returned labels and descriptions (e.g., ["en", "de", "fr"]). Case-insensitive; "_" is read as "-"; blank entries are dropped, and an empty list means ["en"]. A language...
wikidata_get_statementsFetch property claims for a Wikidata entity with qualifier and reference detail. Item QIDs and quantity units — in values, qualifiers, and references — are resolved to human-readable labels by default. Use the properties parameter to fetch only specific P-IDs — omitting it ret...4 params

Fetch property claims for a Wikidata entity with qualifier and reference detail. Item QIDs and quantity units — in values, qualifiers, and references — are resolved to human-readable labels by default. Use the properties parameter to fetch only specific P-IDs — omitting it ret...

Parameters* required
id*string
Q-ID (e.g., "Q76") or P-ID of the entity to fetch statements for.
languagestring
Wikidata language code for label resolution of QID values (e.g., "en", "de"). Case-insensitive; "_" is read as "-"; blank means "en".default: en
propertiesarray
P-IDs to fetch (e.g., ["P31", "P569", "P27"]). Omit to return all properties (may be large for major items).
resolve_labelsboolean
Resolve item QIDs (label) and quantity unit QIDs (unitLabel) to human-readable labels via one batched label call, covering main values, qualifiers, and reference parts. Set to false to skip label r...default: true
wikidata_get_sitelinksFetch 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...3 params

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...

Parameters* required
id*string
Q-ID of the item (e.g., "Q76"). Only items have sitelinks; properties (P-IDs) are not supported.
sitesarray
Optional filter to specific site codes (e.g., ["enwiki", "frwiki", "dewiki"]). Omit to return all sitelinks.
wikis_onlyboolean
When true, return only Wikipedia sitelinks (site codes ending in "wiki", e.g., "enwiki", "dewiki"). Excludes Wikisource, Wiktionary, Wikiquote, etc.default: false
wikidata_sparql_queryExecute 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:, rdfs:, schema:) are auto-injected. The wikiba...3 params

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:, rdfs:, schema:) are auto-injected. The wikiba...

Parameters* required
languagestring
Wikidata language code, or a comma-separated fallback list tried in order (e.g., "en", "de", "fr,en"), for the injected wikibase:label SERVICE — the language of ?<var>Label, ?<var>Description, and...default: en
query*string
SPARQL SELECT query. Any other form — ASK, CONSTRUCT, DESCRIBE, an update, or plain search text — is rejected before it is sent. Standard prefixes (wd:, wdt:, p:, ps:, pq:, wikibase:, bd:, rdfs:, s...
timeoutinteger
Client-side timeout in seconds (1–55). Capped at 55s — the Wikidata server hard limit is 60s.default: 30
wikidata_resolve_external_idLook 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...3 params

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...

Parameters* required
languagestring
Wikidata language code for the label and description in the response (e.g., "en", "de"). Case-insensitive; "_" is read as "-"; blank means "en". An entity with no label in this language returns its...default: en
property*string
P-ID of the external identifier property, whose Wikidata data type must be external-id (e.g., "P356" for DOI, "P698" for PubMed ID, "P496" for ORCID, "P10283" for OpenAlex ID, "P345" for IMDb ID)....
value*string
The external identifier value to look up (e.g., "10.1038/nature01234" for a DOI, "32283226" for a PubMed ID, "0000-0002-1825-0097" for an ORCID). A resolver URL is accepted for DOI, PubMed, and ORC...

Sponsors

Configuration

WIKIDATA_USER_AGENTdefault: wikidata-mcp-server/0.1 (https://github.com/cyanheads/wikidata-mcp-server)

User-Agent string for Wikimedia requests. Wikimedia policy requires a descriptive value.

WIKIDATA_SPARQL_TIMEOUT_MSdefault: 55000

Max time to wait for a SPARQL response in milliseconds.

WIKIDATA_REST_TIMEOUT_MSdefault: 10000

Max time to wait for REST API responses in milliseconds.

MCP_LOG_LEVELdefault: info

Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').

MCP_TRANSPORT_TYPEdefault: http

Selects the HTTP transport.

MCP_HTTP_HOSTdefault: 127.0.0.1

The hostname for the HTTP server.

MCP_HTTP_PORTdefault: 3010

The port to run the HTTP server on.

MCP_HTTP_ENDPOINT_PATHdefault: /mcp

The endpoint path for the MCP server.

MCP_AUTH_MODEdefault: none

Authentication mode to use: 'none', 'jwt', or 'oauth'.

Readme

@cyanheads/wikidata-mcp-server

Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers via MCP. STDIO or Streamable HTTP.

7 Tools • 1 Resource • 1 Skill

Details

Repository
github.com/cyanheads/wikidata-mcp-server
Category
Search & Web Crawling
Package
@cyanheads/wikidata-mcp-server
Transport
STDIO, HTTP
Registry
MCP registry, active
Resources
4
Tools verified
Nov 6, 2026

More from cyanheads

Related Search & Web Crawling MCP servers

View all
1diffbot avatarDiffbotdiffbot/diffbot-mcpWeb search, page extraction, crawling, and Knowledge Graph queries from Diffbot's web index.3stars
2ofershap avatarMarkdownofershap/mcp-server-markdownMarkdown MCP — search, extract sections, list headings, find code blocks.3stars
3symdex-100 avatarSymdexsymdex-100/symdexIndex and search codebases using structured schemas for deep code analysis. Audit specific domains or security-related functions to ensure code quality and safe3stars
4symdex-100 avatarSymdexsymdex-100/symdexIndex and search codebases using structured schemas for deep code analysis. Audit specific domains or security-related functions to ensure code quality and safe3stars
5burnssa avatarAfterpathsburnssa/afterpathsSession memory for AI coding agents. Search past sessions, extract rules, and track what works.2stars
6chocodata-com avatarAmazon Scraper APIchocodata-com/amazon-scraper-api-mcpScrape Amazon products, search, and async batch ASIN lookups across 20 marketplaces2stars