Web Algebra — Claude Code MCP server: RDF workflows and setup
Web Algebra lets an agent compose RDF and SPARQL operations into JSON plans. Use it to query or update Linked Data and build workflows for LinkedDataHub.
claude mcp add --env CERT_PEM_PATH=<CERT_PEM_PATH> --env CERT_PASSWORD=<CERT_PASSWORD> --env OPENAI_API_KEY=<OPENAI_API_KEY> --transport stdio web-algebra -- uvx web-algebraWhat Web Algebra does
The server exposes operations for reading and writing Linked Data, querying SPARQL, and handling URIs. An agent can combine several operations in a JSON plan and run them as one workflow. LinkedDataHub-specific operations include creating resources and views.
You need uv to run the server. OPENAI_API_KEY is required for SPARQLString, which asks a model to write a query; LinkedDataHub operations require the owner certificate and its password. Those credentials are only relevant when using LinkedDataHub.
What it helps with
- turn a natural-language request into a SPARQL query
- read or modify RDF Linked Data
- combine multiple data operations in one JSON plan
- create a resource or view in LinkedDataHub
Example prompts for the agent
- Find some UK cities in Linked Data and return a random selection.
- Write a SPARQL query that retrieves the classes and properties in this schema.
- Create a container in LinkedDataHub and add an item to it.
How to install Web Algebra
Platform CLI
claude mcp add --env CERT_PEM_PATH=<CERT_PEM_PATH> --env CERT_PASSWORD=<CERT_PASSWORD> --env OPENAI_API_KEY=<OPENAI_API_KEY> --transport stdio web-algebra -- uvx web-algebraReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from web-algebra <command>
Platform CLI
codex mcp add web-algebra --env CERT_PEM_PATH=<CERT_PEM_PATH> --env CERT_PASSWORD=<CERT_PASSWORD> --env OPENAI_API_KEY=<OPENAI_API_KEY> -- uvx web-algebraReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from web-algebra <command>
Config file
{
"mcpServers": {
"web-algebra": {
"command": "uvx",
"args": [
"web-algebra"
],
"env": {
"CERT_PEM_PATH": "<CERT_PEM_PATH>",
"CERT_PASSWORD": "<CERT_PASSWORD>",
"OPENAI_API_KEY": "<OPENAI_API_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from web-algebra <command>
Config file
{
"servers": {
"web-algebra": {
"type": "stdio",
"command": "uvx",
"args": [
"web-algebra"
],
"env": {
"CERT_PEM_PATH": "<CERT_PEM_PATH>",
"CERT_PASSWORD": "<CERT_PASSWORD>",
"OPENAI_API_KEY": "<OPENAI_API_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from web-algebra <command>
Platform CLI
gemini mcp add -e CERT_PEM_PATH=<CERT_PEM_PATH> -e CERT_PASSWORD=<CERT_PASSWORD> -e OPENAI_API_KEY=<OPENAI_API_KEY> web-algebra uvx web-algebraReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from web-algebra <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Web Algebra
How do I install Web Algebra in Claude Code?
Run claude mcp add web-algebra -e CERT_PASSWORD=<CERT_PASSWORD> -e OPENAI_API_KEY=<OPENAI_API_KEY> -- uvx web-algebra. Alternatively, run `claude mcp add --env CERT_PEM_PATH=<CERT_PEM_PATH> --env CERT_PASSWORD=<CERT_PASSWORD> --env OPENAI_API_KEY=<OPENAI_API_KEY> --transport stdio web-algebra -- uvx web-algebra`.
What does Web Algebra do?
It gives an agent operations for RDF Linked Data and SPARQL. The agent can combine operations into a JSON plan and execute the workflow.
Does Web Algebra need an OpenAI API key?
The key is needed for SPARQLString, which uses a model to compose a query. LinkedDataHub operations need the owner certificate and its password.