home / mcp / wikidata mcp server
MCP server for interacting with Wikidata
Configuration
View docs{
"mcpServers": {
"joelgombin-mcp-wikidata": {
"command": "/path/to/your/mcp-wikidata/run_mcp_wikidata.sh",
"args": [],
"env": {
"PATH": "/usr/local/bin:/usr/bin:/bin:~/.local/bin",
"WIKIDATA_TIMEOUT": "30",
"WIKIDATA_CACHE_TTL": "3600",
"WIKIDATA_RATE_LIMIT": "60",
"WIKIDATA_USER_AGENT": "MCP-Wikidata/0.1.0",
"WIKIDATA_MAX_RESULTS": "50",
"WIKIDATA_DEFAULT_LANGUAGE": "en"
}
}
}
}You run an MCP server that provides access to Wikidata data for Large Language Models. It exposes a set of practical tools you can call to search, retrieve, and query Wikidata entities, with multilingual support and intelligent caching to speed up repeated requests.
You interact with the Wikidata MCP server using an MCP client. The server offers five tools to work with Wikidata data: search_entities to find entities by text, get_entity to fetch details by ID, sparql_query to run customized SPARQL queries, get_relations to explore entity relationships, and find_by_property to search by a property value. You can use these tools to build rich prompts, verify facts, or gather supporting information from Wikidata for your language model workflows.
In practice you will start the MCP server locally or remotely, then call its tools from your client. You can perform simple lookups like finding entities by a name, retrieving detailed information for a specific item, or executing more advanced queries to assemble datasets for evaluation or training.
If you need to inspect or test the available endpoints, you can verify responses from the server using the recommended test procedures, then integrate the results into your larger data pipeline.
Prerequisites you need before installing include Python 3.10 or newer and the uv package manager for Python.
Step 1 — Clone the project and move into its directory.
git clone https://github.com/joelgombin/mcp-wikidata.git
cd mcp-wikidataStep 2 — Install dependencies using uv.
uv syncStep 3 — Run a quick connection test to verify the installation.
uv run python test_connection.pyConfiguration and runtime details are provided to tailor the server for your environment. You can run the MCP server directly or via a wrapper script, and you can also configure an alternative runtime method using uv directly.
Environment and runtime variables help control request behavior, timeouts, caching, and language defaults. You can place these in a .env file and reference them at startup to ensure consistent behavior across runs.
If you encounter issues in Claude Desktop, you may need to review the installed runtime (uv), test the wrapper script, verify permissions, and restart Claude Desktop after configuration changes.
Troubleshooting covers common problems like server disconnections and missing command paths. Detailed diagnostic logs can be found in the MCP Inspector, Claude Desktop logs, and the server’s error output.
Search Wikidata entities by text, returning matching items with optional language and type constraints.
Retrieve detailed information for a Wikidata entity by its ID, with language localization and simplified output options.
Execute custom SPARQL queries against the Wikibase SPARQL endpoint and return structured results.
Explore incoming and outgoing relations for a given entity, with limit and direction controls.
Search entities by a specified property-value pair to locate items matching the criteria.