PM

platformatic/mcp

Analytics & monitoring

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

62 stars 16 forks 품질 75 트렌드 34Apache-2.0

JSON-RPC 2.0을 사용하여 Model Context Protocol (MCP) 서버를 구현하는 Fastify 플러그인입니다. 이 플러그인은 Fastify 응용 프로그램을 사용하여 도구, 리소스, 그리고 MCP 뒤에 프롬프트를 노출...

개요

JSON-RPC 2.0을 사용하여 Model Context Protocol (MCP) 서버를 구현하는 Fastify 플러그인입니다. 이 플러그인은 완전한 elicitation 지원으로 MCP 2025-06-18 사양을 따르는 도구, 리소스 및 프롬프트를 노출하기 위해 빠른 응용 프로그램을 활성화합니다. type-safe schema validation를 위해, TypeBox를 설치하십시오: - : elicitation을 가진 전체 모델 콘텍스 프로토콜 사양 구현 - : schema validation에 대한 서버 클라이언트 정보 요청 - : 자동 TypeScript inference와 Type-safe 스키마 유효성 검사 - : 입력 위생, 제한, 보안 평가 - : HTTP / SSE 및 유연한 통신을위한 stdio 운송 - : 실시간 통신을위한 Server-Sent 이벤트 - : Redis-backed 세션 관리 및 메시지 방송 - : 메시지 역사 및 재연결 지원 - 마지막 지원 - : 로컬 보안 테스트 및 분산 응용 프로그램 - : 실시간 통신을위한 Server-Sent 이벤트 - : 플러그인은 elicitation 기능을 지원 ...

개요(AI 번역)

JSON-RPC 2.0을 사용하여 Model Context Protocol (MCP) 서버를 구현하는 Fastify 플러그인입니다. 이 플러그인은 완전한 elicitation 지원으로 MCP 2025-06-18 사양을 따르는 도구, 리소스 및 프롬프트를 노출하기 위해 빠른 응용 프로그램을 활성화합니다.

설치

TypeBox 지원 (선택 사항)

type-safe schema validation를 위해, TypeBox를 설치하십시오:

특징

  • ** MCP 2025-11-25 지원 ** : 현재 모델 Context Protocol 개정을 구현, 2025-06-18], 2025-03-26 및 2024-11-05 이전 클라이언트 협상
  • **Tasks (수상) **: 설문조사와 함께 작업 증강 도구 호출, 결과 검색 및 취소
  • Elicitation Support: 스키마 유효성 검사와 함께 양식과 URL 모드 모두의 Server-to-client 정보 요청
  • ** 아이콘 **: 도구, 리소스, 리소스 템플릿 및 프롬프트에 대한 옵션 아이콘 메타데이터
  • TypeBox Validation: 자동 TypeScript inference를 사용한 Type-safe 스키마 검증
  • **보안 향상 **: 입력 위생, 제한, 보안 평가
  • Multiple Transport Support: 유연한 통신을 위한 HTTP/SSE 및 stdio 수송
  • SSE Streaming: 실시간 통신을 위한 Server-Sent 이벤트

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

Fastify MCP Server

A Fastify plugin that implements the Model Context Protocol (MCP) server using JSON-RPC 2.0. This plugin enables Fastify applications to expose tools, resources, and prompts following the MCP 2025-06-18 specification with full elicitation support.

Installation

npm install @platformatic/mcp

TypeBox Support (Optional)

For type-safe schema validation, install TypeBox:

npm install @sinclair/typebox

Features

  • Complete MCP 2025-11-25 Support: Implements the current Model Context Protocol revision, negotiating down to 2025-06-18, 2025-03-26 and 2024-11-05 for older clients
  • Tasks (experimental): Task-augmented tool calls with polling, deferred result retrieval and cancellation
  • Elicitation Support: Server-to-client information requests in both form and URL mode, with schema validation
  • Icons: Optional icon metadata on tools, resources, resource templates and prompts
  • TypeBox Validation: Type-safe schema validation with automatic TypeScript inference
  • Security Enhancements: Input sanitization, rate limiting, and security assessment
  • Multiple Transport Support: HTTP/SSE and stdio transports for flexible communication
  • SSE Streaming: Server-Sent Events for real-time communication
  • Horizontal Scaling: Redis-backed session management and message broadcasting
  • Session Persistence: Message history and reconnection support with Last-Event-ID
  • Memory & Redis Backends: Seamless switching between local and distributed storage
  • Production Ready: Comprehensive test coverage, security features, and authentication support

Quick Start

import Fastify from 'fastify'
import mcpPlugin from '@platformatic/mcp'
// Or use named import:
// import { mcpPlugin } from '@platformatic/mcp'

const app = Fastify({ logger: true })

// Register the MCP plugin
await app.register(mcpPlugin, {
  serverInfo: {
    name: 'my-mcp-server',
    version: '1.0.0'
  },
  capabilities: {
    tools: { listChanged: true },
    resources: { subscribe: true },
    prompts: {}
  },
  instructions: 'This server provides custom tools and resources'
})

// Add tools, resources, and prompts with handlers
app.mcpAddTool({
  name: 'calculator',
  description: 'Performs basic arithmetic operations',
  inputSchema: {
    type: 'object',
    properties: {
      operation: { type: 'string', enum: ['add', 'subtract', 'multiply', 'divide'] },
      a: { type: 'number' },
      b: { type: 'number' }
    },
    required: ['operation', 'a', 'b']
  }
}, async (params) => {
  const { operation, a, b } = params
  let result
  switch (operation) {
    case 'add': result = a + b; break
    case 'subtract': result = a - b; break
    case 'multiply': result = a * b; break
    case 'divide': result = a / b; break
    default: throw new Error('Invalid operation')
  }
  return {
    content: [{ type: 'text', text: `Result: ${result}` }]
  }
})

app.mcpAddResource({
GitHub에서 전체 README 보기

설치

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

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →