Wikidata API and MCP server for AI agents
Let Claude, ChatGPT or your own agent read Wikidata. No Wikidata API key needed.
Add to your agent
Paste this into Claude Code, Cursor, Codex or any agent. It adds the server itself.
Read https://bowmark.ai/sites/wikidata.md and add Bowmark's Wikidata MCP server to my agent.Run this in a terminal, then sign in when the browser opens. Claude Code keeps its own sign-in (a claude.ai sign-in does not carry over), so add only this one server. Adding the Bowmark plugin as well lists every tool twice.
claude mcp add --transport http bowmark-wikidata https://api.bowmark.ai/mcp/site/wikidataPress the button, or add this to ~/.cursor/mcp.json.
{
"mcpServers": {
"bowmark-wikidata": {
"url": "https://api.bowmark.ai/mcp/site/wikidata"
}
}
}Press the button, or run this in a terminal.
code --add-mcp '{"name":"bowmark-wikidata","type":"http","url":"https://api.bowmark.ai/mcp/site/wikidata"}'Run this in a terminal.
codex mcp add bowmark-wikidata --url https://api.bowmark.ai/mcp/site/wikidataIn Claude, open Plugins → Add → Add custom connector, paste this URL, and pick Sign in now.
https://api.bowmark.ai/mcp/site/wikidataIn ChatGPT, open Plugins, press +, choose Add custom MCP server and paste this URL.
https://api.bowmark.ai/mcp/site/wikidataAny MCP client that takes a remote (streamable HTTP) server: give it this URL.
https://api.bowmark.ai/mcp/site/wikidataFunctions
Open a function to see its parameters and run it with your own API key.
getEntityReads one Wikidata entity (Q item or P property) via wbgetentities: label, description, aliases, simplified claims keyed by property id, and…POST /v1/sites/wikidata/getEntity
Parameters
Default "en".
curl -X POST https://api.bowmark.ai/v1/sites/wikidata/getEntity \ -H "Authorization: Bearer $BOWMARK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"args":{"id":"Q42"}}'import { bowmark } from "@bowmark/web"; const result = await bowmark.providers.wikidata.getEntity({ id: "Q42" });import asyncio from bowmark_web import bowmark result = asyncio.run(bowmark.providers.wikidata.getEntity({"id": "Q42"}))Responsereturns WikidataEntity | nullinterface WikidataClaimValue { value: string; // entity id for item/property values, else the literal type: string; // "entity", "string", "time", "quantity" … } interface WikidataEntity { id: string; label: string | null; description: string | null; aliases: string[]; claims: Record<string, WikidataClaimValue[]>; // by property id, e.g. P31 sitelinks: Record<string, string>; // site key → page title url: string; }searchFinds Wikidata items or properties by name via wbsearchentities: id, label, description and URL per hit.POST /v1/sites/wikidata/search
Parameters
Default "en".
Default "item".
1-50, default 10.
curl -X POST https://api.bowmark.ai/v1/sites/wikidata/search \ -H "Authorization: Bearer $BOWMARK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"args":{"query":"Douglas Adams","limit":3}}'import { bowmark } from "@bowmark/web"; const result = await bowmark.providers.wikidata.search({ query: "Douglas Adams", limit: 3 });import asyncio from bowmark_web import bowmark result = asyncio.run(bowmark.providers.wikidata.search({"query": "Douglas Adams", "limit": 3}))Responsereturns WikidataSearchPageinterface WikidataSearchHit { id: string; label: string | null; description: string | null; url: string; // the entity's wikidata.org page matchedText: string | null; } interface WikidataSearchPage { results: WikidataSearchHit[]; total: number | null; // the number of matches when Wikidata sent no continuation (then these rows are all of them); null when more exist, because wbsearchentities reports no total page: number; pageCount: number | null; returned: number; // results.length warnings: string[]; // empty when the rows are the whole answer; otherwise says the rows may be partial }sparqlRuns a SPARQL query against the public Wikidata Query Service and returns the variables and rows of plain string values.POST /v1/sites/wikidata/sparql
Parameters
A SPARQL SELECT/ASK query.
curl -X POST https://api.bowmark.ai/v1/sites/wikidata/sparql \ -H "Authorization: Bearer $BOWMARK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"args":{"query":"SELECT ?c WHERE { ?c wdt:P31 wd:Q6256 } LIMIT 2"}}'import { bowmark } from "@bowmark/web"; const result = await bowmark.providers.wikidata.sparql({ query: "SELECT ?c WHERE { ?c wdt:P31 wd:Q6256 } LIMIT 2" });import asyncio from bowmark_web import bowmark result = asyncio.run(bowmark.providers.wikidata.sparql({"query": "SELECT ?c WHERE { ?c wdt:P31 wd:Q6256 } LIMIT 2"}))Responsereturns WikidataSparqlResultinterface WikidataSparqlResult { variables: string[]; rows: Record<string, string | null>[]; }