MCP Server Overview
Connect AI agents to Closedloop using the Model Context Protocol
What is the Closedloop MCP Server?
The Closedloop MCP server exposes the Closedloop platform to AI agents through the Model Context Protocol. Any MCP-compatible client, such as Claude Code, Claude Desktop, Cursor, or your own toolchain, can connect and work with projects, documents, tags, artifact links, agent sessions, and more.
The server calls the Closedloop REST API on your behalf, as the user who owns the API key you connect with. Everything a tool returns is scoped to that user's organization.
Endpoint and transport
| URL | https://mcp.closedloop.ai/mcp |
| Transport | Streamable HTTP. Send JSON-RPC as POST with Content-Type: application/json. |
| Sessions | The server assigns an Mcp-Session-Id on initialize; send it on later requests, and DELETE /mcp with it to end the session. |
| Server-sent events | Not offered. GET /mcp answers 405. |
| Request size | Bodies over 1 MiB are refused with 413 by default. |
Standard MCP clients handle sessions for you. The server also publishes a server card at https://mcp.closedloop.ai/.well-known/mcp.json listing its transport, the protocol versions it negotiates, and its tool names.
Authentication
Every request to /mcp needs a Bearer token. The server accepts two kinds:
- A Closedloop API key (
sk_live_...), sent directly asAuthorization: Bearer sk_live_.... - An OAuth access token (
mcp_at_...) that the server issues in exchange for your API key.
Either way, the credential underneath is an API key. To create one, open Settings in the web app or the Desktop app, choose API Keys under Labs, then Create key. The secret is shown once, when you create it. See Authentication for how keys and scopes work.
OAuth (recommended for interactive clients)
The server is its own OAuth 2.1 authorization server. A request without a token gets 401 with a WWW-Authenticate header pointing to /.well-known/oauth-protected-resource, from which an OAuth-capable client discovers the rest:
| Endpoint | Purpose |
|---|---|
/.well-known/oauth-authorization-server | Authorization server metadata |
/oauth/register | Dynamic client registration |
/oauth/authorize | Authorization page, where you enter your API key |
/oauth/token | Token endpoint |
- The authorization code flow requires PKCE with
S256. - Loopback redirect URIs (
localhost,127.0.0.1,[::1], any port) are always accepted. Any other redirect URI must be on the server's allowlist. - The
client_credentialsgrant is also supported: pass your API key asclient_secret. - By default an access token lasts one hour and a refresh token 30 days.
- The
scopeyou request is intersected with your key's scopes. Omit it to receive all of the key's scopes; a request that overlaps none of them is refused withinvalid_scope.
Connect Claude Code
With OAuth:
- Run
/mcpin Claude Code and add a server namedclosedloopwith the URLhttps://mcp.closedloop.ai/mcp. - Choose Authenticate (or Re-authenticate when reconnecting).
- In the browser, on the Authorize MCP Access page, enter your API key and choose Authorize.
- Confirm the
/mcppanel shows the server as connected and authenticated, then try a prompt such aslist my projects.
With the API key in a header instead:
claude mcp add --transport http closedloop https://mcp.closedloop.ai/mcp \
--header "Authorization: Bearer sk_live_your_api_key_here"Other clients follow the same pattern: give them the URL, then either complete the OAuth flow or configure the Authorization header.
Which tools a session gets
Each tool requires one or more scopes, and the server registers a tool for a session only when the session's grant covers all of them. A session with fewer scopes sees fewer tools; it is not offered tools that would fail.
| Scope | Tools that need it |
|---|---|
read | Every list, get, search, and status tool, plus tag-artifact and untag-artifact |
write | Tools that create or update, including tag-artifact |
delete | delete-attachment, delete-artifact-link, untag-artifact |
Each tool page states the exact scopes a tool requires. ping requires none.
On connect, the server also sends instructions that describe the entity hierarchy, status lifecycles, slug conventions, and how to use the webUrl field in responses.
Errors
A tool that fails returns an MCP tool result with isError: true. Its text holds a title, a description, remediation steps when there are any, and a short technical-details block limited to the error code, message, and timestamp.
Tool index
The server registers 42 tools.
| Group | Tools |
|---|---|
| Documents | list-documents, get-document, get-document-content, create-document, update-document |
| Document versions | create-document-version, list-document-versions |
| Attachments | list-attachments, upload-attachment, create-inline-image-attachment, download-attachment, delete-attachment |
| Comment threads | create-document-thread, get-document-comments |
| Projects | list-projects, get-project, list-teams, create-project, update-project, move-artifact |
| Artifact links | list-artifact-links, create-artifact-link, delete-artifact-link |
| Branch artifacts | create_branch_artifact |
| Tags | list-tags, tag-artifact, untag-artifact |
| Search | search |
| Users | get-me, list-users |
| Connection and integration status | ping, get-github-status, get-linear-status, get-google-status |
| Audit ledger | verify-audit-ledger |
| Agent sessions | list-agent-sessions, get-agent-session-transcript, get-agent-session-usage, get-agent-session-analytics, list-session-comments |
| Agent components | list-agent-components, get-agent-component |