Back to MCP directory
publicPublicdnsLocal runtime

demo-mcp-server-w3e

一个演示用的MCP服务器Blocklet项目

article

README

🚀 示例 MCP 服务器块

本项目是一个演示块,用于托管 MCP 服务器。借助此项目,可快速搭建并运行 MCP 服务器,实现身份验证和授权等功能。它使用 Create Blocklet 创建,是一个全栈应用程序,涵盖 serverclient 代码。

🚀 快速开始

需求版本

  • Node.js 版本:>= 20.14.0
  • 服务端版本:>= 1.16.28

块作为 MCP 服务器

  • 设置 blocklet.yml#capabilities.mcptrue
  • api/src/mcp/server.ts 中设置你的 MCP 服务器。
  • api/src/mcp/sse.ts 中配置 SSE 传输,端点必须为 /mcp/sse
  • 将 MCP 服务器附加到应用程序中,在 api/src/index.ts
  • 使用 此链接 调试你的 MCP 服务器。

📄 许可证

代码根据 Apache 2.0 许可证发布,许可证内容见 LICENSE 文件。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client