MCP服务器部署工具

task-mcp-server是一个用于部署task-mcp MCP服务器到Google Cloud Run的工具,提供Docker配置、Cloud Run设置和部署自动化功能,并集成mcp-auth进行多租户认证。

  • by prmichaelsen
  • Shell
  • 本地部署
  • 更新于
在 GitHub 查看 prmichaelsen/task-mcp-server

使用说明

任务mcp服务器

@prmichaelsen/task-mcp mcp服务器的部署包装器。提供Docker配置、云运行设置和部署自动化,以便在生产环境中使用MCP-auth包装器运行MCP服务器。

概述

任务mcp服务器负责将任务mcp mcp服务器部署到Google Cloud Run。它使用@prmichaelsen/task-mcp库,并与mcp-auth集成以进行多租户身份验证。

特性

  • ✅ Docker容器化
  • ✅ 云运行部署配置
  • ✅ 支持多租户的mcp身份验证集成
  • ✅ 环境变量管理
  • ✅ 通过Cloud Build实现自动化部署
  • ✅ 健康检查端点
  • ✅ 具有严格类型检查的TypeScript

建筑

┌─────────────────────────────────────┐
│      task-mcp-server (Cloud Run)    │
│                                     │
│  ┌───────────────────────────────┐ │
│  │       mcp-auth wrapper        │ │
│  │   (multi-tenant auth)         │ │
│  └───────────────────────────────┘ │
│              │                      │
│              ▼                      │
│  ┌───────────────────────────────┐ │
│  │  @prmichaelsen/task-mcp       │ │
│  │  (MCP server library)         │ │
│  └───────────────────────────────┘ │
│              │                      │
└──────────────┼──────────────────────┘
               │
               ▼
        ┌─────────────┐
        │  Firestore  │
        └─────────────┘

先决条件

  • Node.js 20+
  • Docker(用于容器化)
  • 谷歌云帐户
  • 使用Firestore的Firebase项目
  • gcloud CLI(用于部署)

安装

# Clone repository
git clone https://github.com/prmichaelsen/task-mcp-server.git
cd task-mcp-server

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Edit .env with your configuration

环境变量

# Firebase Configuration
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_SERVICE_ACCOUNT_JSON={"type":"service_account",...}

# Server Configuration
NODE_ENV=production
LOG_LEVEL=info
PORT=8080

# mcp-auth Configuration (optional)
PLATFORM_URL=https://agentbase.me
PLATFORM_SERVICE_TOKEN=your-service-token
CORS_ORIGIN=https://agentbase.me

发展

# Run in development mode with hot reload
npm run dev

# Type check
npm run type-check

# Build for production
npm run build

# Run production build
npm start

部署

本地Docker测试

# Build Docker image
docker build -t task-mcp-server .

# Run container
docker run -p 8080:8080 --env-file .env task-mcp-server

# Test health check
curl http://localhost:8080/mcp/health

部署到云端运行

# Using Cloud Build (recommended)
gcloud builds submit --config cloudbuild.yaml

# Or deploy directly
gcloud run deploy task-mcp-server \
  --source . \
  --region us-central1 \
  --platform managed \
  --allow-unauthenticated

项目结构

task-mcp-server/
├── src/
│   └── index.ts          # Main server entry point
├── agent/                # ACP documentation
│   ├── design/           # Design documents
│   ├── milestones/       # Project milestones
│   ├── tasks/            # Task breakdowns
│   └── progress.yaml     # Progress tracking
├── dist/                 # Compiled JavaScript
├── Dockerfile            # Container configuration
├── cloudbuild.yaml       # Cloud Build config
├── package.json          # Project manifest
├── tsconfig.json         # TypeScript config
├── .env.example          # Environment template
└── README.md             # This file

文档

看 agent/ 目录:

  • 设计文件
  • 里程碑和任务
  • 进度跟踪
  • 发展模式

健康检查

服务器在以下位置提供健康检查端点 /mcp/health:

curl http://localhost:8080/mcp/health
# Response: {"status":"healthy"}

许可证

麻省理工学院

相关项目