Skip to main content
Glama
jhgaylor

Express MCP Server Echo

by jhgaylor

익스프레스 MCP 서버

Express와 TypeScript로 구축된 상태 비저장 모델 컨텍스트 프로토콜(MCP) 서버입니다.

특징

  • 최신 Streamable HTTP 전송을 통한 상태 비저장 MCP 서버 구현

  • 유형 안전을 위한 TypeScript

  • HTTP 처리를 위한 Express.js

Related MCP server: Echo MCP Server

요구 사항

  • 노드.js 18+

  • npm 또는 yarn

설치

지엑스피1

개발

# Build the TypeScript code
npm run build

# Run in development mode with auto-reloading
npm run dev

# Run tests (when added)
npm test

서버 구조

src/
  ├── index.ts                # Main application entry point
  └── server.ts               # MCP server definition with resource, tool, and prompt

사용 가능한 기능

이 서버는 세 가지 MCP 구성 요소를 사용하여 간단한 에코 엔드포인트를 구현합니다.

  • 리소스 : echo://{message} - 메시지를 리소스로 반환합니다.

  • 도구 : echo - 제공된 메시지를 도구 응답으로 다시 에코합니다.

  • 프롬프트 : echo - 제공된 메시지로 사용자 프롬프트를 생성합니다.

MCP 프로토콜

이 서버는 LLM이 외부 데이터 및 기능과 상호 작용하는 표준화된 방식인 모델 컨텍스트 프로토콜 (MCP)을 구현합니다. JSON-RPC 요청에 응답하는 상태 비저장 API 엔드포인트를 제공합니다.

API 사용

JSON-RPC 페이로드를 사용하여 /mcp 에 POST 요청을 보냅니다.

초기화

curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {
        "roots": {
          "listChanged": true
        },
        "sampling": {}
      },
      "clientInfo": {
        "name": "ExampleClient",
        "version": "1.0.0"
      }
    }
  }'

에코 도구 호출

curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "echo",
      "arguments": {
        "message": "Hello, World!"
      }
    },
    "id": 1
  }'

특허

아이에스씨

Related MCP Connectors

Related MCP Servers

  • A
    license
    D
    quality
    D
    maintenance
    A minimal Model Context Protocol server in TypeScript that demonstrates MCP-compliant resources and tools for LLMs, featuring simple resources and a basic tool that echoes messages or returns greetings.
    1
    5
    Apache 2.0