<https://docs.linkeddatahub.com/get-started/agents/>
        a       <https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Item>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
                <https://docs.linkeddatahub.com/get-started/agents/#content>;
        <http://purl.org/dc/terms/created>
                "2026-10-02T15:12:10.195Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        <http://purl.org/dc/terms/creator>
                <https://admin.linkeddatahub.com/acl/agents/5ba81960-d511-4a3b-8b9a-cb5bb278dd95/#this>;
        <http://purl.org/dc/terms/description>
                "Give an AI agent such as Claude Code or Cursor access to a LinkedDataHub instance over MCP, using Web-Algebra";
        <http://purl.org/dc/terms/modified>
                "2026-10-02T22:09:02.884Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        <http://purl.org/dc/terms/title>
                "Connect an agent";
        <http://rdfs.org/sioc/ns#has_container>
                <https://docs.linkeddatahub.com/get-started/>;
        <http://www.w3.org/ns/auth/acl#owner>
                <https://admin.linkeddatahub.com/acl/agents/5ba81960-d511-4a3b-8b9a-cb5bb278dd95/#this> .

<https://docs.linkeddatahub.com/get-started/agents/#content>
        a       <https://w3id.org/atomgraph/linkeddatahub#XHTML>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n    <p class=\"ldh-body-lg\">Give an AI agent such as Claude Code or Cursor access to a LinkedDataHub instance over MCP, using Web-Algebra</p>\n    <p>Agents use the same HTTP API as the browser and the <a href=\"../../reference/command-line-interface/\">CLI</a>. The bridge is\n        <a href=\"https://github.com/AtomGraph/Web-Algebra\" target=\"_blank\">Web-Algebra</a>, which exposes LinkedDataHub operations as\n        <a href=\"https://modelcontextprotocol.io/\" target=\"_blank\">Model Context Protocol</a> (MCP) tools: creating containers and items, adding views,\n        queries and charts, reading and writing RDF, and running SPARQL. An agent connected this way can build a working application in a dataspace —\n        its classes, containers, views and charts are documents like any other.</p>\n    <p>The conventions agents should follow when writing to LinkedDataHub are in\n        <a href=\"https://github.com/AtomGraph/LinkedDataHub/blob/master/AGENTS.md\" target=\"_blank\">AGENTS.md</a>.</p>\n    <div>\n        <h2 id=\"prerequisites\">Prerequisites</h2>\n        <ul>\n            <li>A running LinkedDataHub instance. The examples below assume the default <a href=\"../setup/\">local setup</a> at <samp>https://localhost:4443/</samp>.</li>\n            <li>The WebID certificate the agent will act as. For your own instance that is the owner certificate, <samp>ssl/owner/cert.pem</samp>, with the password from\n                <samp>secrets/owner_cert_password.txt</samp>. The agent can do whatever that WebID is authorized to do.</li>\n            <li><a href=\"https://docs.astral.sh/uv/getting-started/installation/\" target=\"_blank\">uv</a>, which runs Web-Algebra without a separate install step.</li>\n        </ul>\n    </div>\n    <div>\n        <h2 id=\"claude-code\">Claude Code</h2>\n        <p>Register Web-Algebra as an MCP server, run from the LinkedDataHub directory:</p>\n        <pre>claude mcp add web-algebra \\\n  --env CERT_PEM_PATH=\"$PWD/ssl/owner/cert.pem\" \\\n  --env CERT_PASSWORD=\"$(cat secrets/owner_cert_password.txt)\" \\\n  -- uv run --with web-algebra python -m web_algebra</pre>\n        <p>Start <samp>claude</samp> and check that <samp>/mcp</samp> lists <samp>web-algebra</samp> as connected.</p>\n    </div>\n    <div>\n        <h2 id=\"cursor-and-claude-desktop\">Cursor and Claude Desktop</h2>\n        <p>Both read an <samp>mcpServers</samp> entry: <samp>~/.cursor/mcp.json</samp> for Cursor, <samp>claude_desktop_config.json</samp> for Claude Desktop.\n            Use absolute paths and the literal password, since these files are not run by a shell.</p>\n        <pre>{\n  \"mcpServers\": {\n    \"web-algebra\": {\n      \"command\": \"uv\",\n      \"args\": [\"run\", \"--with\", \"web-algebra\", \"python\", \"-m\", \"web_algebra\"],\n      \"env\": {\n        \"CERT_PEM_PATH\": \"/path/to/LinkedDataHub/ssl/owner/cert.pem\",\n        \"CERT_PASSWORD\": \"your-owner-cert-password\"\n      }\n    }\n  }\n}</pre>\n        <p>If the client cannot find <samp>uv</samp>, replace <samp>\"uv\"</samp> with its absolute path, as printed by <samp>which uv</samp>.</p>\n    </div>\n    <div>\n        <h2 id=\"http-transport\">Streamable HTTP transport</h2>\n        <p>Clients that connect to an MCP URL instead of launching a process can use Web-Algebra's HTTP server:</p>\n        <pre>CERT_PEM_PATH=\"$PWD/ssl/owner/cert.pem\" \\\nCERT_PASSWORD=\"$(cat secrets/owner_cert_password.txt)\" \\\nuv run --with web-algebra uvicorn web_algebra.server:app</pre>\n        <p>The MCP URL is <samp>http://127.0.0.1:8000/mcp</samp>. For Claude Code:\n            <code>claude mcp add --transport http web-algebra http://127.0.0.1:8000/mcp</code>.</p>\n        <div class=\"ac-alert va-warning\" role=\"status\">\n            <span class=\"ac-alert-ic\"><span aria-hidden=\"true\" class=\"msi outline\">warning</span></span>\n            <div class=\"ac-alert-body\">\n                <p class=\"ac-alert-text\">The HTTP server does not authenticate its callers, and it holds your WebID certificate. Anyone who can reach the port acts as you.\n                    Keep it bound to <samp>127.0.0.1</samp>, which is the default, and do not expose it on a network.</p>\n            </div>\n        </div>\n    </div>\n    <div>\n        <h2 id=\"try-it\">Try it</h2>\n        <p>Ask the agent for something small that it has to declare rather than code, for example:</p>\n        <blockquote><p>Create a container for books in my dataspace, add three books with authors, and add a chart of books per author.</p></blockquote>\n        <p>Then open <samp>https://localhost:4443/</samp> in the browser. The container, the items and the chart are there, and you can keep editing them by hand —\n            the agent and you work on the same documents.</p>\n    </div>\n</div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
