Skip to content

io.github.cyanheads/wikidata-mcp-server

by cyanheads · remote · local (npm) · no sign-in to list tools · v0.2.0 · published by GitHub user cyanheads

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

Changes · 1

7 tools: 1 change things and 6 only read.

Scanned Oct 21, 2026

1 check matched something in the tool definitions. No finding is not a safety guarantee. How the checks work.

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

Findings

Matches of fixed checks, with the text they matched.

1 warn
  • The server marks "wikidata_sparql_query" read-only (readOnlyHint: true), and its own name, description or input give the class "write".

    Matched text

    annotations: {"readOnlyHint":true,"openWorldHint":true}; The name "wikidata_sparql_query" says "query": a word for reading.

    What this check looks for

Tools

Open a tool for its reasons and full description. Descriptions are the publisher's own words, shown as they are.

7 tools

Changes things 1Claude Code: ask
  • wikidata_sparql_queryExecute a SPARQL SELECT query against the Wikidata Query Service.1 finding

    Why it is in this group

    • The name "wikidata_sparql_query" says "query": a word for reading.
    • The description's first verb is "execute": a word for a change.
    • The server marks it read-only (readOnlyHint: true), but an annotation never lowers a class.

    Findings

    • Warn

      The server marks "wikidata_sparql_query" read-only (readOnlyHint: true), and its own name, description or input give the class "write".

      Matched text

      annotations: {"readOnlyHint":true,"openWorldHint":true}; The name "wikidata_sparql_query" says "query": a word for reading.

      What this check looks for
    Description, as the server wrote it
    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 wikibase:label SERVICE is also auto-injected when the query references a ?<var>Label, ?<var>Description, or ?<var>AltLabel variable and declares no label SERVICE of its own — 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"?, datatype? }. Each response is held to 64,000 bytes, cut between whole rows: a larger result returns its leading rows with returnedCount and totalCount and a notice — page with ORDER BY plus LIMIT/OFFSET, or aggregate in the query. Use wikidata_get_labels to humanize QID results from this tool.

    Annotations the server declares

    • readOnlyHint: true
    • openWorldHint: true
Only reads 6Claude Code: allow
  • wikidata_get_entityFetch a Wikidata entity (item or property) by QID or PID.No findings

    Why it is in this group

    • The name "wikidata_get_entity" says "get": a word for reading.
    Description, as the server wrote it
    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 large enough to overflow, and an oversized entity returns kind: "outline" — the field categories with their byte sizes — instead of the data. Follow its retrieval_notice literally rather than picking from sections yourself — it names a fields set already measured to fit, since category sizes are additive and requesting them all would overflow again; for a category too large to deliver whole (statements or sitelinks on a major item) it names the sibling tool that can narrow it. 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, and whenever an entity's statements are large — its properties parameter selects individual P-IDs, granularity fields does not carry.

    Annotations the server declares

    • readOnlyHint: true
    • openWorldHint: true
  • wikidata_get_labelsResolve one or more QIDs or PIDs to their human-readable labels and descriptions.No findings

    Why it is in this group

    • The name "wikidata_get_labels" says "get": a word for reading.
    Description, as the server wrote it
    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.

    Annotations the server declares

    • readOnlyHint: true
    • openWorldHint: true
  • wikidata_get_statementsFetch property claims for a Wikidata entity with qualifier and reference detail.No findings

    Why it is in this group

    • The name "wikidata_get_statements" says "get": a word for reading.
    Description, as the server wrote it
    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 returns every statement, and a well-connected item (a country, a major city) carries hundreds of properties: more than fits inline. A set over 24,000 bytes before labels comes back as kind: "outline" — every available P-ID with its byte size, largest first — instead of the statements; re-call with the same id plus properties:[...] naming P-IDs whose sizes sum to 24,000 or less (the retrieval_notice names one such set). Labels are added after that check, so a returned set can run past 24,000 bytes by their size, and a property requested alone is always returned whole — on a major item one property can run to hundreds of kilobytes. Designed for fact verification: "what does Wikidata say about this entity's {property}?". Preferred-rank statements are the most current values.

    Annotations the server declares

    • readOnlyHint: true
    • idempotentHint: true
    • openWorldHint: true
  • wikidata_resolve_external_idLook up a Wikidata entity by an external identifier such as a DOI, PubMed ID, ORCID iD, or OpenAlex ID.No findings

    Why it is in this group

    • The name "wikidata_resolve_external_id" says "resolve": a word for reading.
    Description, as the server wrote it
    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). The property must be one whose Wikidata data type is external-id — item-valued or media properties (e.g. P31 instance-of, P18 image) are rejected rather than returning an empty match. Known value normalization is applied automatically: surrounding whitespace is trimmed, identifier-resolver URL prefixes are stripped (https://doi.org/, https://pubmed.ncbi.nlm.nih.gov/, https://orcid.org/), DOIs are uppercased, PMID prefixes stripped, ORCID hyphens normalized.

    Annotations the server declares

    • readOnlyHint: true
    • openWorldHint: true
  • wikidata_search_entitiesSearch Wikidata for items or properties by text query.No findings

    Why it is in this group

    • The name "wikidata_search_entities" says "search": a word for reading.
    Description, as the server wrote it
    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.

    Annotations the server declares

    • readOnlyHint: true
    • openWorldHint: true

This is not a safety rating, and no finding is not a safety guarantee. The groups and findings come from fixed checks of the tool definitions the server returned on the date shown, not from its code or what it does when called. How the checks work.

Install

Pinned to version 0.2.0. Values in angle brackets are yours to fill in.

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

Run in a terminal.

Claude Code permissions

Allow the reads, ask before a change, deny the deletes. Paste into .claude/settings.json.

.claude/settings.json
{
  "permissions": {
    "allow": [
      "mcp__wikidata__wikidata_search_entities",
      "mcp__wikidata__wikidata_get_entity",
      "mcp__wikidata__wikidata_get_labels",
      "mcp__wikidata__wikidata_get_statements",
      "mcp__wikidata__wikidata_get_sitelinks",
      "mcp__wikidata__wikidata_resolve_external_id"
    ],
    "ask": [
      "mcp__wikidata__wikidata_sparql_query"
    ],
    "deny": []
  }
}

Tools that only read are allowed, tools that change things ask first, tools that delete or cancel are denied. It assumes the server is installed as wikidata. Review it before you use it.