Skip to content

Connect an agent with MCP

View as Markdown

Connect an AI client to your workspace’s MCP server and the agent can query records, read your app spec and propose changesets from inside the chat or editor. You need an API key and a few lines of client configuration.

All clients need the same two things:

Setting Value
URL https://app.ligament.ai/api/mcp
Header Authorization: Bearer <your key>

The server uses the streamable HTTP transport and authenticates with the header only.

In Settings › API keys, create a key named after the agent and the machine, for example “Claude Code on Priya’s laptop”. Choose the scopes for what the agent should do:

The agent should Scopes
Answer questions about records records:read
Also explain access (“why can’t Tomás see this case?”) records:read (the access tools come with it)
Read your apps and propose changes for review spec:read, spec:propose, records:read
Apply changes itself add spec:apply. Only for agents you’d trust with the creator’s build permissions
Call your workspace’s exposed connectors and scripts endpoints:invoke

Avoid Full access (*) for agents: it includes spec:apply and every write scope.

Keep the key in an environment variable rather than in a config file you might commit:

Terminal window
export LIGAMENT_API_KEY=<your key>

Before configuring a client, check that the server answers with your key:

Terminal window
curl -s "https://app.ligament.ai/api/mcp" \
-H "Authorization: Bearer $LIGAMENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-03-26","capabilities":{"tools":{},"resources":{}},"serverInfo":{"name":"ligament","version":"1.0.0"}}}

Then list the tools the key can use:

Terminal window
curl -s "https://app.ligament.ai/api/mcp" \
-H "Authorization: Bearer $LIGAMENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

A key with spec:read, spec:propose and records:read lists 21 tools: spec_catalog, spec_list, spec_get, spec_schema, spec_validate, spec_plan, spec_history, changeset_list, changeset_get, changeset_create, changeset_put_items, changeset_plan, changeset_discard, access_whoami, access_explain, access_effective, access_plan, records_query, records_get, records_history and records_changes. A 401 means the key is wrong or revoked; a 403 means it has none of the scopes the server needs.

Terminal window
claude mcp add --transport http ligament https://app.ligament.ai/api/mcp \
--header "Authorization: Bearer $LIGAMENT_API_KEY"

This stores the key’s value in your Claude Code settings. To share the setup with your team without sharing a key, add the server to the project’s .mcp.json instead and let each person’s environment supply the key:

{
"mcpServers": {
"ligament": {
"type": "http",
"url": "https://app.ligament.ai/api/mcp",
"headers": { "Authorization": "Bearer ${LIGAMENT_API_KEY}" }
}
}
}

In Claude Code, /mcp shows whether the server is connected and how many tools it has.

Claude Desktop starts local MCP servers from claude_desktop_config.json. To reach a remote server that authenticates with a header, run it through the mcp-remote bridge (needs Node.js):

{
"mcpServers": {
"ligament": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://app.ligament.ai/api/mcp", "--header", "Authorization:${AUTH_HEADER}"],
"env": { "AUTH_HEADER": "Bearer <your key>" }
}
}
}

The header goes through an environment variable because the value contains a space. Restart Claude Desktop after editing the file.

Add the server to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for every project):

{
"mcpServers": {
"ligament": {
"url": "https://app.ligament.ai/api/mcp",
"headers": { "Authorization": "Bearer ${env:LIGAMENT_API_KEY}" }
}
}
}

The server then appears under Cursor’s MCP settings with its tools.

Any client that supports MCP over streamable HTTP with custom headers works: give it the URL and the Authorization header from the table at the top of this page. For clients that only run local (stdio) servers, use the mcp-remote bridge as in the Claude Desktop example.

Ask the agent something that needs the tools, for example:

Which critical incidents are still in progress? Use the ligament tools.

The agent should call records_query with a priority filter. Then give it the starting prompt before asking for changes, and put the AGENTS.md template in any repository where agents work on your apps.

To disconnect an agent, revoke its key in Settings › API keys. Its next call gets 401.