MCP Primer MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/austenstone/mcp-primer
cd mcp-primer

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add mcp-primer -- node "<FULL_PATH_TO_MCP_PRIMER>/dist/index.js" --stdio

Replace <FULL_PATH_TO_MCP_PRIMER>/dist/index.js with the actual folder you prepared in step 1.

README.md

Render Primer React components inline in AI conversations

mcp-primer

MCP App that renders Primer React components inline in AI conversations. Built on the MCP Apps extension.

Primer

What it does

Exposes two MCP tools:

Tool Description
render-primer Renders a Primer component tree from JSON inline in the conversation
list-components Returns available components with usage examples

The LLM sends a component tree as JSON, and the MCP App renders it using real @primer/react components with full GitHub theming (light + dark mode).

Example

Ask Copilot: "Show me a PR status using Primer components"

The LLM calls render-primer with:

{
  "tree": {
    "type": "Stack",
    "props": { "direction": "horizontal", "align": "center", "gap": "normal" },
    "children": [
      { "type": "StateLabel", "props": { "status": "pullOpened" }, "children": "Open" },
      { "type": "Heading", "props": { "as": "h3" }, "children": "Add dark mode support" }
    ]
  }
}

And it renders as real Primer components in the chat.

Setup

VS Code (Insiders)

Add to your MCP settings (.vscode/mcp.json):

{
  "servers": {
    "primer": {
      "command": "node",
      "args": ["${workspaceFolder}/dist/main.js", "--stdio"]
    }
  }
}

Or point to the repo wherever you cloned it:

{
  "servers": {
    "primer": {
      "command": "bash",
      "args": ["-c", "cd ~/source/mcp-primer && npm run build >&2 && node dist/main.js --stdio"]
    }
  }
}

HTTP Transport

npm start
# Server listening on http://localhost:3001/mcp

Development

npm install
npm run dev     # Watch mode (Vite + server)

Available Components

Layout: Stack, PageLayout, PageHeader

Typography: Heading, Text

Actions: Button, IconButton, ButtonGroup, LinkButton

Navigation: Breadcrumbs, Link, Pagination, UnderlineNav

Data Display: Avatar, AvatarStack, BranchName, CounterLabel, Label, StateLabel, Token, RelativeTime, Timeline

Feedback: Banner, Spinner, ProgressBar

Forms: TextInput, Textarea, Select, Checkbox, Radio, FormControl, ToggleSwitch, SegmentedControl

Overlays: ActionList, ActionMenu, Dialog

Misc: Truncate, Tooltip, Popover, TreeView, NavList

All compound components (e.g. ActionList.Item, FormControl.Label, Timeline.Badge) are also supported using dot notation.

Component Tree Format

Each node in the tree has:

{
  type: string;       // Primer component name
  props?: object;     // Component props
  children?: string | node | (string | node)[];  // Text or nested components
}

Build

npm run build    # Type-check + Vite bundle + compile server

Produces:

  • dist/mcp-app.html — single-file React app with all Primer components bundled
  • dist/server.js — MCP server
  • dist/index.js — entry point (stdio + HTTP)

Tools (2)

render-primerRenders a Primer component tree from JSON inline in the conversation
list-componentsReturns available components with usage examples

Configuration

claude_desktop_config.json
{"servers": {"primer": {"command": "node", "args": ["/path/to/dist/main.js", "--stdio"]}}}

Try it

Show me a PR status using Primer components
List all available Primer components I can use in the chat
Create a UI layout with a Heading and a Button using the render-primer tool
Display a StateLabel component showing an open pull request

Frequently Asked Questions

What are the key features of MCP Primer?

Renders interactive Primer React components inline. Supports full GitHub theming including light and dark modes. Provides a JSON-based component tree format for UI construction. Includes a wide range of components from layout to data display.

What can I use MCP Primer for?

Visualizing PR statuses directly within the chat interface. Building interactive dashboards or UI prototypes using AI. Standardizing AI-generated UI elements with GitHub's design system. Creating complex data displays like tables or timelines in chat.

How do I install MCP Primer?

Install MCP Primer by running: node dist/main.js --stdio

What MCP clients work with MCP Primer?

MCP Primer works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Primer docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare