- Home
- MCP servers
- Wikidata
Wikidata
- python
2
GitHub Stars
python
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You run a specialized MCP server that connects large language models to Wikidata’s structured knowledge base using Server-Sent Events. It optimizes query handling by using fast basic tools for simple lookups and switches to advanced orchestration for complex temporal or relational requests, delivering fast, verifiable results with graceful degradation if some features are unavailable.
How to use
Use a Model Context Protocol (MCP) client to connect to the Wikidata MCP Server and ask it questions about entities, properties, descriptions, and relationships. The server exposes a dedicated MCP endpoint for streaming responses and a health endpoint to verify availability. For basic queries, rely on fast tools to retrieve entities, properties, and metadata. For more complex temporal or relational questions, the server can engage advanced orchestration to provide precise results.
How to install
Prerequisites: Python 3.10+ and a virtual environment tool (venv, conda, etc.). You may also want a vector DB API key if you plan to enable enhanced semantic search in your environment.
# 1) Clone the repository
git clone https://github.com/yourusername/wikidata-mcp-mirror.git
cd wikidata-mcp-mirror
# 2) Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
# 3) Install the required dependencies
pip install -e .
# 4) Create a configuration file based on the example and customize it
cp .env.example .env
# Edit .env with your configuration
# 5) Run the server (development)
python -m wikidata_mcp.api
# 6) Run the server (production with Gunicorn)
gunicorn --bind 0.0.0.0:8000 --workers 4 --timeout 120 --keep-alive 5 --worker-class uvicorn.workers.UvicornWorker wikidata_mcp.api:app
Additional deployment and environment notes
The service can be deployed with containerization or on a cloud platform. If you enable vector-based semantic search, provide a Vector DB API key in your environment. You can expose health and metrics endpoints to monitor the server status.
# Example deployment variables (adjust to your environment)
PORT=8000
DEBUG=false
WIKIDATA_VECTORDB_API_KEY=YOUR_API_KEY
Available tools
search_wikidata_entity
Find entities by name with fast basic tool access, returning core identifiers and labels for quick lookups.
search_wikidata_property
Find properties by name to quickly retrieve property IDs and metadata.
get_wikidata_metadata
Fetch entity labels and descriptions to surface human-friendly context.
get_wikidata_properties
Retrieve all properties associated with a given entity for structured knowledge.
execute_wikidata_sparql
Run SPARQL queries directly against Wikidata for flexible data retrieval.
query_wikidata_complex
Handle temporal or relational queries that require advanced orchestration and context.
find_entity_facts
Search for an entity and collect associated factual statements.
get_related_entities
Identify entities related to a given target to expose contextual connections.