MCP服务器调试工具

MCP Explorer是一个终端用户界面,用于开发、调试和测试MCP(模型上下文协议)服务器,提供会话代理调试、实时消息监控和动态表单工具测试等功能。

  • by kungfusheep
  • Go
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 kungfusheep/mcpview

使用说明

MCP浏览器

用于开发、调试和测试MCP(模型上下文协议)服务器的终端UI。

基于会话的代理调试•实时消息监控•使用动态表单进行工具测试•消息持久性

特性

  • 🔄 会话管理 -用于调试任何MCP设置的持久代理会话
  • 🔗 连接模式 -连接到正在运行的代理会话进行实时调试
  • 🛠️ 工具测试 -从JSON模式生成的动态参数表单
  • 🔍 调试模式 -使用拆分窗格界面进行实时消息监控
  • 💾 消息持久性 -跨连接保留会话历史记录
  • 📊 响应历程 -通过语法高亮显示浏览执行历史记录
  • ⚡ 实时 -使用时间戳实时查看MCP流量

安装

go install github.com/kungfusheep/mcpview@latest

或者从源代码构建:

git clone https://github.com/kungfusheep/mcpview
cd mcpview
go build -o mcpview .

用法

快速启动(直接连接)

# Interactive mode with connection prompt
mcpview

# Connect directly to an MCP server for testing
mcpview --server "python my_server.py"

# Debug mode with live message monitoring
mcpview --debug --server "npx @modelcontextprotocol/server-filesystem /"

代理调试工作流

调试MCP通信的最有效方法是使用代理会话:

# 1. Start a proxy session (creates a session like "aal-swift-0625-1234")
mcpview --proxy --target "python server.py"

# 2. In another terminal, attach to debug the session
mcpview --attach                    # Shows interactive session browser
mcpview --list-sessions            # Lists all active sessions

# 3. Configure your MCP client to connect through the proxy
# Replace "python server.py" with "mcpview --proxy --target 'python server.py'"

自定义会话管理:

# Named sessions for easier identification
mcpview --proxy --target "node server.js" --session "myapi"

# Custom session storage directory
mcpview --attach --sessions-dir ./debug-sessions

关键控件

会话列表: ↑↓/jk 导航• Enter 附加到会话• q 退出

会话查看器: ↑↓/jk 滚动消息• [/] 滚动详细信息• Esc 返回列表

工具测试: t 测试工具• r 资源• m 消息• d 调试模式• q 退出

实例

调试Claude桌面集成

# 1. Start proxy for your MCP server
mcpview --proxy --target "python ~/my-mcp-server/main.py"

# 2. Update Claude Desktop config to use the proxy:
# Change: "command": "python ~/my-mcp-server/main.py"
# To: "command": "mcpview --proxy --target 'python ~/my-mcp-server/main.py'

# 3. Attach to see all Claude ↔ Server communication
mcpview --attach

开发过程中的测试

# Direct connection for quick tool testing
mcpview --server "python my_server.py"

# Debug mode to see protocol messages while testing
mcpview --debug --server "npx @modelcontextprotocol/server-filesystem /Users/me/docs"

多服务器调试

# Start multiple proxy sessions
mcpview --proxy --target "python db_server.py"
mcpview --proxy --target "node fs_server.js"

# Attach to debug any session
mcpview --attach    # Choose which session to inspect

什么是MCP?

模型上下文协议 使应用程序能够以标准化的方式向LLM提供上下文。MCP Explorer通过提供对协议通信的可见性来帮助您开发和调试MCP服务器。

许可证

Apache许可证2.0-请参阅 许可证 了解详情。