M

MCP Heroku 服务器部署模板

@MyBlockcities/mcp-server-heroku
0 Stars 386 次浏览 MyBlockcities 更新于 2026-08-23

# 翻译 一个使用Model Context Protocol为Cursor IDE创建自定义工具的模板,允许用户将他们自己的MCP服务器部署到Heroku并将其连接到Cursor IDE。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

MCP Server 模板用于 Cursor IDE

使用 Model Context Protocol (MCP) 为 Cursor IDE 创建自定义工具的简单模板。从这个模板创建你自己的仓库,修改工具,并将它们连接到你的 Cursor IDE。

Server Mood Response

快速开始

  1. 点击“Deploy to Heroku”按钮

    Deploy to Heroku

  2. 部署后,配置 Cursor:

    • 打开 Cursor 设置 → 功能
    • 添加新的 MCP 服务器
    • 使用带有 /sse 路径的你的 Heroku URL(例如,https://<your-app-name>.herokuapp.com/sse
  3. 在 Cursor 中测试代理的情绪:

    • 向您的代理询问:“请询问我们的服务器情绪并告诉我情况如何。”
    • 服务器将以愉快的消息和一颗心 ❤️ 回应

替代设置方法

你可以通过三种方式运行服务器:使用 Docker、传统的 Python 设置或直接在 Cursor IDE 中。

Docker 设置

项目包括 Docker 支持以便于部署:

  1. 初始设置:
# Clone the repository
git clone https://github.com/kirill-markin/weaviate-mcp-server.git
cd weaviate-mcp-server

# Create environment file
cp .env.example .env
  1. 使用 Docker Compose 构建和运行:
# Build and start the server
docker compose up --build -d

# View logs
docker compose logs -f

# Check server status
docker compose ps

# Stop the server
docker compose down
  1. 服务器将在以下位置可用:

    • SSE 端点:http://localhost:8000/sse
  2. 快速测试:

# Test the server endpoint
curl -i http://localhost:8000/sse
  1. 连接到 Cursor IDE:
    • 打开 Cursor 设置 → 功能
    • 添加新的 MCP 服务器
    • 类型:选择 "sse"
    • URL:输入 http://localhost:8000/sse

传统设置

首先,安装 uv 包管理器:

# Install uv on macOS
brew install uv
# Or install via pip (any OS)
pip install uv

使用 stdio(默认)或 SSE 传输启动服务器:

# Install the package with development dependencies
uv pip install -e ".[dev]"

# Using stdio transport (default)
uv run mcp-simple-tool

# Using SSE transport on custom port
uv run mcp-simple-tool --transport sse --port 8000

# Run tests
uv run pytest -v

安装后,你可以直接将服务器连接到 Cursor IDE:

  1. 在 Cursor 中右键点击 cursor-run-mcp-server.sh 文件
  2. 选择“复制路径”以复制绝对路径
  3. 打开 Cursor 设置(齿轮图标)
  4. 导航到功能选项卡
  5. 向下滚动到“MCP 服务器”
  6. 单击“添加新的 MCP 服务器”
  7. 填写表单:
    • 名称:选择任何名称(例如,“my-mcp-server-1”)
    • 类型:选择“stdio”(不是“sse”,因为我们本地运行服务器)
    • 命令:粘贴您之前复制的 cursor-run-mcp-server.sh 的绝对路径。例如:/Users/kirillmarkin/weaviate-mcp-server/cursor-run-mcp-server.sh

环境变量

可用的环境变量(可以在 .env 中设置):

  • MCP_SERVER_PORT(默认:8000)- 服务器运行的端口
  • MCP_SERVER_HOST(默认:0.0.0.0)- 服务器绑定的主机
  • DEBUG(默认:false)- 启用调试模式
  • MCP_USER_AGENT - 用于网站抓取的自定义 User-Agent

其他选项

通过 Smithery 安装

smithery 徽章

要通过 Smithery 自动为 Claude Desktop 安装 MCP Server 模板:

npx -y @smithery/cli install @kirill-markin/example-mcp-server --client claude

Glama 服务器审查

相关 MCP 服务