npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hoshikawashiro/ide-mcp-server

v1.0.9

Published

MCP Server for enhance IntelliJ IDEA abilities

Readme

TikTok IDE MCP Server

一个基于 MCP (Model Context Protocol) SDK 的服务器,用于与多个 IntelliJ IDEA 实例进行通信。

🚀 特性

  • 标准 MCP 协议: 使用官方的 MCP SDK,完全符合 MCP 协议标准
  • stdio 模式: 使用标准输入输出进行通信
  • 多实例支持: 自动发现和管理多个 IDE 实例
  • 智能路由: 根据项目路径自动路由到对应的 IDE 实例
  • 动态路径更新: 支持 IDE 中的 "Open Project" 操作
  • 实时状态监控: 自动检测实例活跃状态
  • 错误处理: 完善的错误处理和日志记录
  • 简化部署: 无需配置,直接运行

📦 安装

# 克隆项目
git clone <repository-url>
cd mcp-server

# 安装依赖
npm install

# 构建项目
npm run build

🎯 使用方法

启动 MCP 服务器

# 直接运行
node dist/index.js

# 或使用 npm 脚本
npm start

支持的 MCP 工具

1. show_popup

在指定的 IDE 实例中显示弹窗消息。

参数:

  • message (string): 要显示的消息内容
  • cwd (string): 项目工作目录路径

示例:

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tools/call",
  "params": {
    "name": "show_popup",
    "arguments": {
      "message": "Hello World!",
      "cwd": "/path/to/project"
    }
  }
}

2. list_instances

列出所有活跃的 IDE 实例。

参数:

示例:

{
  "jsonrpc": "2.0",
  "id": "2",
  "method": "tools/call",
  "params": {
    "name": "list_instances",
    "arguments": {}
  }
}

3. get_server_info

获取服务器信息。

参数:

示例:

{
  "jsonrpc": "2.0",
  "id": "3",
  "method": "tools/call",
  "params": {
    "name": "get_server_info",
    "arguments": {}
  }
}

测试服务器

# 运行基本功能测试
node test-mcp-client.js

# 测试弹窗功能
node test-show-popup.js

🔧 架构

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   MCP Client    │    │  MCP Server     │    │  IDE Instance   │
│                 │    │  (Node.js)      │    │  (IntelliJ)     │
│  - 发送请求      │───▶│  - stdio        │───▶│  - WebSocket    │
│  - 包含 cwd      │    │  - 实例发现      │    │  - 端口 31500+  │
│                 │    │  - 路由请求      │    │  - 处理 MCP      │
└─────────────────┘    └─────────────────┘    └─────────────────┘

🛠️ 开发指南

添加新的 MCP 工具

  1. mcp-server.tsregisterTools() 方法中添加工具定义
  2. CallToolRequestSchema 处理器中添加工具调用逻辑
  3. 实现对应的处理方法

自定义配置

  • 端口范围: 修改 Java 插件中的 MIN_PORTMAX_PORT
  • 文件前缀: 修改 PORT_FILE_PREFIX
  • 清理间隔: 修改清理定时器间隔

📊 性能考虑

  • 实例缓存减少文件 I/O
  • 连接池复用 WebSocket 连接
  • 异步处理避免阻塞
  • 定期清理防止内存泄漏

🔒 安全考虑

  • 仅监听 localhost
  • 实例文件存储在临时目录
  • 路径验证防止目录遍历
  • 超时机制防止资源耗尽

🚨 故障排除

常见问题

  1. 实例未找到: 检查 IDE 插件是否启动
  2. 连接失败: 检查端口是否被占用
  3. 权限错误: 检查临时目录权限

调试模式

# 启用详细日志
DEBUG=* node dist/index.js

📝 更新日志

v1.0.0

  • 重写使用标准 MCP SDK
  • 支持 stdio 通信
  • 实现三个核心工具:show_popup, list_instances, get_server_info
  • 完全兼容 MCP 协议标准