Layers
Partner APIMCP server

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.

View as Markdown

You need two things:

  • A Partner API key (lp_...). Use a sandbox key (lp_test_...) while developing — it returns fixture-backed results and never posts to real accounts. See Sandbox.
  • Node 20+npx fetches and runs @layers/mcp-server for 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_KEY

Or 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@latest

The tools are available in your next Claude Code session.

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_KEY

Pinning 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.0

On this page