MCP Proxy Sidecar

Integrations

  • Enables interaction with JetBrains IDEs, allowing commands to be sent to the IDE and responses to be received, with real-time monitoring of tool calls through WebSocket notifications.

MCP 代理边车

JetBrains MCP Server的一个分支,添加了 WebSocket 监控功能,由@dortegau创建。

该项目通过 WebSocket 支持扩展了原始 MCP 服务器功能,同时保持与原始实现的所有功能的兼容性。

建筑学

上图说明了系统架构和数据流:

  1. MCP 客户端(例如 Claude 桌面应用程序)使用 MCP 协议与 Sidecar 进行通信
  2. Sidecar 转换命令并将其转发到 JetBrains IDE
  3. IDE 的响应通过 Sidecar 发送回来
  4. 所有工具调用均通过 WebSocket 广播,以进行监控

特征

此分支添加了 WebSocket 通知,允许您实时监控所有 MCP 工具调用。每个工具调用都会通过 WebSocket 广播,其中包含有关端点和参数的详细信息。

WebSocket 消息格式

interface MCPNotification { type: 'mcp-notification'; payload: { endpoint: string; // Tool name that was called content: any; // Call arguments timestamp: string; // ISO timestamp } }

WebSocket 配置

WebSocket 服务器默认运行在 27042 端口。你可以在配置中使用WS_PORT环境变量自定义此端口:

"env": { "WS_PORT": "<custom port number>" // Example: "8080" }

用法

安装 MCP 服务器插件

https://plugins.jetbrains.com/plugin/26071-mcp-server

与 Claude Desktop 一起使用

要将其与 Claude Desktop 一起使用,请将以下内容添加到claude_desktop_config.json 。MacOS 上的完整路径为: ~/Library/Application\ Support/Claude/claude_desktop_config.json ,Windows 上的完整路径为: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "ide": { "command": "npx", "args": ["-y", "mcp-proxy-sidecar"], "env": { "WS_PORT": "27042" // Optional: customize WebSocket port } } } }

配置选项

您可以在claude_desktop_config.json中配置以下环境变量:

多变的描述默认
WS_PORTWebSocket 服务器端口27042
IDE_PORTIDE 连接的特定端口自动扫描 63342-63352
HOSTIDE 连接的主机地址127.0.0.1
LOG_ENABLED启用调试日志记录false

包含所有选项的示例配置:

{ "mcpServers": { "ide": { "command": "npx", "args": ["-y", "mcp-proxy-sidecar"], "env": { "WS_PORT": "27042", "IDE_PORT": "63342", "HOST": "127.0.0.1", "LOG_ENABLED": "true" } } } }

注意:如果未指定IDE_PORT ,sidecar 将自动扫描端口 63342-63352 来查找 IDE。

发展

要求

  • Node.js 20.x
  • pnpm(最新版本)

建造

  1. 安装依赖项:
    pnpm install --frozen-lockfile
  2. 构建项目:
    pnpm build

贡献

  1. 分叉存储库
  2. 创建你的功能分支( git checkout -b feature/amazing-feature
  3. 提交您的更改( git commit -m 'Add some amazing feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求

出版

该软件包已发布到 npm,其中包含:

  • 溯源功能可确保供应链安全
  • 创建新版本时通过 GitHub Actions 自动发布
  • npm 注册表上的公共访问

要发布新版本:

  1. 更新 package.json 中的版本
  2. 创建并推送与版本匹配的新标签
  3. 从标签创建 GitHub 版本
  4. 工作流程将自动构建并发布到 npm

变更日志

1.0.0

  • 来自 @jetbrains/mcp-proxy 的初始分支
  • 增加了 WebSocket 支持,用于实时工具调用监控
  • 为清晰起见,重命名包
  • 更新的文档和配置示例

致谢

这是JetBrains MCP 代理服务器的一个分支。所有原创实现的功劳都归于 JetBrains 团队。

-
security - not tested
A
license - permissive license
-
quality - not tested

修改后的 JetBrains MCP Server,增加了 WebSocket 监控功能,让用户可以实时监控 MCP 工具调用,同时保持与原有实现的兼容性。

  1. Architecture
    1. Features
      1. WebSocket Message Format
      2. WebSocket Configuration
    2. Usage
      1. Install MCP Server Plugin
      2. Usage with Claude Desktop
      3. Configuration Options
    3. Development
      1. Requirements
      2. Build
      3. Contributing
      4. Publishing
    4. Changelog
      1. 1.0.0
    5. Credits
      ID: 7dbjlsp75c