Wikidata MCP Server
The Wikidata MCP Server enables interaction with Wikidata using the Model Context Protocol (MCP). With this server, you can:
Search for Wikidata entity IDs by querying entity names
Search for Wikidata property IDs by querying property names
Retrieve properties associated with a specific Wikidata entity ID
Execute SPARQL queries on Wikidata to fetch structured data
Extract metadata (label and description) for a given Wikidata entity ID in a specified language
Provides access to the project repository for installation via git clone from GitHub.
Enables integration with LangChain through langchain-mcp-adapters, allowing AI agents to interact with Wikidata's knowledge graph through the Model Context Protocol.
Provides tools for interacting with Wikidata, including searching for entity and property identifiers, retrieving entity metadata (labels and descriptions), accessing entity properties, and executing SPARQL queries against the Wikidata knowledge base.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Wikidata MCP Serversearch for the entity ID of Albert Einstein"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Wikidata MCP Server
A server implementation for Wikidata API using the Model Context Protocol (MCP). This project provides tools to interact with Wikidata, such as searching identifiers (entity and property), extracting metadata (label and description) and executing sparql query.
Installation
Installing via Smithery
To install Wikidata MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @zzaebok/mcp-wikidata --client claudeInstalling Manually
Install uv if it is not installed yet.
$ curl -LsSf https://astral.sh/uv/install.sh | shThen, install dependencies.
$ git clone https://github.com/zzaebok/mcp-wikidata.git
$ cd mcp-wikidata
$ uv sync
# if you want to run client example together
$ uv sync --extra exampleRun
Run the server with:
$ uv run src/server.pyIf you want to test it with a simple client code (with langchain-mcp-adapters), run the client with:
# in another shell
$ uv run src/client.pyThe LLM extracts valid entity and property identifiers, executes a sparql query, and finally recommend a movie directed by Bong Joon-ho.
{
"messages": [
HumanMessage(
content="Can you recommend me a movie directed by Bong Joonho?",
),
AIMessage(
tool_calls=[
{
"name": "search_entity",
"args": {"query": "Bong Joon-ho"},
}
],
),
ToolMessage(
content="Q495980",
name="search_entity",
),
AIMessage(
tool_calls=[
{
"name": "get_properties",
"args": {"entity_id": "Q495980"},
}
],
),
ToolMessage(
content='["P345", "P244", "P214", "P227", ...]',
name="get_properties",
),
AIMessage(
tool_calls=[
{
"name": "search_property",
"args": {"query": "director"},
}
],
),
ToolMessage(
content="P57",
name="search_property",
),
AIMessage(
tool_calls=[
{
"name": "execute_sparql",
"args": {
"sparql_query": 'SELECT ?film ?filmLabel WHERE {\n ?film wdt:P57 wd:Q495980.\n SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }\n} LIMIT 1'
},
}
],
),
ToolMessage(
content='[{"film": {"type": "uri", "value": "http://www.wikidata.org/entity/Q483761"}, "filmLabel": {"xml:lang": "en", "type": "literal", "value": "Mother"}}]',
name="execute_sparql",
),
AIMessage(
content='I recommend the movie "Mother," which was directed by Bong Joon-ho.',
),
]
}Wikidata MCP Tools
The following tools are implemented in the server:
Tool | Description |
| Search for a Wikidata entity ID by its query. |
| Search for a Wikidata property ID by its query. |
| Get the properties associated with a given Wikidata entity ID. |
| Execute a SPARQL query on Wikidata. |
| Retrieve the English label and description for a given Wikidata entity ID. |
License
MIT License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol server that retrieves information from Wikipedia to provide context to LLMs, allowing users to search articles, get summaries, full content, sections, and links from Wikipedia.Last updated22276MIT
- Alicense-qualityDmaintenanceA server that implements the Model Context Protocol, providing a standardized way to connect AI models to different data sources and tools.Last updated1711MIT
- AlicenseBqualityDmaintenanceProvides access to Wikidata for Large Language Models through the Model Context Protocol, offering tools for entity search, detailed retrieval, SPARQL queries, relation exploration, and property-based searches.Last updated54MIT
- Flicense-qualityDmaintenanceA production-ready server that provides Wikipedia search and content retrieval tools through the Model Context Protocol, enabling AI assistants to search for articles, list sections, and retrieve specific content.Last updated
Related MCP Connectors
Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers.
A Model Context Protocol server for Wix AI tools
Wikidata MCP — wraps Wikidata API (wikidata.org/w/api.php)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zzaebok/mcp-wikidata'
If you have feedback or need assistance with the MCP directory API, please join our Discord server