M

MCP服务器示例

@kirill-markin/example-mcp-server
0 Stars 392 次浏览 kirill-markin 更新于 2026-08-23

一个简单的MCP服务器,通过可配置的服务器平台促进网站抓取,使用stdio或SSE传输方式,允许与Cursor等工具集成,以实现简化访问。

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

服务介绍

MCP Server 模板用于 Cursor IDE

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

服务器心情响应

快速开始

  1. 点击“部署到 Heroku”按钮

    部署到 Heroku

  2. 部署完成后,配置 Cursor:

    • 打开 Cursor 设置 → 功能
    • 添加新的 MCP 服务器
    • 使用你的 Heroku URL 并加上 /sse 路径(例如: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 服务