# Quickstart (/docs/api/mcp-server/quickstart)



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](/docs/api/concepts/sandbox).
* **Node 20+** — `npx` fetches and runs `@layers/mcp-server` for you; there's nothing to install globally.

<Callout type="warn">
  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&#x60;). Where your
  client supports it, prefer the **`LAYERS_API_KEY` env var** instead — see
  [Authentication & configuration](/docs/api/mcp-server/authentication#security).
</Callout>

## Connect it [#connect-it]

<Tabs items="['Claude Code', 'Claude Desktop', 'OpenAI Agents SDK', 'Generic MCP client']">
  <Tab value="Claude Code">
    Register the server with the Claude Code CLI:

    ```sh
    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):

    ```sh
    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.
  </Tab>

  <Tab value="Claude Desktop">
    Add the server to your `claude_desktop_config.json` (Settings → Developer → Edit Config), then fully quit and reopen Claude Desktop:

    ```json
    {
      "mcpServers": {
        "layers": {
          "command": "npx",
          "args": ["-y", "@layers/mcp-server@latest"],
          "env": { "LAYERS_API_KEY": "lp_YOUR_KEY" }
        }
      }
    }
    ```
  </Tab>

  <Tab value="OpenAI Agents SDK">
    The server runs as a local stdio subprocess. Launch it with `MCPServerStdio` and pass it to your agent ([OpenAI Agents SDK · MCP](https://openai.github.io/openai-agents-python/mcp/)):

    ```python
    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](https://openai.github.io/openai-agents-js/guides/mcp/) — point its stdio MCP server at the same `npx` command and args.
  </Tab>

  <Tab value="Generic MCP client">
    Any MCP client that spawns stdio servers takes the same `command` + `args`:

    ```json
    {
      "mcpServers": {
        "layers": {
          "command": "npx",
          "args": ["-y", "@layers/mcp-server@latest"],
          "env": { "LAYERS_API_KEY": "lp_YOUR_KEY" }
        }
      }
    }
    ```
  </Tab>
</Tabs>

## Verify the connection [#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 [#explore-the-tools-interactively]

To inspect the tool surface without an agent, point the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) at the server:

```sh
npx @modelcontextprotocol/inspector npx -y @layers/mcp-server@latest --api-key lp_test_YOUR_KEY
```

## Pinning versions [#pinning-versions]

`@latest` runs whatever was published most recently. For reproducible installs, pin a version and treat upgrades as deliberate:

```sh
npx -y @layers/mcp-server@1.0.0
```
