mcp-primer

mcp-primer

An MCP server that enables AI models to render GitHub's Primer React components directly within chat interfaces using a JSON component tree. It provides tools to list available components and display interactive UI elements with full GitHub theming support.

Category
Visit Server

README

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)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured