MCP服务器模板系统

一个用于快速创建、部署和管理MCP(Model Context Protocol)服务器的单仓库模板系统,支持多种部署目标和语言。

  • by armanisadeghi
  • Shell
  • 本地部署
  • 更新于
在 GitHub 查看 armanisadeghi/matrx-mcp-template

使用说明

AI Matrx MCP Factory

A monorepo template system for rapidly creating, deploying, and managing MCP (Model Context Protocol) servers. Spin up new MCPs in minutes with a single command.

Architecture

Three-target deployment strategy:

Tier Platform Best For Cost
Cloudflare Workers Edge, global Stateless utilities (SEO tools, text processing, formatters) Free–$5/mo
VPS + Coolify Docker containers Stateful services (DB access, long-running ops, complex logic) ~$7–15/mo
AWS App Runner Managed Docker containers AWS-adjacent tools, workload identity, managed replacement and scaling Usage-based with provisioned baseline

All targets support Python (FastMCP) and/or TypeScript (official MCP SDK) as described below. The canonical agent and operations contract is common-docs/systems/mcp-hosting/FEATURE.md.

Quick Start

# Create a new MCP
./generators/create-mcp.sh \
  --name "my-cool-tool" \
  --lang python \
  --tier cloudflare \
  --auth apikey \
  --description "A tool that does something useful"

# Output: ./mcps/my-cool-tool/ (ready to develop and deploy)

Generator Options

Flag Required Values Default
--name Yes Display name —
--lang Yes python | typescript —
--tier Yes cloudflare | vps | aws —
--auth No none | apikey | supabase apikey
--db No none | supabase | postgres none
--description No String "An MCP server"
--separate-repo No Flag false

Repository Structure

matrx-mcp-template/
├── generators/          # MCP scaffolding scripts and templates
│   ├── create-mcp.sh   # Main generator CLI
│   └── templates/       # Template files for each lang+tier combo
├── shared/              # Reusable auth, DB, and logging modules
│   ├── python/
│   └── typescript/
├── examples/            # Working example MCPs (copy & modify)
├── docs/                # Deployment and usage guides
├── infrastructure/      # VPS and Coolify setup configs
└── mcps/                # Generated MCPs land here (gitignored)

Authentication

Three levels, chosen per-MCP:

  • None — Public utilities, no token needed
  • API Key — Shared secret in Authorization: Bearer {key} header
  • Supabase JWT — User-scoped access via JWT pass-through

Transport

All MCPs use Streamable HTTP (current MCP spec standard). Each MCP exposes its endpoint at /mcp.

Deployment

Cloudflare Workers

cd mcps/my-tool/
wrangler deploy
# Available at: https://my-tool.your-account.workers.dev/mcp

VPS + Coolify

Push to GitHub → Coolify auto-deploys via Docker Compose → Available at my-tool.mcp.yourdomain.com/mcp

AWS App Runner

./generators/create-mcp.sh --name "My Tool" --lang typescript --tier aws --separate-repo
cd mcps/my-tool
./deploy-aws.sh --create
# The verified AWS-managed HTTPS /mcp URL is printed after health succeeds.

AWS uses immutable ECR images, stateless Streamable HTTP, App Runner health replacement and an IAM runtime role. It does not create or change DNS.

Documentation

Examples

Example Tier Language Auth Description
meta-tag-checker Cloudflare Python None SEO meta tag analysis
pdf-tools Cloudflare Python API Key PDF manipulation utilities
bug-tracker VPS TypeScript Supabase JWT Bug tracking with DB
virtual-tables VPS Python Supabase JWT Dynamic user data tables