- Home
- MCP servers
- SPARQL
SPARQL
- rust
4
GitHub Stars
rust
Language
6 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.
This SPARQL MCP server helps you write SPARQL queries for open-access endpoints by indexing endpoint metadata and providing guided query construction. It exposes an MCP API to search for relevant data, retrieve endpoint information, and execute SPARQL queries, making it easier to build precise queries against SPARQL endpoints without deep prior knowledge of each endpoint’s schema.
How to use
Connect to the MCP server with your preferred MCP client and point it to the server URL. You can use the MCP endpoint to search for data to answer a user question, retrieve information about SPARQL endpoints, and execute the resulting SPARQL queries against those endpoints. The server is designed to work with an HTTP API path named /mcp for core MCP interactions and an optional /chat path for conducting conversations with an LLM to assist in query construction.
How to install
Prerequisites you need before starting setup:
- Rust toolchain (stable)
- Protobuf (for building)
- A client or environment to provide an API key for an LLM provider (e.g., Mistral.ai or OpenAI)
Step-by-step commands
- Install development tools and dependencies
rustup update
cargo install cargo-release cargo-deny cargo-watch git-cliff
2) Prepare API keys
Create a configuration file to export your API keys for development. You will provide values when you run the server.
[env]
MISTRAL_API_KEY = "YOUR_API_KEY"
OPENAI_API_KEY = "YOUR_API_KEY"
GROQ_API_KEY = "YOUR_API_KEY"
3) Start the development server
Run the MCP server in development mode and open the API docs to verify the server is up.
cargo run
4) Customize server configuration
You can customize the server configuration by providing a JSON list of endpoints when you start the server.
cargo run -- --force-index --mcp-only --db-path ./data/lancedb
5) Use a custom endpoints file
Provide a JSON file describing endpoints to be indexed, then start the server with that file.
cargo run -- ./sparql-mcp.json
Available tools
access_sparql_resources
Retrieve relevant information about the resources to help build a SPARQL query (examples, schema) for given endpoints.
get_resources_info
Retrieve information about the SPARQL endpoints themselves (descriptions, lists of available endpoints).
execute_sparql
Execute a SPARQL query against a specified endpoint and return results.