Skip to main content
The Clay plugin has two halves: the Clay CLI for scripting and ephemeral operations, and a local MCP server that exposes Clay’s tools to an MCP host such as Claude Code, Cursor, or Claude Desktop. Installing the plugin wires up both.

How it works

An MCP host spawns clay mcp, which runs as a long-running server over stdio and forwards the host’s tool calls to Clay. It authenticates with the same credentials as the rest of the CLI — the session from clay login, or the CLAY_API_KEY environment variable. You do not put an API key into the host config.
{
  "mcpServers": {
    "clay": { "command": "clay", "args": ["mcp"] }
  }
}

Workspace pinning

An MCP connection is pinned to whichever workspace the stored credential was scoped to when the server started. Re-running clay login only updates the credential on disk — the running MCP server keeps using the workspace it loaded at startup. To switch workspaces, sign in to the new workspace and then have the host restart the server so it picks up the new credential.

CLI or MCP

Use the MCP server when an agent host should call Clay’s tools as part of its normal tool-use loop. Reach for the CLI for one-off runs, scripting, and inspecting data from a shell, and the Public API when you are building a service or app that calls Clay programmatically.