Skip to main content
Glama

Express MCP Server Echo

by jhgaylor

Express MCP 服务器

使用 Express 和 TypeScript 构建的无状态模型上下文协议 (MCP) 服务器。

特征

  • 采用现代 Streamable HTTP 传输的无状态 MCP 服务器实现
  • TypeScript 类型安全
  • 用于 HTTP 处理的 Express.js

要求

  • Node.js 18+
  • npm 或 yarn

安装

# Clone the repository (or download) git clone https://github.com/your-username/sample-express-mcp-server.git cd sample-express-mcp-server # Install dependencies npm install

发展

# 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 协议

该服务器实现了模型上下文协议(MCP),这是 LLM 与外部数据和功能交互的标准化方式。它公开了一个响应 JSON-RPC 请求的无状态 API 端点。

API 使用

/mcp发送一个带有 JSON-RPC 负载的 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 }'

执照

国际学习中心

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

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

无状态模型上下文协议服务器,通过资源、工具和提示组件实现简单的回显功能,使 LLM 能够通过标准化 MCP 交互回显消息。

  1. 特征
    1. 要求
      1. 安装
        1. 发展
          1. 服务器结构
            1. 可用功能
              1. MCP 协议
                1. API 使用
              2. 执照

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.
                  Last updated -
                  Python
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.
                  Last updated -
                  31
                  323
                  2
                  TypeScript
                  MIT License
                • A
                  security
                  A
                  license
                  A
                  quality
                  An educational implementation of a Model Context Protocol server that demonstrates how to build a functional MCP server for integrating with various LLM clients like Claude Desktop.
                  Last updated -
                  1
                  88
                  Python
                  MIT License
                  • Apple
                  • Linux
                • A
                  security
                  A
                  license
                  A
                  quality
                  A simple server implementing the Model Context Protocol (MCP) that echoes messages back, designed for testing MCP clients.
                  Last updated -
                  1
                  Python
                  MIT License

                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/jhgaylor/express-mcp-server-echo'

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