typescript-mcp-server-generator
하는 일
이 생성기는 Model Context Protocol(MCP)을 사용해 통신하는 완전한 TypeScript 서버 프로젝트를 만듭니다. 최신 SDK 버전을 사용해 서버가 올바르게 작동하도록 필요한 도구와 구조를 설정합니다.
사용하는 경우
- ✓새 TypeScript MCP 서버 프로젝트를 시작할 때.
- ✓모범 사례와 최신 의존성으로 구성된 MCP 서버가 필요할 때.
- ✓데이터 검증을 포함해 MCP 서버와 상호작용하는 도구를 만들고 싶을 때.
스킬 링크
https://github.com/github/awesome-copilot/blob/main/skills/typescript-mcp-server-generator/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Express와 함께 HTTP 전송 방식을 사용하는 TypeScript MCP 서버를 생성하고, 사용자에게 인사하는 도구를 포함해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
Node.js 프로젝트를 TypeScript로 설정하고, 올바른 MCP v2 라이브러리를 설치한 뒤 서버의 기본 구조를 정의합니다. HTTP 서버와 표준 입출력(stdio)으로 통신하는 서버 중에서 고를 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Generate TypeScript MCP Server
Create a complete Model Context Protocol (MCP) server in TypeScript using the MCP TypeScript SDK v2 with the following specifications:
Requirements
- Project Structure: Create a new TypeScript/Node.js project with proper directory structure
- NPM Packages: The v1 monolithic
@modelcontextprotocol/sdkpackage is retired. Use the focused v2 packages:@modelcontextprotocol/server— server implementation (stdio transport via the@modelcontextprotocol/server/stdiosubpath)@modelcontextprotocol/node— Node HTTP transport (NodeStreamableHTTPServerTransport), or a framework adapter:@modelcontextprotocol/express,@modelcontextprotocol/hono,@modelcontextprotocol/fastify— each adapter requires its peer framework to be installed alongside it (e.g.@modelcontextprotocol/express+express)@modelcontextprotocol/core— shared protocol schemas (import*Schemaconstants from here, not fromsdk/types.js)zod@^4.2— v2 requires Zod 4.2+; do not use zod@3
- Runtime: Node.js 20+ (v2 minimum); ESM-first with
"type": "module"(a CommonJS build is also shipped, sorequire()works if needed) - Server Type: Choose between HTTP (Streamable HTTP transport) or stdio-based server. SSE and WebSocket transports were removed in v2 — do not generate them.
- Tools: Create at least one useful tool with proper schema validation
- Error Handling: Include comprehensive error handling and validation
Implementation Details
Project Setup
- Initialize with
npm initand create package.json - Install dependencies:
@modelcontextprotocol/server,zod@^4.2, and the transport package —@modelcontextprotocol/nodefor plain Node HTTP, or a framework adapter together with its peer framework (e.g.npm install @modelcontextprotocol/express express) - Configure TypeScript with ES modules:
"type": "module"in package.json - Add dev dependencies:
tsxorts-nodefor development - Create proper .gitignore file
Server Configuration
- Use
McpServerclass from@modelcontextprotocol/serverfor high-level implementation - Set server name and version
- Choose the appropriate transport:
- HTTP (Node):
NodeStreamableHTTPServerTransportfrom@modelcontextprotocol/node - HTTP (Web Standard runtimes):
WebStandardStreamableHTTPServerTransportfrom@modelcontextprotocol/server - stdio:
StdioServerTransportfrom@modelcontextprotocol/server/stdio
- HTTP (Node):
- For HTTP: prefer a framework adapter (
@modelcontextprotocol/express, etc.) with proper middleware and error handling - Note that v2 uses Web Standard
Headers/Requesttypes; read headers withctx.http?.req?.headers.get('x-custom')
Tool Implementation
- Use
registerTool()with a config object — v1 variadic.tool()signatures are gone:server.registerTool('greet', { description: 'Greet user', inputSchema: z.object({ name: z.string() }) }, async ({ name }, ctx) => { return { content: [{ type: 'text', text: `Hello, ${name}!` }] }; }); - Schemas must be full Zod objects (
z.object({...})) — raw shape objects ({ name: z.string() }) are deprecated - Provide clear
titleanddescriptionfields - Return both
contentandstructuredContentin results - The handler's second parameter is a structured
ctxobject (replaces v1extra):ctx.mcpReq.signal,ctx.mcpReq.id,ctx.mcpReq.send(...),ctx.mcpReq.notify(...) - Implement proper error handling with try-catch blocks; use the v2 error hierarchy (
ProtocolError,SdkError,SdkHttpErrorwith.status) instead of v1McpError/StreamableHTTPError - Support async operations where appropriate
Resource/Prompt Setup (Optional)
- Add resources using
registerResource()with ResourceTemplate for dynamic URIs - Add prompts using
registerPrompt()with argument schemas (same config-object style asregisterTool()) - Consider adding completion support for better UX; note the v2
completable()wrapper order:completable(z.string(), callback).optional()(optional applied outside)
Code Quality
- Use TypeScript for type safety
- Follow async/await patterns consistently
- Implement proper cleanup on transport close events
- Use environment variables for configuration
- Add inline comments for complex logic
- Structure code with clear separation of concerns
Example Tool Types to Consider
- Data processing and transformation
…
자주 묻는 질문
MCP란 무엇인가요?
MCP(Model Context Protocol)는 시스템의 서로 다른 부분이 정보를 주고받고 작업을 수행하도록 하는 통신 프로토콜입니다.
HTTP 전송과 stdio 전송의 차이는 무엇인가요?
HTTP 전송은 표준 웹 요청으로 통신하고, stdio는 운영체제의 표준 입출력을 사용합니다. HTTP는 웹 애플리케이션에, stdio는 명령줄 도구에 더 흔히 쓰입니다.
이 맥락에서 '도구'란 무엇인가요?
데이터를 가져오거나 계산하는 등 MCP 서버가 수행할 수 있는 특정 기능입니다. 명확한 설명과 검증 기능을 갖춰 올바른 데이터를 받도록 합니다.
상세 정보
작성자의 원본 설명
Generate a complete MCP server project in TypeScript using the MCP TypeScript SDK v2 (@modelcontextprotocol/server) with tools, resources, and proper configuration
repo: github/awesome-copilot
인기도
- GitHub 스타
- 40k
- 순위
- #7456
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
acquire-codebase-knowledge
40k에이전트가 기존 코드 프로젝트를 이해하고 문서화하도록 돕습니다. 새 구성원을 맞이하거나 아키텍처를 개괄적으로 파악할 때 유용합니다.
acreadiness-assess
40k에이전트가 프로젝트의 AI 준비 상태를 평가하고 보고서를 만들도록 합니다. 프로젝트가 AI 도구를 쓸 준비가 얼마나 되어 있는지 이해하는 데 유용합니다.
acreadiness-generate-instructions
40k에이전트가 평가 결과를 바탕으로 AI 도구를 위한 지침을 만들도록 돕습니다. AI가 코드와 상호작용하는 방식을 개선하고 확인된 공백을 메울 때 유용합니다.
acreadiness-policy
40k에이전트가 AI 프로젝트 평가를 위한 정책을 정의하거나 적용하도록 돕습니다. 프로젝트 평가 방식을 표준화하고 규정 준수를 보장할 때 유용합니다.