Skip to main content
Glama

유틸리티 MCP 서버

유틸리티 도구, 리소스 및 프롬프트를 제공하는 완전한 기능을 갖춘 MCP(Model Context Protocol) 서버입니다. TypeScript와 최신 MCP SDK로 구축되었습니다.

📁 프로젝트 구조

이 프로젝트는 확장성과 가독성을 고려하여 구성되었습니다:

.
├── index.ts              # Entry point: Initializes server and registers modules
├── src/
│   ├── tools.ts          # Tool handlers (Arithmetic, Randomness, Sampling)
│   ├── prompts.ts        # Prompt templates (Math Tutoring)
│   └── resources.ts      # Resource definitions (System Status)
├── tests/
│   └── utility.test.ts   # Comprehensive unit tests
├── package.json          # Dependencies and scripts
├── tsconfig.json         # TypeScript configuration
└── jest.config.js        # Testing configuration

Related MCP server: MCP Server TypeScript

🚀 기능

1. 도구

  • random_number: 지정된 범위 내에서 난수를 생성합니다.

  • calculator: 기본적인 산술 연산(add, subtract, multiply, divide)을 수행합니다.

  • suggest_arithmetic_task: 클라이언트/LLM에 창의적인 수학 문제를 생성하도록 요청하여 LLM 샘플링을 시연합니다.

2. 리소스

  • system_status (utility://system/status): 서버의 상태와 기능 개수에 대한 실시간 업데이트를 제공합니다.

3. 프롬프트

  • math_tutor: LLM이 수학 교사 역할을 하도록 안내하는 템플릿으로, 특정 주제에 집중하도록 설정할 수 있습니다.


📡 API 호출 (Postman / JSON-RPC)

Model Context Protocol은 JSON-RPC 2.0을 사용합니다. 현재 이 서버는 stdio(표준 입출력)를 통해 실행되지만, HTTP/SSE 브리지를 통해 노출하거나 디버거를 사용하는 경우 이러한 메시지 형식을 사용하여 상호 작용할 수 있습니다.

🛠 도구

도구 목록 조회

요청:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

calculator 호출

요청:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "calculator",
    "arguments": {
      "operation": "multiply",
      "a": 5,
      "b": 10
    }
  }
}

📖 리소스

리소스 목록 조회

요청:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "resources/list"
}

system_status 읽기

요청:

{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "resources/read",
  "params": {
    "uri": "utility://system/status"
  }
}

📝 프롬프트

프롬프트 목록 조회

요청:

{
  "jsonrpc": "2.0",
  "id": 5,
  "method": "prompts/list"
}

math_tutor 프롬프트 가져오기

요청:

{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "prompts/get",
  "params": {
    "name": "math_tutor",
    "arguments": {
      "topic": "algebra"
    }
  }
}

🛠 개발

설정

npm install

서버 실행

npm start

테스트 실행

npm test

🤖 커스텀 클라이언트 사용

프로그래밍 방식으로 연결하는 방법을 확인할 수 있도록 내장 클라이언트 예제를 포함했습니다:

npm run client

이 스크립트는 다음을 수행합니다:

  1. 서버를 자식 프로세스로 생성합니다.

  2. Stdio를 통해 연결합니다.

  3. 도구 목록 조회, 계산기 호출, 리소스 읽기를 자동으로 시연합니다.

🔍 MCP Inspector로 테스트

시각적으로 서버와 상호 작용하려면 다음을 사용하세요:

npx @modelcontextprotocol/inspector npx tsx index.ts

[!IMPORTANT] 이 서버는 Stdio 전송을 사용합니다. stdin 및 stdout을 통해 통신합니다. Postman이 HTTP를 통해 작동하려면 서버 구성에 SSE(Server-Sent Events) 전송 계층을 추가해야 합니다.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A TypeScript MCP server implementation using Express.js that provides basic tools like echo, time retrieval, and calculator functionality. Features session management, RESTful API endpoints, and Server-Sent Events for streamable communication.
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A production-ready TypeScript MCP server providing basic tools (add, echo, timestamp), resources (server info, greetings, data access), and prompt templates (analyze, code-review, summarize). Serves as a foundation for building custom MCP servers with extensible architecture.
    284 npm
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A lightweight TypeScript-based MCP server that demonstrates how to build custom MCP tools by implementing a simple addition calculator. Serves as a starting point for building MCP-compatible tools.
    2,859 npm
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A calculator-focused MCP server with TypeScript and Zod validation, providing tools, resources, and prompts for basic arithmetic operations.
    -