Skip to main content
Glama
legotec73

MCP Server Example

by legotec73

MCP Server Example

基于 Node.js / Express / TypeScript 的 MCP(Model Context Protocol)服务器

运行方法

本地运行

npm install
npm run build
npm start

# 인증 토큰과 함께 실행
TOKEN=your_token npm start

Docker 运行

docker build -t mcp-server-node .
docker run -p 3000:3000 -e TOKEN=your-secret-token mcp-server-node

Related MCP server: CloudTypeJ MCP Server

部署

Cloudtype

  1. 选择模板:MCP Server - Node.js

  1. 部署

  • Node v22

  • 环境变量 TOKEN:设置用于认证的令牌(认证时使用的令牌)

  • 构建命令 npm run build

  • 启动命令 npm start

  1. 确认连接信息

    MCP 连接地址 - https://<已部署的预览域名地址>/mcp

  1. 更新 代码提交并推送后,在 设置 选项卡中点击 部署 按钮进行部署

YouTube 指南

部署自动化

认证

使用 Bearer 令牌认证:

  • 环境变量:TOKEN

  • 请求头:Authorization: Bearer your-token

支持的工具

  • user_list - 查询用户列表

  • user_statistics - 查询用户指标

  • calculator - 计算器示例

  • create_task:创建任务

  • complete_task:完成任务

  • list_tasks:查询任务列表

环境变量

  • TOKEN:Bearer 令牌(必需)

使用方法

Porter AI

问题解决

License

MIT License

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A Node.js MCP server providing user management, task management, and calculator tools with Bearer token authentication, deployable on Cloudtype.
    17 npm
    5
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server providing calculator, user list, and statistics tools with Bearer Token authentication.
    304 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Node.js MCP server example with user management, task management, and calculator tools. Supports authentication via bearer token and can be deployed locally or via Docker.
    17 npm
    MIT