byteforce

CPN 한국어 자습서 · 외부 문서 한국어 미러

MCP 문서 · Registry

빠른 시작: MCP 레지스트리에 MCP 서버 게시

Quickstart: Publish an MCP Server to the MCP Registry · 원문: modelcontextprotocol.io/registry/quickstart

아래는 원문을 한국어로 옮긴 미러입니다. 코드·명령은 원문 그대로이며, 가장 최신 정보는 하단 원문 링크에서 확인하세요.

참고: MCP 레지스트리는 현재 프리뷰 중입니다. 일반 제공 전에 호환성을 깨는 변경이나 데이터 초기화가 발생할 수 있습니다. 문제가 발생하면 GitHub에 보고해 주세요.

이 튜토리얼은 공식 mcp-publisher CLI 도구를 사용하여 TypeScript로 작성된 MCP 서버를 MCP 레지스트리에 게시하는 방법을 보여줍니다.

사전 요구 사항

TypeScript로 작성된 MCP 서버가 없다면 다음 명령으로 예제를 복사하세요:

코드 · 명령
git clone --depth 1 git@github.com:modelcontextprotocol/quickstart-resources.git
cp -r quickstart-resources/weather-server-typescript .
rm -rf quickstart-resources
cd weather-server-typescript

package.json을 편집합니다:

코드 · 명령
-  "name": "mcp-quickstart-ts",
-  "version": "1.0.0",
+  "name": "@my-username/mcp-weather-server",
+  "version": "1.0.1",
코드 · 명령
   "license": "ISC",
-  "description": "",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/my-username/mcp-weather-server.git"
+  },
+  "description": "An MCP server for weather information.",

1단계: 검증 정보 추가

package.jsonmcpName 속성을 추가합니다:

코드 · 명령
   "name": "@my-username/mcp-weather-server",
   "version": "1.0.1",
+  "mcpName": "io.github.my-username/weather",

GitHub 기반 인증을 사용하면 mcpName은 반드시 io.github.my-username/으로 시작해야 합니다.

2단계: 패키지 게시

배포 파일을 빌드합니다:

코드 · 명령
cd weather-server-typescript
npm install
npm run build

npm에 게시합니다:

코드 · 명령
npm adduser  # 필요한 경우 npm 인증
npm publish --access public

3단계: mcp-publisher 설치

코드 · 명령
# macOS/Linux
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher && sudo mv mcp-publisher /usr/local/bin/

# Windows
$arch = if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "Arm64") { "arm64" } else { "amd64" }; Invoke-WebRequest -Uri "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_windows_$arch.tar.gz" -OutFile "mcp-publisher.tar.gz"; tar xf mcp-publisher.tar.gz mcp-publisher.exe; rm mcp-publisher.tar.gz

# Homebrew
brew install mcp-publisher

설치 확인:

코드 · 명령
mcp-publisher --help

4단계: server.json 생성

서버 프로젝트 디렉터리에서 mcp-publisher init 명령을 실행합니다:

코드 · 명령
mcp-publisher init

생성된 server.json 파일을 편집합니다:

코드 · 명령
-  "version": "1.0.0",
+  "version": "1.0.1",
   "packages": [
     {
       "registryType": "npm",
       "identifier": "@my-username/mcp-weather-server",
-      "version": "1.0.0",
+      "version": "1.0.1",
       "transport": {
         "type": "stdio"
-      },
-      "environmentVariables": [...]
+      }
     }
   ]

server.jsonname 속성은 package.jsonmcpName 속성과 반드시 일치해야 합니다.

5단계: MCP 레지스트리 인증

코드 · 명령
mcp-publisher login github

터미널에 출력된 코드를 입력하고 GitHub 기기 흐름을 통해 인가합니다.

6단계: MCP 레지스트리에 게시

코드 · 명령
mcp-publisher publish

서버가 게시되었는지 확인합니다:

코드 · 명령
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.my-username/weather"

문제 해결

오류 메시지 조치
"Registry validation failed for package" package.json에 필요한 검증 정보(예: mcpName 속성)가 포함되어 있는지 확인합니다.
"Invalid or expired Registry JWT token" mcp-publisher login github를 실행하여 재인증합니다.
"You do not have permission to publish this server" GitHub 인증을 사용하면 서버 이름은 반드시 io.github.your-username/으로 시작해야 합니다.

다음 단계

원문(영어): https://modelcontextprotocol.io/registry/quickstart · 본 문서는 학습용 한국어 번역이며 원본의 권리는 원저작자(Model Context Protocol)에게 있습니다.

원문(영어): https://modelcontextprotocol.io/registry/quickstart