Quickstart
Connect the Layers MCP server to Claude or the OpenAI Agents SDK with a single npx command, then ask your agent to run whoami.
You need two things:
- An API integration key (
lp_...) — create one, or see Create an API key. Use a sandbox key (lp_test_...) while developing — it returns fixture-backed results and never posts to real accounts. See Sandbox. - Node 20+ —
npxfetches and runs@layers/mcp-serverfor you; there's nothing to install globally.
Your API key is passed to the server. When you put it in --api-key, it lands
in the client config and is visible in the process list (ps). Where your
client supports it, prefer the LAYERS_API_KEY env var instead — see
Authentication & configuration.
Connect it
Register the server with the Claude Code CLI:
claude mcp add layers -- npx -y @layers/mcp-server@latest --api-key lp_YOUR_KEYOr pass the key via env var instead of argv (recommended):
claude mcp add layers --env LAYERS_API_KEY=lp_YOUR_KEY -- npx -y @layers/mcp-server@latestThe tools are available in your next Claude Code session.
Register the server with the Codex CLI — same shape as Claude Code:
codex mcp add layers -- npx -y @layers/mcp-server@latest --api-key lp_YOUR_KEYOr pass the key via env var instead of argv (recommended):
codex mcp add layers --env LAYERS_API_KEY=lp_YOUR_KEY -- npx -y @layers/mcp-server@latestThis writes an [mcp_servers.layers] block to ~/.codex/config.toml. Check it with codex mcp get layers, and remove it with codex mcp remove layers.
Drop the --api-key flag entirely and the server starts in keyless
onboarding mode instead, which needs no account at
all.
Add the server to your claude_desktop_config.json (Settings → Developer → Edit Config), then fully quit and reopen Claude Desktop:
{
"mcpServers": {
"layers": {
"command": "npx",
"args": ["-y", "@layers/mcp-server@latest"],
"env": { "LAYERS_API_KEY": "lp_YOUR_KEY" }
}
}
}The server runs as a local stdio subprocess. Launch it with MCPServerStdio and pass it to your agent (OpenAI Agents SDK · MCP):
from agents import Agent, Runner
from agents.mcp import MCPServerStdio
async with MCPServerStdio(
name="Layers",
params={
"command": "npx",
"args": ["-y", "@layers/mcp-server@latest"],
"env": {"LAYERS_API_KEY": "lp_YOUR_KEY"},
},
) as layers:
agent = Agent(
name="Assistant",
instructions="Use the Layers tools to manage projects and content.",
mcp_servers=[layers],
)
result = await Runner.run(agent, "List my Layers projects.")
print(result.final_output)The same package works with the OpenAI Agents SDK for TypeScript — point its stdio MCP server at the same npx command and args.
Any MCP client that spawns stdio servers takes the same command + args:
{
"mcpServers": {
"layers": {
"command": "npx",
"args": ["-y", "@layers/mcp-server@latest"],
"env": { "LAYERS_API_KEY": "lp_YOUR_KEY" }
}
}
}Verify the connection
MCP servers expose tools, not slash commands — the agent calls them on its own when your request needs them. So you don't run a command; you ask the agent something that requires Layers, and it picks the tool.
The cheapest check is whoami. Ask your client:
"Use Layers to tell me who I'm authenticated as."
The agent calls the whoami tool and reports back your organization, rate-limit tier, and credit balance — confirming the key resolved. From there:
"List my Layers projects."
"Generate a slideshow for project
prj_...."
Explore the tools interactively
To inspect the tool surface without an agent, point the MCP Inspector at the server:
npx @modelcontextprotocol/inspector npx -y @layers/mcp-server@latest --api-key lp_test_YOUR_KEYPinning versions
@latest runs whatever was published most recently. For reproducible installs, pin a version and treat upgrades as deliberate:
npx -y @layers/mcp-server@1.0.0Overview
The Layers MCP server is a thin, 1:1 wrapper over the API integration that lets an AI agent — Claude, ChatGPT, Cursor, any MCP client — call Layers as native tools, with no HTTP code to write.
Agent onboarding
Start a real Layers workspace from an agent session with no account and no API key — a proof-of-work challenge, one POST, and a hosted MCP endpoint.