Skip to main content
Glama

generic-mcp-server

일반 MCP 서버 템플릿

사용자 정의 및 확장이 용이하도록 설계된 모듈식 확장 가능 모델 컨텍스트 프로토콜(MCP) 서버 템플릿입니다.

특징

  • 모듈형 아키텍처 : 명확하게 정의된 구조를 통해 관심사를 명확하게 분리
  • 작고 집중된 파일 : 유지 관리가 더 쉽고 AI가 수집하기 더 쉽습니다.
  • 간편한 확장 포인트 : 새로운 도구와 서비스를 추가하기 위한 간단한 패턴
  • 포괄적인 오류 처리 : 코드베이스 전체에 걸친 강력한 오류 관리
  • 유형 안전성 : 적절한 타이핑을 통한 전체 TypeScript 지원

프로젝트 구조

지엑스피1

시작하기

필수 조건

  • Node.js 18 이상
  • npm 또는 yarn

설치

  1. 이 저장소를 복제하세요:
    git clone https://github.com/v4lheru/generic-mcp-template.git cd generic-mcp-template
  2. 종속성 설치:
    npm install
  3. .env.example 기반으로 .env 파일을 만듭니다.
    cp .env.example .env
  4. API 키와 구성을 사용하여 .env 파일을 편집합니다.

건물과 운영

  1. 프로젝트를 빌드하세요:
    npm run build
  2. 서버를 실행합니다:
    npm start

템플릿 확장

새로운 서비스 추가

  1. src/services/ 에 새로운 서비스 파일을 만듭니다.
    // src/services/my-service.ts import { BaseService } from './base-service.js'; import config from '../config.js'; export class MyService extends BaseService { // Implement your service... }
  2. src/types/ 에 필요한 유형을 추가합니다.

새로운 도구 추가

  1. 새 파일에 도구를 정의하거나 src/tools/ 에 있는 기존 도구를 확장합니다.
    // src/tools/my-tools.ts export const myTools = [ { name: "my_tool", description: "Description of my tool", inputSchema: { // JSON Schema for the tool's input } } ];
  2. 도구에 대한 핸들러를 구현합니다.
    // src/tools/my-tool-handlers.ts import { MyService } from '../services/my-service.js'; export function createMyToolHandlers(myService: MyService) { return { my_tool: async (args: any) => { // Implement your tool handler } }; }
  3. src/index.ts 에 도구와 핸들러를 등록합니다.

구성

이 템플릿은 src/config.ts 의 중앙 집중식 구성 시스템을 사용합니다. 구성은 다음을 통해 제공될 수 있습니다.

  • 환경 변수
  • 명령줄 인수( --env KEY=VALUE 사용)
  • 코드의 기본값

오류 처리

템플릿에는 포괄적인 오류 처리가 포함되어 있습니다.

  • 속도 제한 지원을 통한 서비스 수준 오류 처리
  • 적절한 오류 메시지를 통한 도구 수준 오류 처리
  • MCP 프로토콜 오류 처리

특허

MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

AI와 함께 사용하여 모든 서비스에 대한 서버를 쉽게 만들 수 있는 프레임워크입니다. API 문서를 넣고 MCP 생성을 요청하기만 하면 됩니다.

  1. 특징
    1. 프로젝트 구조
      1. 시작하기
        1. 필수 조건
        2. 설치
        3. 건물과 운영
      2. 템플릿 확장
        1. 새로운 서비스 추가
        2. 새로운 도구 추가
      3. 구성
        1. 오류 처리
          1. 특허

            Related MCP Servers

            • A
              security
              F
              license
              A
              quality
              An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
              Last updated -
              39
              28
              • Apple
            • -
              security
              A
              license
              -
              quality
              An MCP server that connects to a Swagger specification and helps an AI to build all the required models to generate a MCP server for that service.
              Last updated -
              19
              TypeScript
              MIT License
              • Linux
              • Apple
            • -
              security
              -
              license
              -
              quality
              This MCP server provides tools to interact with the Salesforce Agentforce API, allowing authentication, session creation, and message exchange with Salesforce agents.
              Last updated -
              1
              Python
            • A
              security
              F
              license
              A
              quality
              An MCP server that allows AI assistants to interact with the ServiceTitan API, requiring client credentials for authentication.
              Last updated -
              454
              TypeScript

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/v4lheru/generic-mcp-template'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server