Skip to content

Claude Code

Configure Claude Code to publish artifacts via the Display.dev MCP server.

On this page

Claude Code is Anthropic's CLI assistant. MCP servers live in .mcp.json (project scope, at the repo root) or in the per-user file at ~/.claude.json under the matching project key. There are two ways to wire up Display.dev.

If you're using Claude Desktop or Claude.ai web instead, the OAuth-based Custom connector flow is the recommended setup. Claude Code uses the static API-key path described below.

Paste a URL + an API key. Works from a fresh checkout with no other install.

  1. Generate an API key at app.display.dev/keys. Keys start with sk_live_….

  2. Pick the scope:

    • Project scope.mcp.json at the repo root. Ships in source control; teammates pick it up automatically.
    • User scope~/.claude.json on your machine.
  3. Add the server:

    json
    {
      "mcpServers": {
        "display": {
          "type": "url",
          "url": "/v1/mcp",
          "headers": {
            "Authorization": "Bearer sk_live_..."
          }
        }
      }
    }
  4. Restart the conversation (or run /mcp to refresh).

For project scope, don't commit a real API key. Either keep the entry in ~/.claude.json (user scope) and ask teammates to do the same, or in .mcp.json substitute an env var your team resolves: "Authorization": "Bearer ${DISPLAYDEV_API_KEY}".

Option 2 — Local stdio

If you already have the CLI installed (npm install -g @displaydev/cli + dsp login), point Claude Code at the local server. Auth comes from your saved session — no API key needed.

json
{
  "mcpServers": {
    "display": {
      "command": "dsp",
      "args": ["mcp"]
    }
  }
}

Claude Code resolves dsp against the shell PATH. If you don't want to install globally, use:

json
{
  "mcpServers": {
    "display": {
      "command": "npx",
      "args": ["-y", "@displaydev/cli", "mcp"]
    }
  }
}

Or use the claude mcp add helper:

bash
claude mcp add --transport stdio display -- dsp mcp                    # project scope
claude mcp add --transport stdio --scope user display -- dsp mcp       # user scope

You can run dsp login from inside a Claude Code shell session — it writes the same ~/.displaydev/config.json that the local MCP server reads. After login, restart the conversation (or run /mcp to refresh).

Was this page helpful?