Cursor IDE 的 MCP 服务器模板
一个使用模型上下文协议 (MCP) 为 Cursor IDE 创建自定义工具的简单模板。您可以使用此模板创建自己的代码库,修改工具并将其连接到您的 Cursor IDE。
快速入门
- 点击“部署到 Heroku”按钮
- 部署完成后,配置Cursor:
- 打开游标设置 → 功能
- 添加新的 MCP 服务器
- 使用带有
/sse
路径的 Heroku URL(例如https://<your-app-name>.herokuapp.com/sse
)
- 在 Cursor 中测试您的代理的心情:
- 询问您的代理“请询问我们的服务器状况并让我知道情况如何。”
- 服务器将回复一条欢快的消息和一颗心❤️
替代设置方法
您可以通过三种方式运行服务器:使用 Docker、传统 Python 设置或直接在 Cursor IDE 中运行。
Docker 设置
该项目包括 Docker 支持,可轻松部署:
- 初始设置:
- 使用 Docker Compose 构建并运行:
- 该服务器将在以下位置可用:
- SSE 端点: http://localhost:8000/sse
- 快速测试:
- 连接到 Cursor IDE:
- 打开游标设置 → 功能
- 添加新的 MCP 服务器
- 类型:选择“sse”
- 网址:输入
http://localhost:8000/sse
传统设置
首先,安装 uv 包管理器:
使用 stdio(默认)或 SSE 传输启动服务器:
安装完成后,您可以将服务器直接连接到Cursor IDE:
- 在 Cursor 中右键单击
cursor-run-mcp-server.sh
文件 - 选择“复制路径”复制绝对路径
- 打开光标设置(齿轮图标)
- 导航至“功能”选项卡
- 向下滚动到“MCP 服务器”
- 点击“添加新的 MCP 服务器”
- 填写表格:
- 名称:选择任意名称(例如“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
- 用于网站抓取的自定义用户代理
附加选项
通过 Smithery 安装
要通过Smithery自动安装用于 Claude Desktop 的 Cursor IDE 的 MCP 服务器模板:
Glama 服务器评论
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
使用模型上下文协议 (MCP) 为 Cursor IDE 创建自定义工具的模板,允许开发人员使用他们自己的基于服务器的工具扩展 Cursor 的功能。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA simple template for creating custom tools for Cursor IDE using Model Context Protocol, deployable via Heroku, Docker, or directly within Cursor IDE.Last updated -2PythonMIT License
- AsecurityAlicenseAqualityA template for creating and connecting custom tools to Cursor IDE using Model Context Protocol with support for cheerful server responses.Last updated -41PythonMIT License
- AsecurityAlicenseAqualityA template for creating custom tools for Cursor IDE using Model Context Protocol that allows users to deploy their own MCP server to Heroku and connect it to Cursor IDE.Last updated -21PythonMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server for Cursor IDE that simplifies the installation and configuration of other MCP servers.Last updated -88223JavaScriptMIT License
Appeared in Searches
- Installing MCP (Minecraft Coder Pack) servers into an IDE
- Setting Up MCP (Minecraft Control Panel or Related Tool) Helper
- Performing Email-Related Operations in Python
- How to create a sandbox environment
- Most Popular MCPS (Microsoft Certified Professionals, Music Copyright Societies, or Montgomery County Public Schools)