AIクライアントがRDF Linked Dataの読み込み、クエリ、書き込みを行い、SPARQL操作を構成済みのJSONプランとして実行できるようにします。
別名 AtomGraph/Web-Algebra, web-algebra
- スター
- 49
- ツール
- —
- ダウンロード数(30日間)
- —
- 最新バージョン
- 2.0.4
- 最終コミット
- 2026年11月3日
- ライセンス
- Apache-2.0
Web-Algebra MCPとは
Web-AlgebraはMCPサーバーです。 AIクライアントがRDF Linked Dataの読み込み、クエリ、書き込みを行い、SPARQL操作を構成済みのJSONプランとして実行できるようにします。.
プロジェクトのREADMEから生成された概要
Web-Algebra MCP server について
Web Algebraは、セマンティックウェブ技術を扱う開発者が、自然言語を通じてRDF Linked Dataの管理やSPARQLクエリの実行を行えるようにします。このシステムにより、AIエージェントは人間の指示を最適化されたJSONバイトコードに変換し、一連の個別のツール呼び出しではなく、複雑なワークフローをアトミックに実行できます。Linked Dataに対するGET、POST、PUT、およびSPARQL管理のためのSELECT、CONSTRUCT、DESCRIBEを含む幅広い操作をサポートしています。
ユーザーは、stdioまたはstreamable HTTPトランスポートを使用して、このサーバーをClaude DesktopなどのAIクライアントに接続できます。多くの操作は単独で動作しますが、LinkedDataHubとの統合には環境変数経由で提供されるクライアント証明書とパスワードが必要です。エージェントがSPARQLStringツールを使用して特定のSPARQLクエリを生成する必要がある場合は、OpenAI APIキーを設定する必要があります。このシステムは、単純なURI操作や文字列操作から、セマンティックデータセット内でのForEachループやフィルタリングのような複雑な制御フローまで、あらゆる処理を扱うように設計されています。
できること
- 1SPARQLクエリの自動生成AIエージェントに対し、自然言語を使用して特定のSPARQLクエリを記述および実行するよう指示します。
- 2セマンティックデータのバッチ処理エージェントに対し、一連の結果を反復処理し、各アイテムに対して操作を実行するよう指示します。
- 3LinkedDataHubのリソース管理AIに対し、LinkedDataHubインスタンス内で新しいアイテム、コンテナ、またはビューを作成するよう指示します。
- 4複雑なワークフローのコンパイルAIエージェントに、多段階のセマンティックワークフローを単一の実行可能なJSONプランへとコンパイルさせます。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
Web-Algebra MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude CodeにWeb-Algebra MCPをインストール
$ claude mcp add --env 'CERT_PASSWORD=<YOUR_CERT_PASSWORD>' --env 'OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>' web-algebra -- uvx web-algebraCursorにWeb-Algebra MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"web-algebra": {
"command": "uvx",
"args": [
"web-algebra"
],
"env": {
"CERT_PASSWORD": "<YOUR_CERT_PASSWORD>",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}VS CodeにWeb-Algebra MCPをインストール
.vscode/mcp.json
{
"servers": {
"web-algebra": {
"type": "stdio",
"command": "uvx",
"args": [
"web-algebra"
],
"env": {
"CERT_PASSWORD": "<YOUR_CERT_PASSWORD>",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}VS Code CLIにWeb-Algebra MCPをインストール
$ code --add-mcp '{"name":"web-algebra","type":"stdio","command":"uvx","args":["web-algebra"],"env":{"CERT_PASSWORD":"<YOUR_CERT_PASSWORD>","OPENAI_API_KEY":"<YOUR_OPENAI_API_KEY>"}}'Claude DesktopにWeb-Algebra MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"web-algebra": {
"command": "uvx",
"args": [
"web-algebra"
],
"env": {
"CERT_PASSWORD": "<YOUR_CERT_PASSWORD>",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}CodexにWeb-Algebra MCPをインストール
$ codex mcp add web-algebra --env 'CERT_PASSWORD=<YOUR_CERT_PASSWORD>' --env 'OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>' -- uvx web-algebraCodex config.tomlにWeb-Algebra MCPをインストール
~/.codex/config.toml
[mcp_servers.web-algebra] command = "uvx" args = ["web-algebra"] [mcp_servers.web-algebra.env] CERT_PASSWORD = "<YOUR_CERT_PASSWORD>" OPENAI_API_KEY = "<YOUR_OPENAI_API_KEY>"
Gemini CLIにWeb-Algebra MCPをインストール
$ gemini mcp add -s user -e 'CERT_PASSWORD=<YOUR_CERT_PASSWORD>' -e 'OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>' web-algebra uvx -- web-algebraGemini settings.jsonにWeb-Algebra MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"web-algebra": {
"command": "uvx",
"args": [
"web-algebra"
],
"env": {
"CERT_PASSWORD": "<YOUR_CERT_PASSWORD>",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}設定
CERT_PASSWORDシークレットPassword of the client certificate
OPENAI_API_KEYシークレットOpenAI API key, used by SPARQLString to write queries
CERT_PASSWORDCERT_PEM_PATHCERT_PEM_PATHPath to the LinkedDataHub client certificate (PEM), for authenticated requests
| 名前 | 説明 | 種類 |
|---|---|---|
| CERT_PASSWORD | Password of the client certificate | シークレット |
| OPENAI_API_KEY | OpenAI API key, used by SPARQLString to write queries | シークレット |
| CERT_PASSWORD | — | |
| CERT_PEM_PATH | — | |
| CERT_PEM_PATH | Path to the LinkedDataHub client certificate (PEM), for authenticated requests |
自動チェック
実行日 2026年11月13日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能atomgraph/web-algebra is public and reachablegithub.com/atomgraph/web-algebra ↗合格
- パッケージがこのリポジトリをソースとして指定web-algebra names atomgraph/web-algebra as sourcepypi.org/project/web-algebra/ ↗合格
- ビルドの来歴 (Sigstore 証明)Sigstore attestation for web-algebrapypi.org/project/web-algebra/ ↗合格
- オープンソースライセンス (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-11-03github.com/atomgraph/web-algebra ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していないNo popular package one edit away from web-algebra合格
- パッケージおよびその依存関係に重大な勧告なし38 resolved dependencies checked; no critical advisoryosv.dev ↗合格
- モデルへの隠れた指示がない0 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされている未チェック
- リモートエンドポイントが MCP ハンドシェイクに応答未チェック
README
GitHubで見るWeb-Algebra
A composable RDF operations system that translates natural language instructions into JSON-formatted domain-specific language operations for loading, querying, and writing RDF Linked Data.
Overview
This system implements generic operations for RDF Linked Data and SPARQL management, as well as some LinkedDataHub-specific operations. Operations can be consumed in two ways:
- Executable JSON format: Operations are composed into JSON structures and executed by the provided execution engine
- Model Context Protocol (MCP): Operations are exposed as tools for AI agents to use interactively
Instead of agents executing semantic workflows step-by-step through individual MCP tool calls, Web-Algebra enables agents to compile entire workflows into optimized JSON "bytecode" that executes atomically - enabling complex multi-operation compositions.
Demo
See WebAlgebra in action - translating natural language into RDF operations.
Architecture
The system is built around the Operation abstract base class that provides:
- Registry System: Auto-discovery of operations from
src/web_algebra/operations/ - JSON DSL: Operations use
@opkey withargsfor parameters, supporting nested operation calls - RDFLib Type System: Uses
URIRef,Literal,Graph, andResulttypes internally for proper RDF handling - Execution Engine: Both standalone execution and MCP server integration
- Context System: ForEach operations set row context for inner operations to access via
Value - URI Resolution: Proper semantic URI construction with
ResolveURIoperation
Key Components
- System Prompt: Complete operation definitions and JSON format specification
- Formal Semantics: Complete type system and operation catalog
- Operation Interface: Base class and JSON interpreter
- Operation Implementations: Directory containing all available operations
- Examples: Real-world plans over live Linked Data, each with its result and checks
Operations
The operations cover read-write Linked Data, SPARQL queries, URI manipulation, and LinkedDataHub-specific resource creation. Non-exhaustive list:
- Linked Data
GETPATCHPOSTPUT
- SPARQL
CONSTRUCTDESCRIBESELECTSubstituteValuesSPARQLString
- Schema
ExtractClassesExtractDatatypePropertiesExtractObjectPropertiesExtractOntology
- Reconciliation
Reconcile
- URI & String Operations
ResolveURIEncodeForURIConcatReplaceStrStrUUIDURI
- Date/Time
Now
- Control Flow & Variables
ValueVariableForEachIterateFilterBindingsCurrentPositionLastMerge
- LinkedDataHub-specific
ldh-CreateContainerldh-CreateItemldh-Listldh-AddFileldh-AddGenericServiceldh-AddResultSetChartldh-AddSelectldh-AddConstructldh-AddViewldh-AddObjectBlockldh-AddXHTMLBlockldh-RemoveBlockldh-GeneratePortalldh-GenerateClassContainersldh-GenerateOntologyViews
Usage
Pre-requisites
- Install uv
-
uv venv uv sync
Standalone
Natural language instruction
uv run python src/web_algebra/main.py
Then enter instruction, for example:
Select random 10 UK cities from DBpedia
See the instructions of the examples.
Currently requires OpenAI API access. OPENAI_API_KEY env value has to be set.
Execute JSON
uv run web-algebra --from-json ./examples/city-profiles/plan.json
See the examples: each has the instruction it answers, its plan, the result of a run, and checks.
With LinkedDataHub
- Run LinkedDataHub v6
- Give
web-algebrayour LDH's owner certificate and its password in theCERT_PEM_PATHandCERT_PASSWORDenvironment variables (or the--cert_pem_pathand--cert_passwordoptions, which override them). For example:
export CERT_PEM_PATH=../LinkedDataHub/ssl/owner/cert.pem
export CERT_PASSWORD="$(cat ../LinkedDataHub/secrets/owner_cert_password.txt)"
uv run web-algebra --from-json ./examples/northwind-category-catalogue/plan.json
Here and throughout this guide, the client certificate and its password are only required for authentication with LinkedDataHub. You don't need them if you're not using LinkedDataHub with Web Algebra.
As MCP server
Install
Requires uv. Add this to your MCP client configuration (e.g. claude_desktop_config.json):
{
"mcpServers": {
"web-algebra": {
"command": "uvx",
"args": ["--from", "web-algebra", "web-algebra-mcp"],
"env": {
"CERT_PEM_PATH": "/path/to/LinkedDataHub/ssl/owner/cert.pem",
"CERT_PASSWORD": "********"
}
}
}
}
or with Claude Code:
claude mcp add web-algebra -e CERT_PEM_PATH=/path/to/LinkedDataHub/ssl/owner/cert.pem -e CERT_PASSWORD=******** -- uvx --from web-algebra web-algebra-mcp
uvx web-algebra mcp runs the same server.
Environment variables:
| Name | Required | Description |
|---|---|---|
CERT_PEM_PATH |
No | Path to the LinkedDataHub owner certificate (PEM). Only needed for LinkedDataHub operations. |
CERT_PASSWORD |
No | Password for the certificate above. |
OPENAI_API_KEY |
No | OpenAI API key. Only needed for the SPARQLString tool, which asks a model to write the query. |
stdio transport
uv run web-algebra-mcp
Streamable HTTP transport
uv run uvicorn web_algebra.server:app --reload
with CERT_PEM_PATH and CERT_PASSWORD set, as above, for LinkedDataHub.
MCP Inspector config
You can the inspector like this:
npx @modelcontextprotocol/inspector
and then open on the URL printed in its console output, for example:
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=b31e4b3d852b5a2445f45032c484e54e319bf16359585858cf88fe9a90816744
The MCP_PROXY_AUTH_TOKEN is required. If the link does not appear, you need to copy the session token from the console and paste it into inspector's Proxy Session Token config.
Web Algebra's settings:
Claude Desktop tool config from a local checkout
To run the MCP server from a local checkout instead of the published package, add a Web Algebra entry (that uses stdio transport) to the mcpServer configuration your claude_desktop_config.json file:
{
"mcpServers": {
"Web Algebra": {
"command": "uv",
"args": [
"--directory",
"/path/to/Web-Algebra",
"run",
"web-algebra-mcp"
],
"env": {
"CERT_PEM_PATH": "/path/to/LinkedDataHub/ssl/owner/cert.pem",
"CERT_PASSWORD": "********"
}
}
}
}
Leave the command as it is. Those uv run --with arguments are important, otherwise 3rd party packages cannot be found.
On my Mac, the path to uv has to be absolute, otherwise it doesn't work in Claude Desktop 🤷♂️.
CERT_PEM_PATH and CERT_PASSWORD env values are optional.
Web-Algebra MCPのよくある質問
Web-Algebra MCPをClaude Codeに追加するには
ターミナルでclaude mcp add --env 'CERT_PASSWORD=<YOUR_CERT_PASSWORD>' --env 'OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>' web-algebra -- uvx web-algebraを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
Web-Algebra MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
Web-Algebra MCP serverはどのような操作を提供しますか?
読み書き可能なLinked Data操作(GET、PATCH、POST、PUT)、SPARQL操作(SELECT、CONSTRUCT、DESCRIBE)、スキーマ抽出、URI操作、制御フロー、およびLinkedDataHub特有のリソース作成ツールを提供します。
Web-Algebra MCP serverをインストールするにはどうすればよいですか?
uvxコマンドを使用してMCPクライアントの設定に追加してください。LinkedDataHubの操作を行う場合は、オプションでCERT_PEM_PATHとCERT_PASSWORDを設定できます。
Web-Algebraには認証が必要ですか?
LinkedDataHubの操作にはLinkedDataHubのオーナー証明書とパスワードが必要であり、SPARQLStringツールを使用する場合はOpenAI APIキーが必要ですが、それ以外の場合は設定は任意です。
Web-Algebraで定義済みのJSONプランを実行できますか?
はい、コマンドラインからJSONプランファイルを直接実行できます。
このMCP serverはどのトランスポートをサポートしていますか?
stdioおよびstreamable HTTPトランスポートをサポートしています。
