MCP TypeScript Simple Template

Integrations

  • Provides the runtime environment for the MCP server, enabling server-side execution of the tools and communication via standard I/O.

  • Supports package management for the MCP server, allowing easy installation of dependencies and execution of build scripts.

  • Serves as the foundation for building custom MCP tools, providing type safety and structure for implementing tools that can be integrated with AI systems.

MCP TypeScript 간단한 템플릿

모델 컨텍스트 프로토콜(MCP) 서버 구축을 위한 간단한 TypeScript 템플릿입니다. 이 프로젝트는 AI 시스템과 통합 가능한 맞춤형 MCP 도구를 개발하기 위한 기반을 제공합니다.

개요

이 템플릿은 샘플 BMI 계산기 도구를 사용하여 기본 MCP 서버를 구현합니다. 다음 작업을 수행하는 방법을 보여줍니다.

  • TypeScript에서 MCP 서버 설정
  • Zod를 사용하여 입력 검증을 통해 MCP 도구 정의 및 구현
  • 통신을 위해 서버를 표준 I/O에 연결합니다.

필수 조건

  • Node.js(v20 이상 권장)
  • npm 또는 yarn

설치

  1. 이 저장소를 복제하세요
  2. 종속성 설치:

지엑스피1

프로젝트 구조

  • index.ts - 샘플 도구를 사용한 메인 서버 구현
  • package.json - 프로젝트 종속성 및 스크립트
  • tsconfig.json - TypeScript 구성

용법

건물과 운영

서버를 빌드하고 시작합니다.

npm start

이렇게 하면 TypeScript 코드가 컴파일되고 MCP 서버가 시작됩니다.

개발

개발을 위해 다음을 수행할 수 있습니다.

  1. index.ts 수정하여 나만의 도구를 추가하세요.
  2. 빌드 명령을 실행하여 컴파일합니다.
npm run build

사용자 정의 도구 만들기

새로운 도구를 만들려면 index.ts 에서 다음 패턴을 따르세요.

server.tool( "your-tool-name", { // Define input schema using Zod paramName: z.string(), // Add more parameters as needed }, async ({ paramName }) => ({ content: [{ type: "text", text: "Your tool's response" }] }) );

종속성

  • @modelcontextprotocol/sdk - 핵심 MCP SDK
  • zod - 스키마 검증
  • dotenv - 환경 변수 관리
  • typescript - 타입스크립트 컴파일러

특허

아이에스씨

기여하다

기여를 환영합니다! 풀 리퀘스트를 제출해 주세요.

-
security - not tested
F
license - not found
-
quality - not tested

AI 시스템과 통합할 수 있는 맞춤형 모델 컨텍스트 프로토콜 서버를 생성하기 위한 기반으로, 간단한 BMI 계산기 도구를 구현 사례로 제공합니다.

  1. Overview
    1. Prerequisites
      1. Installation
        1. Project Structure
          1. Usage
            1. Building and Running
            2. Development
          2. Creating Custom Tools
            1. Dependencies
              1. License
                1. Contributing
                  ID: 50o10f60hi