MCP协议服务器

生产就绪的Model Context Protocol服务器,支持OAuth、日志记录和安全功能。

  • by anatoly314
  • TypeScript
  • 本地部署
  • 4 星标
  • 更新于
在 GitHub 查看 anatoly314/mcp-server-sandbox

使用说明

MCP服务器启动器

具有OAuth、日志记录和安全性的生产就绪模型上下文协议服务器。

特性

  • ✅ 具有HTTP/SSE和stdio传输的MCP服务器
  • ✅ OAuth 2.0与动态客户端注册(办事员)
  • ✅ IP过滤、电子邮件过滤、结构化日志记录
  • ✅ TypeScript,模块化架构
  • ✅ Docker支持

快速开始

# Install
git clone https://github.com/anatoly314/mcp-server-starter.git
cd mcp-server-starter
pnpm install

# Configure
cp .env.http.example .env.http
# Edit .env.http with your settings

# Run
pnpm run dev:http

服务器运行于 http://localhost:3000

环境变量

必需

  • PUBLIC_URL -在您的服务器可访问的情况下(例如。, http://localhost:3000)

OAuth(可选)

  • AUTH_ENABLED=true -启用OAuth
  • OAUTH_ISSUER_URL -OAuth提供者URL(例如,Clerk域)
  • SERVICE_DOCUMENTATION_URL -链接到您的文档

安全(可选)

  • FILTER_BY_IP -逗号分隔的IPs/CIDR范围
  • ALLOWED_EMAILS -逗号分隔的电子邮件白名单

延伸

在中添加您的功能 /src/mcp/primitives/:

  • tools/ -MCP工具
  • resources/ -MCP资源
  • prompts/ -MCP提示

部署

码头工人

docker build -t mcp-server .
docker run -p 3000:3000 --env-file .env.http mcp-server

克劳德桌面

看 CLAUDE_DESKTOP_SETUP.md

OAuth与办事员

看 CLERK_SETUP.md

许可证

麻省理工学院