MCP server MCP 서버
Primer Model Context Protocol 서버로 AI 에이전트가 Primer 디자인 시스템을 올바르게 사용하도록 돕습니다. 로컬(stdio) 서버로서 디자인 토큰, 컴포넌트, 패턴, 아이콘 등을 AI 도구에 연결합니다.
출처: 문서
본문
AI 에이전트가 Primer Model Context Protocol 서버로 Primer를 올바르게 사용하도록 돕습니다.
Primer MCP server(@primer/mcp)는 AI 에이전트가 Primer 디자인 시스템을 이해하고 올바르게 사용하도록 돕습니다.
@primer/mcp 패키지는 AI 도구를 Primer 디자인 토큰, 컴포넌트, 패턴, 아이콘 등에 연결하는 로컬(stdio) 서버를 제공합니다. 로컬 개발 환경에서 실행하거나 GitHub Actions 같은 도구에 설정해 AI 에이전트와 함께 사용할 수 있습니다.
제공하는 것 (What it provides)
서버는 AI 에이전트가 호출할 수 있는 도구 세트를 노출합니다:
| Tool | What it does |
|---|---|
| init | Sets up or creates a project that includes Primer React. |
| list_components | Lists the components available from Primer React. |
| get_component | Gets API information for a Primer React component. |
| get_component_examples | Gets examples for how to use a Primer React component. |
| get_component_usage_guidelines | Gets usage guidance for a Primer component. |
| get_component_accessibility_guidelines | Gets accessibility guidance for a Primer component. |
| list_patterns | Lists available Primer patterns. |
| get_pattern | Gets guidance for a Primer pattern. |
| find_tokens | Finds Primer design tokens by intent or value. |
| get_token_group_bundle | Gets bundled token data for a token group. |
| get_design_token_specs | Gets design token specifications. |
| get_token_usage_patterns | Gets guidance for using Primer design tokens. |
| lint_css | Checks CSS for Primer token usage. |
| get_color_usage | Gets guidance for applying color to a user interface. |
| get_typography_usage | Gets guidance for applying typography to a user interface. |
| list_icons | Lists the icons available from Primer Octicons React. |
| get_icon | Gets a specific Octicon by name. |
| primer_coding_guidelines | Gets guidance for writing code that uses Primer or for UI code that you are creating. |
| review_alt_text | Evaluates image alt text against accessibility best practices and context relevance. |
VS Code에 설정하기 (Set up in VS Code)
VS Code에서 @primer/mcp를 사용하려면 Command Palette에서 서버를 설치하세요:
- Command Palette를 엽니다(
Cmd/Ctrl+Shift+P). MCP: Install Server를 입력하고 선택합니다.stdio유형을 선택합니다.npx @primer/mcp@latest를 입력합니다.- 서버 이름으로
Primer를 입력합니다.
MCP 서버 구성은 다음과 같아야 합니다:
{
"servers": {
"Primer": {
"type": "stdio",
"command": "npx",
"args": ["@primer/mcp@latest"]
}
},
"inputs": []
}
다른 클라이언트에 설정하기 (Set up in other clients)
GitHub Copilot CLI는 .mcp.json 또는 .github/mcp.json에서 유사한 stdio 구성을 지원합니다:
{
"mcpServers": {
"Primer": {
"type": "stdio",
"command": "npx",
"args": ["@primer/mcp@latest"]
}
}
}
다른 stdio 지원 MCP 클라이언트는 자체 구성 형식에서 동일한 npx @primer/mcp@latest 서버 명령을 사용할 수 있습니다. 최신 구성 세부 정보는 패키지 README를 참고하세요.
더 알아보기 (Learn more)
- AI 에이전트가 Primer를 올바르게 쓰도록
@primer/mcp의 각 도구(init, list_components, find_tokens 등)를 실행해 보세요. - Primer 디자인 토큰과 컴포넌트 API를 직접 조회해 보는 방법을 익혀 보세요.
- GitHub Actions에 MCP 서버를 설정해 AI 워크플로에 통합해 보세요.