Back to MCP directory
publicPublicdnsLocal runtime

multiplatform-cursor-mcp

Cursor MCP是一个连接Claude桌面应用与Cursor编辑器的桥梁工具,支持AI驱动的自动化编程、多窗口管理和跨平台操作,通过标准化协议实现与多种AI服务的集成。

article

README

🚀 Cursor-MCP

Cursor-MCP 是一款专为 Cursor 编辑器 打造的多功能插件框架。它集成了多种 AI 服务(如 Claude、ChatGPT)和代码分析工具(如 SonarQube),能为开发者带来实时代码建议、自动重构和高效项目管理等功能,无论你使用的是 macOS、Windows 还是 Linux 系统,都能显著提升编码体验。

🚀 快速开始

初始化插件

class MyMCPPlugin {
  constructor() {
    // 注册事件监听器
    this.registerEvents();
  }

  registerEvents() {
    // 监听文件变化事件
    mcp.on('fileChange', (event) => {
      console.log('检测到文件变化:', event);
    });
  }
}

配置插件

在项目根目录创建 mcp.config.js

module.exports = {
  enabled: true,
  plugins: ['my-plugin', 'another-plugin'],
  aiServices: {
    claude: {
      apiKey: 'your-claude-key',
      version: '2'
    },
    chatgpt: {
      apiKey: 'your-chatgpt-key',
      model: 'gpt-4'
    }
  },
  codeAnalysis: {
    sonarqube: {
      url: 'http://localhost:9000',
      token: 'your-sonar-token'
    }
  }
};

开发插件

创建自定义插件:

class MyCustomPlugin extends mcp.Plugin {
  initialize() {
    super.initialize();
    this.registerCommand('my-command', (context) => {
      // 自定义逻辑
    });
  }
}

✨ 主要特性

  • AI 集成:与 Claude 和 ChatGPT 等先进 AI 服务无缝连接
  • 代码分析:支持 SonarQube 等工具进行静态代码检查
  • 跨平台支持:适用于 macOS、Windows 和 Linux 系统
  • 插件架构:可扩展的模块化设计,方便添加更多功能
  • 高效集成:提供 CLI 工具和语言支持(如 TypeScript)

📦 安装指南

通过 npm 安装

npm install cursor-mcp

手动安装

  1. 下载最新版本的 Cursor-MCP: 下载链接

  2. 解压文件并复制 cursor-mcp 到你的 Node.js 模块目录。

  3. 在项目中引入:

const mcp = require('cursor-mcp');

💻 使用示例

基础用法

mcp.on('codeRequest', async (event) => {
  const response = await mcp.sendToAI(event.content);
  console.log('AI 建议:', response.suggestions);
});

高级用法

mcp.runRefactor({
  file: 'src/component.tsx',
  selection: '// 选择的代码区域',
  type: 'extract-function'
}).then(result => {
  console.log('重构完成:', result.code);
});

📚 详细文档

教程系列

  1. 入门教程快速上手指南
  2. 高级功能插件开发文档

视频教程

社区资源

支持与贡献

问题反馈

贡献指南

欢迎贡献!请参考我们的 Contributing Guide

🔧 技术细节

  • 文件监控:实时跟踪项目目录中的文件变化。
  • AI 集成:将 AI 服务整合到开发流程中,提供智能建议。
  • 代码分析:集成 SonarQube 等工具进行代码质量检查。

📄 许可证

本项目遵循 MIT 协议。更多信息请查看 LICENSE 文件。


通过 Cursor-MCP,开发者可以更高效、智能地进行编码,享受现代化的开发体验。立即开始使用,提升你的编码效率!

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client