BN

btwld/nest-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

7 stars 5 forks 品質 63 トレンド 23BSD-3-Clause

Build Model Context Protocol (MCP) servers, clients, and gateways using the NestJS ecosystem you already know.

概要

Build Model Context Protocol (MCP) servers, clients, and gateways using the NestJS ecosystem you already know: decorators, dependency injection, modules, and guards, without learning a new framework. NestJS peer dependencies (if not already installed): Define tools with decorators and register the module: Connect to a server and inject the client: Aggregate two upstream servers behind one endpoint: Tools from upstream servers are exposed with a prefix (weather_forecast, search_query). Downstream clients see one unified server. Full documentation lives in the docs/ folder. Working examples live in the apps/ directory:

README

以下は原文 README の抜粋です。原文を見る。

nest-mcp

Build Model Context Protocol (MCP) servers, clients, and gateways using the NestJS ecosystem you already know: decorators, dependency injection, modules, and guards, without learning a new framework.

Packages

Package Description
@nest-mcp/server Build MCP servers with decorators, auth, resilience, and multi-transport support
@nest-mcp/client Connect to and consume MCP servers with typed injection and health checks
@nest-mcp/gateway Aggregate multiple upstream servers behind one unified MCP endpoint
@nest-mcp/common Shared types and utilities (peer dependency)

Architecture

┌─────────────────────────────────────────────┐
│             AI Client (LLM host)            │
└──────────────────────┬──────────────────────┘
                       │ MCP (Streamable HTTP / SSE / STDIO)
          ┌────────────▼────────────┐
          │   @nest-mcp/gateway     │  ← optional aggregation layer
          │  (NestJS application)   │
          └──┬──────────────┬───────┘
             │              │ upstream MCP connections (@nest-mcp/client)
  ┌──────────▼──┐    ┌──────▼──────┐
  │  @nest-mcp/ │    │  @nest-mcp/ │  ← MCP servers built with @nest-mcp/server,
  │   server A  │    │   server B  │     or any other MCP-compatible server
  └─────────────┘    └─────────────┘

@nest-mcp/server — internal architecture

  HTTP / SSE / STDIO
         │
         ▼
  ┌─────────────────────────────────────────────────────────┐
  │                    Transport Layer                      │
  │        (StreamableHttpService / SseService /            │
  │                 StdioService)                           │
  └──────────────────────┬──────────────────────────────────┘
                         │ MCP request (tool/resource/prompt)
                         ▼
  ┌─────────────────────────────────────────────────────────┐
  │                  Execution Pipeline                     │
  │                                                         │
  │  ContextFactory → McpExecutionContext                   │
  │         │                                               │
  │         ▼                                               │
  │  Auth Guards (@Public / @Scopes / @Roles / @Guards)     │
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →