MCP Connection

Connect AgentLed to Claude Code, Cursor, Windsurf, Codex, or any MCP-compatible client. One command to set up, one API key to authenticate.


How MCP Works

AgentLed runs as an MCP (Model Context Protocol) server. Your AI client connects to it over stdio, giving the AI direct access to 100+ integrations, workflow orchestration, and the Knowledge Graph — all authenticated with a single API key.

The server is distributed as an npm package (@agentled/mcp-server). Your MCP client launches it as a subprocess and communicates over stdin/stdout.


Claude Code

Run this single command to register the AgentLed MCP server:

claude mcp add agentled \
  -e AGENTLED_API_KEY=wsk_... \
  -- npx -y @agentled/mcp-server

Replace wsk_... with your actual API key. See API Keys for how to generate one.


OpenAI Codex

codex mcp add agentled \
  -e AGENTLED_API_KEY=wsk_... \
  -- npx -y @agentled/mcp-server

Cursor / Windsurf

Add the following to your MCP settings JSON file:

{
  "mcpServers": {
    "agentled": {
      "command": "npx",
      "args": ["-y", "@agentled/mcp-server"],
      "env": {
        "AGENTLED_API_KEY": "wsk_..."
      }
    }
  }
}

In Cursor, open Settings > MCP and paste the config. In Windsurf, edit ~/.windsurf/mcp_settings.json.


Other MCP Clients

Any client that supports the MCP stdio transport can connect. The general pattern:

1.Set the environment variable AGENTLED_API_KEY to your workspace key

2.Launch npx -y @agentled/mcp-server as a subprocess

3.Communicate over stdin/stdout using the MCP protocol


Troubleshooting

“AGENTLED_API_KEY is required”

The server couldn't find your API key. Make sure the -e AGENTLED_API_KEY=wsk_... flag is set in the MCP add command, or that the environment variable is exported in your shell.

“npx: command not found”

Install Node.js 18+ from nodejs.org. Verify with npx --version.

Server connects but tools don't appear

Restart your MCP client after adding the server. Some clients require a full restart to discover new MCP tools.

Authentication errors (401 / 403)

Check that your API key starts with wsk_ and hasn't been revoked. Generate a new key from Workspace Settings > Developer in the AgentLed dashboard.


Next Steps