wikidata-mcp-server-216ddf — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited wikidata-mcp-server-216ddf (Plugin) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<div align="center"> <h1>@cyanheads/wikidata-mcp-server</h1> <p><b>Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers via MCP. STDIO or Streamable HTTP.</b> <div>7 Tools • 1 Resource • 1 Skill</div> </p> </div>
<div align="center">
</div>
<div align="center">
</div>
<div align="center">
Public Hosted Server: https://wikidata.caseyjhand.com/mcp
</div>
Wikidata's knowledge graph. Search and fetch entities, traverse the graph with SPARQL, and resolve external identifiers like DOI, PMID, ORCID, OpenAlex, and IMDb to their Wikidata items. No API key required.
| Tool | Description |
|---|---|
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.) |
| Resource | Description |
|---|---|
wikidata://entity/{id} | Compact markdown summary of a Wikidata entity — labels, English description, instance-of, Wikipedia link, image, and statement count |
All resource data is also reachable via tools.
The published wikidata-guide covers entity disambiguation, qualified statements, external identifiers, and SPARQL. It is included in plugin installs and served over MCP as skill://wikidata-guide/SKILL.md.
wikidata_search_entities <sub>tool</sub>type="item" for people, places, and works, type="property" for P-IDsen, de, pt-br; case-insensitive); offset pagination, up to 50 results per callwikidata_get_entity <sub>tool</sub>Q76) fetch items and P-IDs (e.g. P31) fetch properties; fields selects labels, descriptions, aliases, statements, or sitelinks, and narrows the upstream fetch (Q76 is 344,114 bytes whole, 6,703 for labels alone)languages filters multilingual maps to the given language codesretrieval_notice names a fields set that fits and points oversized statements or sitelinks to the tool that can narrow themwikidata_get_labels <sub>tool</sub>wbgetentities API, with one or more language codes per requestfound count and notFound IDs for partial resultswikidata_get_statements <sub>tool</sub>properties limits the fetch to specific P-IDs (omit for all); item QIDs and quantity units in values, qualifiers, and references are resolved to labels unless resolve_labels=falsesomevalue / novalueproperties whose sizes sum to 24,000 or less, as the retrieval_notice suggestswikidata_get_sitelinks <sub>tool</sub>enwiki) to article titles and URLs; sites filters to specific codeswikis_only=true keeps only Wikipedia links (drops Wiktionary, Wikiquote, Wikisource, etc.)wikidata_sparql_query <sub>tool</sub>wd:, wdt:, p:, ps:, pq:, wikibase:, bd:) and the wikibase:label SERVICE (when the query uses a ?<var>Label, ?<var>Description, or ?<var>AltLabel variable) are added automatically; language takes one code or a fallback list like fr,enreturnedCount, totalCount, and a notice to page with ORDER BY plus LIMIT/OFFSET or to aggregatetimeout is 1–55s (server hard limit 60s); rate limit is 60 requests/min and 5 concurrent requests per IPwikidata_resolve_external_id <sub>tool</sub>external-id; item-valued or media properties (e.g. P31, P18) are rejectedmatch=null when not found (the Query Service lags the live wiki, so null is not proof of absence) and multipleMatches when more than one entity claims the same ID; the label uses the requested language, falling back to mulwikidata://entity/{id} <sub>resource</sub>P31), enwiki Wikipedia link, image (P18), and statement counttext/markdown; for full entity data, use wikidata_get_entityid is a Q-ID or P-ID, the same identifiers the tools takeBuilt on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Wikidata-specific:
wbgetentities API for efficient batch label resolutionUser-Agent per Wikimedia policy (WIKIDATA_USER_AGENT)WIKIDATA_REST_TIMEOUT_MS, WIKIDATA_SPARQL_TIMEOUT_MS)Agent-friendly output:
wikidata_get_labels designed to follow SPARQL result sets — run the query, then humanize in one callwikidata_resolve_external_id returns multipleMatches instead of a false null when a Wikidata data-integrity issue puts duplicate claims on one external IDkind: "outline" payload — field/property sizes plus a retrieval_notice naming the exact re-call — instead of a truncated or oversized responseConnect to the hosted instance, no install:
claude mcp add --transport http wikidata-mcp-server https://wikidata.caseyjhand.com/mcpOr run it locally:
claude mcp add wikidata-mcp-server -- npx -y @cyanheads/wikidata-mcp-serverFor other clients, add this to the MCP config file:
{
"mcpServers": {
"wikidata-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/wikidata-mcp-server"]
}
}
}For Docker or a source build, see Running the server.
All configuration is validated at startup via Zod schemas. Key environment variables:
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT_TYPE | Transport: stdio or http | stdio |
MCP_HTTP_PORT | HTTP server port | 3010 |
MCP_HTTP_ENDPOINT_PATH | HTTP endpoint path where the MCP server is mounted | /mcp |
MCP_PUBLIC_URL | Public origin override for TLS-terminating reverse-proxy deployments | none |
MCP_AUTH_MODE | Authentication: none, jwt, or oauth | none |
MCP_SESSION_MODE | HTTP session mode: stateful, stateless, or auto | stateless |
MCP_LOG_LEVEL | Log level (debug, info, notice, warning, error) | info |
MCP_GC_PRESSURE_INTERVAL_MS | Opt-in forced-GC interval in ms (Bun only) | 0 (disabled) |
LOGS_DIR | Directory for log files (Node.js only) | <project-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1 | in-memory |
WIKIDATA_USER_AGENT | User-Agent string for Wikimedia requests (policy requires a descriptive value) | wikidata-mcp-server/0.1 (https://github.com/cyanheads/wikidata-mcp-server) |
WIKIDATA_SPARQL_TIMEOUT_MS | Max wait for a SPARQL response in ms | 55000 |
WIKIDATA_REST_TIMEOUT_MS | Max wait for REST API responses in ms | 10000 |
OTEL_ENABLED | Enable OpenTelemetry | false |
See .env.example for the full list of optional overrides.
Requires Bun v1.4.0 or higher (or Node.js ≥24.0.0).
git clone https://github.com/cyanheads/wikidata-mcp-server.git
cd wikidata-mcp-server
bun install
cp .env.example .env # One-time build
bun run rebuild
# Run the built server
bun run start:http
# or
bun run start:stdio bun run devcheck # Lints, formats, type-checks, and more
bun run test # Runs the test suitedocker run --rm -p 3010:3010 ghcr.io/cyanheads/wikidata-mcp-server:latestThe image defaults to HTTP transport, stateless session mode, and logs to /var/log/wikidata-mcp-server. For stdio client configuration, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/wikidata-mcp-server:latest"]. Build locally with docker build -t wikidata-mcp-server .; OpenTelemetry peers are installed by default (--build-arg OTEL_ENABLED=false omits them).
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point — registers tools and resources, inits services. |
src/mcp-server/tools | Tool definitions (*.tool.ts). Seven tools for entity lookup, statements, sitelinks, SPARQL, and external ID resolution. |
src/mcp-server/resources | Resource definitions. Entity summary resource. |
src/services/wikidata | Wikidata service layer — REST API client, SPARQL client, statement normalization, types. |
src/config | Server-specific environment variable parsing and validation with Zod. |
tests/ | Unit and integration tests, mirroring the src/ structure. |
skills/wikidata-guide/ | Published guide for entity resolution, statements, and SPARQL workflows. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for logging, ctx.state for storagecreateApp() arraysIssues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testApache-2.0 — see LICENSE for details.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.