Wikidata SPARQL

Wikidata SPARQL

MCP server exposing Wikidata via SPARQL with SSE/HTTP transport on Cloudflare Workers.

0
Stars
0
Forks
0
Releases

Overview

The Wikidata SPARQL MCP Server is a Model Context Protocol (MCP) server that provides access to the Wikidata knowledge graph through SPARQL queries. It runs on Cloudflare Workers and supports both Server-Sent Events (SSE) and standard HTTP transport for remote MCP deployments. A single sparql_query tool handles both introspection and data queries, with support for multiple output formats including JSON, XML, Turtle, and CSV. The server offers configurable query timeouts (1-60 seconds) to prevent runaway queries and includes error handling for SPARQL validation, network resilience, and output format validation. The architecture uses Cloudflare Workers with Durable Objects, the MCP SDK, and Cloudflare Agents, enabling direct integration with Wikidata's SPARQL endpoint and global accessibility. The repository provides extensive usage examples, including introspection queries (DESCRIBE, label-enabled SELECT), data queries (e.g., famous scientists and programming languages with creators), and boolean checks (ASK). Client configuration examples show how Claude Desktop, Cloudflare AI Playground, and generic MCP clients can connect via SSE or HTTP endpoints. The project emphasizes remote deployment, global availability, and a unified tool for querying Wikidata via MCP.

Details

Owner
QuentinCody
Language
TypeScript
License
Updated
2025-12-07

Features

Single Unified Tool

One powerful sparql_query tool that handles both introspection and data queries.

Comprehensive SPARQL Support

Execute any SPARQL query against Wikidata's knowledge graph.

Multiple Output Formats

JSON, XML, Turtle, and CSV result formats.

Timeout Protection

Configurable query timeouts (1-60 seconds) to prevent runaway queries.

Remote Deployment

Deployed on Cloudflare Workers for global accessibility.

Dual Transport Support

Both SSE and HTTP endpoints for maximum compatibility.

Audience

ResearchersUse for SPARQL introspection and data queries on Wikidata for knowledge discovery and data analysis.
MCP developersBuild MCP-based clients accessing Wikidata via SSE/HTTP transports for introspection and data queries.
Data engineersIntegrate SPARQL results into data pipelines and analytics dashboards for insights.

Tags

WikidataSPARQLMCPCloudflare WorkersSSEHTTPKnowledge GraphSPARQL QueriesJSONXMLTurtleCSVTimeoutsRemote Deployment