Wikidata MCP Server

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

Remote serverstreamable-http

What is the Wikidata MCP server?

Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers. That is what the wikidata mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

  • Declarative tool definitions — single file per tool, framework handles registration and validation
  • Unified error handling across all tools
  • Pluggable auth (none, jwt, oauth)
  • Swappable storage backends: in-memory, filesystem, Supabase, Cloudflare KV/R2/D1
  • Structured logging with optional OpenTelemetry tracing
  • Runs locally (stdio/HTTP) from the same codebase

The tools it exposes

The server publishes 9 tools. What each one is for:

  • wikidata_search_entities — Search for items or properties by text query, returning QIDs/PIDs with labels, descriptions, and match metadata
  • wikidata_get_entity — Fetch a full entity by QID or PID with optional field and language filtering
  • wikidata_get_labels — Batch-resolve up to 50 QIDs or PIDs to human-readable labels and descriptions
  • wikidata_get_statements — Fetch property claims for an entity with qualifier detail and QID label resolution
  • wikidata_get_sitelinks — Fetch Wikipedia and Wikimedia project article URLs for a Wikidata item
  • wikidata_sparql_query — Execute a SPARQL SELECT query against the Wikidata Query Service
  • wikidata_resolve_external_id — Look up a Wikidata entity by an external identifier (DOI, PubMed ID, ORCID, OpenAlex ID, etc.)
  • Prerequisites — The Prerequisites tool exposed by this server
  • Installation — The Installation tool exposed by this server

What it needs from you

Configuration is passed through the environment: MCP_TRANSPORT_TYPE, MCP_LOG_LEVEL, MCP_HTTP_ENDPOINT_PATH, MCP_PUBLIC_URL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Getting it running

Because this one is hosted, setup is mostly authentication — you point your client at the endpoint and approve access. Nothing runs on your machine, so there is no runtime to keep patched.

How it compares

Among the file and storage access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Wikidata's toolset — wikidata_search_entities, wikidata_get_entity, wikidata_get_labels and 6 more — is a fair guide to whether it matches your workflow. It is maintained by cyanheads; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Wikidata's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • Your data travels to the provider's service, so the usual questions apply about what you send and what they retain.
  • With 9 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Wikidata.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
wikidata_search_entitiesSearch for items or properties by text query, returning QIDs/PIDs with labels, descriptions, and match metadata
wikidata_get_entityFetch a full entity by QID or PID with optional field and language filtering
wikidata_get_labelsBatch-resolve up to 50 QIDs or PIDs to human-readable labels and descriptions
wikidata_get_statementsFetch property claims for an entity with qualifier detail and QID label resolution
wikidata_get_sitelinksFetch Wikipedia and Wikimedia project article URLs for a Wikidata item
wikidata_sparql_queryExecute a SPARQL SELECT query against the Wikidata Query Service
wikidata_resolve_external_idLook up a Wikidata entity by an external identifier (DOI, PubMed ID, ORCID, OpenAlex ID, etc.)
PrerequisitesThe Prerequisites tool exposed by this server.
InstallationThe Installation tool exposed by this server.

How to install the Wikidata MCP server

{
  "mcpServers": {
    "wikidata-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/wikidata-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
MCP_TRANSPORT_TYPEConfiguration value read at startup.Optional
MCP_LOG_LEVELConfiguration value read at startup.Optional
MCP_HTTP_ENDPOINT_PATHFilesystem location the server is allowed to use.Optional
MCP_PUBLIC_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Wikidata to wikidata search entities.
  • Use Wikidata to wikidata get entity.
  • Use Wikidata to wikidata get labels.

Frequently asked questions

It connects Wikidata to MCP-compatible AI assistants such as Claude and Cursor, exposing 9 tools (wikidata_search_entities, wikidata_get_entity, wikidata_get_labels, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Wikidata directly.