Skip to main content
Glama

일반 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

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    An MCP server that generates AI agent tools from Postman collections and requests. This server integrates with the Postman API to convert API endpoints into type-safe code that can be used with various AI frameworks.
    Last updated -
    13
    MIT License
  • -
    security
    A
    license
    -
    quality
    Generate an MCP server for any OpenAPI documented endpoint.
    Last updated -
    312
    MIT License
    • Apple
    • Linux
  • A
    security
    A
    license
    A
    quality
    A tool that creates MCP (Model Context Protocol) servers from OpenAPI/Swagger specifications, enabling AI assistants to interact with your APIs.
    Last updated -
    3
    37
    29
    MIT License
    • Apple
  • -
    security
    F
    license
    -
    quality
    An auto-generated MCP server that enables interaction with the OpenAI API, allowing users to access OpenAI's models and capabilities through the Multi-Agent Conversation Protocol.
    Last updated -

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