/ 디렉터리 / 플레이그라운드 / MCP-Nest
● 커뮤니티 rekog-labs ⚡ 바로 사용

MCP-Nest

제작: rekog-labs · rekog-labs/MCP-Nest

NestJS module that turns your existing services into an MCP server — DI, guards, and validation you already use, now exposed to AI.

MCP-Nest is a NestJS module (not a standalone MCP) that adds MCP capabilities to any Nest application. Exposes tools, resources, and prompts via decorators; supports stdio/HTTP+SSE/Streamable HTTP transports; integrates with NestJS guards for auth. Ideal when your backend is already Nest and you want agents to call it.

왜 쓰나요

핵심 기능

라이브 데모

실제 사용 모습

nest.replay ▶ 준비됨
0/0

설치

클라이언트 선택

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "nest": {
      "command": "npx",
      "args": [
        "-y",
        "MCP-Nest"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config 열기. 저장 후 앱 재시작.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "nest": {
      "command": "npx",
      "args": [
        "-y",
        "MCP-Nest"
      ],
      "_inferred": true
    }
  }
}

Cursor는 Claude Desktop과 동일한 mcpServers 스키마 사용. 프로젝트 설정이 전역보다 우선.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "nest": {
      "command": "npx",
      "args": [
        "-y",
        "MCP-Nest"
      ],
      "_inferred": true
    }
  }
}

Cline 사이드바의 MCP Servers 아이콘 클릭 후 "Edit Configuration" 선택.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "nest": {
      "command": "npx",
      "args": [
        "-y",
        "MCP-Nest"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop과 같은 형식. Windsurf 재시작 후 적용.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "nest",
      "command": "npx",
      "args": [
        "-y",
        "MCP-Nest"
      ]
    }
  ]
}

Continue는 맵이 아닌 서버 오브젝트 배열 사용.

~/.config/zed/settings.json
{
  "context_servers": {
    "nest": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "MCP-Nest"
        ]
      }
    }
  }
}

context_servers에 추가. 저장 시 Zed가 핫 리로드.

claude mcp add nest -- npx -y MCP-Nest

한 줄 명령. claude mcp list로 확인, claude mcp remove로 제거.

사용 사례

실전 활용법: MCP-Nest

Expose your existing NestJS backend as an MCP

👤 NestJS teams whose agents need to call internal APIs ⏱ ~45 min intermediate

언제 쓸까: You don't want to rewrite service logic in Python or TS MCP SDK — reuse what's already tested.

사전 조건
  • NestJS 10+ app — Your existing project
  • Install @rekog/mcp-nest — npm i @rekog/mcp-nest
흐름
  1. Register the module
    Add McpModule.forRoot({name: 'acme', version: '1.0'}) to app.module.ts.✓ 복사됨
    → App starts; /mcp endpoint present
  2. Decorate a service method as a tool
    In TicketsService, decorate searchTickets with @Tool({name:'search_tickets', description:'...'}) and a Zod schema. Existing auth guards still apply.✓ 복사됨
    → Tool shows in Claude's tool list
  3. Hook up auth
    Apply the existing JwtAuthGuard on the MCP controller so agents need a valid bearer token.✓ 복사됨
    → Unauth'd calls return 401

결과: Your agents consume your real backend — same validation, same auth, no service duplication.

함정
  • Mixing user-scoped and service-scoped tools creates auth confusion — Split into two MCP modules: one with user JWT, one with service token

Build an interactive tool that asks the user for input mid-call

👤 Nest developers building advanced agent flows ⏱ ~30 min advanced

언제 쓸까: Your tool needs confirmation or a secret that the agent shouldn't have by default.

흐름
  1. Use the elicitation API inside a tool
    In the delete_account tool, before deleting, elicit a typed confirmation from the user (the real human, not the agent).✓ 복사됨
    → Agent prompts the user in chat; proceeds only on confirmation

결과: Irreversible actions gated behind human input even through an agent.

Serve dynamic Nest data as MCP resources

👤 Teams that want agents to read fresh data, not stale snapshots ⏱ ~35 min advanced

언제 쓸까: Agents need to see live status (build, deploy, ticket queue) as context, not via a tool call.

흐름
  1. Declare a resource template
    Create a @Resource('ticket://{id}') that returns the ticket JSON by id.✓ 복사됨
    → Agent can reference ticket://123 and get live content
  2. Subscribe to updates
    Emit updates when the ticket changes so subscribers see fresh state without polling✓ 복사됨
    → MCP push notifications to subscribed clients

결과: Live context instead of snapshots — the agent sees what the user sees.

조합

다른 MCP와 조합해 10배 효율

nest + golf

Python shop + TS shop both build MCPs the same framework-first way

Port our Python Golf MCP features to the Nest team's MCP-Nest server — compare ergonomics.✓ 복사됨
nest + mcptools

Verify tool schemas during CI before deploy

In CI, spin up the Nest MCP and run mcp tools to assert expected tool list.✓ 복사됨

도구

이 MCP가 노출하는 것

도구입력언제 호출비용
@Tool({...}) decorator method args validated via Zod schema Mark any Nest service method as an MCP tool standard Nest method cost
@Resource({...}) decorator URI template params Expose dynamic/static resources standard Nest cost
@Prompt({...}) decorator prompt vars Ship prompts as versioned code 0

비용 및 제한

운영 비용

API 쿼터
Depends on your services
호출당 토큰
Depends on tool output
금액
Free, MIT
Add response size guards on tools that return lists — an unbounded list of tickets will blow token budgets fast

보안

권한, 시크릿, 파급범위

자격 증명 저장: Standard Nest config; use @nestjs/config + secret managers
데이터 외부 송신: Wherever your Nest services go

문제 해결

자주 발생하는 오류와 해결

Tool not appearing in Claude

Ensure the class is registered in a module provider and the decorator import is from @rekog/mcp-nest not a stale copy

확인: curl http://localhost:3000/mcp tools/list
Zod validation errors at runtime

Your schema doesn't match actual inputs the agent sends — tighten descriptions so the model fills the right fields

SSE connection drops every 30s

Upstream proxy timeout; set keepalive in nginx to 60s+ or use Streamable HTTP transport instead

대안

MCP-Nest 다른 것과 비교

대안언제 쓰나단점/장점
TS MCP SDK (official)You don't use NestJS and want the raw SDKNo DI, no guards, you wire everything
GolfPython backendDifferent language; similar framework ambitions
FastMCPPython, simpler than GolfLess enterprise tooling

더 보기

리소스

📖 GitHub에서 공식 README 읽기

🐙 열린 이슈 보기

🔍 400+ MCP 서버 및 Skills 전체 보기