MCP cover image
See in Github
2025-04-07

1

Github Watches

0

Github Forks

0

Github Stars

CF-MCP-Server

License: MIT Cloudflare Workers

基于 Model Context Protocol (MCP) 的图像生成服务实现,采用 Cloudflare Workers 构建。

核心功能

  • 🖼️ 基于 MCP 协议的标准化服务接口
  • 🚀 开箱即用的图像生成 Worker 模块
  • 🔧 支持快速扩展自定义工具和资源
  • ⚡ 边缘计算优化部署

模块构成

mcp-image-generation

graph LR
    subgraph mcp-image-generation
    A[Cloudflare Worker] --> B[Flux-1-Schnell 模型]
    A --> C[图像生成API]
    C --> D((4-8 steps))
    end
  • 支持步骤数范围:4-8 steps
  • 响应格式:Base64 编码的 PNG 图像
  • 部署方式:Cloudflare Workers

快速开始

环境要求

  • Node.js 18+
  • Wrangler CLI
  • NPM

安装部署

# 安装依赖
pnpm install

# 配置环境变量
cp .env.example .env

# 部署Worker
pnpm deploy

API 文档

图像生成接口

配置示例:

{
  "mcpServers": {
    "generateImage": {
      "command": "/Users/zhangxudong/Gits/turinhub/cf-mcp-server/mcp-image-generation/node_modules/.bin/workers-mcp",
      "args": [
        "run",
        "generateImage",
        "https://mcp-image-generation.turinhub.com",
        "/Users/zhangxudong/Gits/turinhub/cf-mcp-server/mcp-image-generation"
      ],
      "env": {}
    }
  }
}

参数说明:

参数 类型 约束 说明
prompt string 1-500字符 英文描述提示词
steps number 4 ≤ steps ≤ 8 生成迭代步数

开发指南

添加新工具

参考在线文档 官方案例代码库

  1. 使用 MCP SDK 创建新 Worker:
npx create-cloudflare@latest my-new-worker
cd my-new-worker # I always forget this bit
npm install workers-mcp
npx workers-mcp setup

注意:不要在项目本地 package.json 安装 wrangler,直接使用全局管理。

  1. 实现工具逻辑后更新主服务配置
  2. 使用 @modelcontextprotocol/inspector 测试 MCP
npx @modelcontextprotocol/inspector

贡献说明

欢迎通过 Issue 和 PR 参与贡献,请遵循现有代码风格。

许可证

MIT License © 2025 Turinhub

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • modelcontextprotocol
  • 模型上下文协议服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • n8n-io
  • 具有本机AI功能的公平代码工作流程自动化平台。将视觉构建与自定义代码,自宿主或云相结合,400+集成。

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

    Reviews

    2 (1)
    Avatar
    user_Dk0G9TDj
    2025-04-18

    I've been using the cf-mcp-server by turinhub and it's fantastic for my needs. The setup process was straightforward and the documentation on GitHub is clear and comprehensive. Performance-wise, it excels in managing server tasks efficiently. Highly recommend to anyone who needs a reliable MCP application. Great job, turinhub!