rust-debug-mcp

rust-debug-mcp

A Model Context Protocol (MCP) server for debugging and operating Rust Tauri applications over WebSocket.

Category
访问服务器

README

<p align="center"> <img src="./rust.png" alt="Rust logo" width="180" /> </p>

rust-debug-mcp

TypeScript Rust Tauri WebSocket Model Context Protocol

A Model Context Protocol (MCP) server for debugging and operating Rust Tauri applications over WebSocket.

Table of Contents

Overview

rust-debug-mcp bridges MCP clients and Tauri debug backends. It provides a single tool (tauri_debug_command) that routes commands to specialized handlers for app lifecycle operations, core debugging, metrics/task inspection, frontend actions, and UI automation.

It supports multiple target apps through configs/apps.json, including capability checks per app before command execution.

Features

Core Functionality

  • Multi-app registry support with per-app command capability gating
  • App lifecycle management (start_app, kill_app)
  • Core debug command forwarding through a typed WebSocket bridge
  • Response verbosity control (concise and detailed)

Debugging & Inspection

  • Task/session/metrics commands for Commander-style backends
  • Frontend broadcast support for app-side actions
  • UI automation commands (click, fill, select, type, press_key, snapshots, screenshots, wait/hover/scroll, console logs)

Reliability

  • Connection status checks and reconnect behavior in bridge manager
  • Request timeout handling for bridge calls
  • Ordered handler routing with clean command-to-handler resolution

Installation

Quick Setup

# Clone repository
git clone https://github.com/ruizrica/rust-debug-mcp.git

# Enter project
cd rust-debug-mcp

# Install dependencies
npm install

# Build
npm run build

Installing in an MCP Client

Add to your MCP config (example):

{
  "mcpServers": {
    "tauri-debug": {
      "command": "node",
      "args": ["/absolute/path/to/rust-debug-mcp/dist/server.js"],
      "env": {
        "LOG_LEVEL": "info",
        "TAURI_WS_URL": "ws://localhost:9002",
        "COMMANDER_WS_URL": "ws://localhost:9002"
      }
    }
  }
}

For deeper setup and troubleshooting, see docs/RUNBOOK.md.

Usage

Starting the Server

npm run dev
# or
npm start

The server communicates over stdio and is intended to be launched by an MCP client.

Multi-App Configuration

configs/apps.json controls default app, app endpoints, and command capability sets:

{
  "default": "commander",
  "apps": {
    "commander": {
      "name": "Commander",
      "wsUrl": "ws://localhost:9002",
      "commands": ["all"]
    },
    "photon": {
      "name": "Photon CLI",
      "wsUrl": "ws://localhost:9847",
      "commands": ["core", "ui_automation"]
    }
  }
}

Tools API

The server exposes one MCP tool:

Tool Description
tauri_debug_command Execute a debug command against a selected app (command, optional params, optional app, optional response_format)

Command Categories

  • App lifecycle: start_app, kill_app
  • Core: test_connection, get_debug_mode, set_debug_mode, get_app_dir, get_logs, get_system_metrics, test_command, simple_test
  • Task/session/metrics: get_session_metrics, get_task_metrics, get_all_tasks, get_task, get_tasks_by_status, get_task_groups, list_windows
  • Frontend action: broadcast_to_frontend
  • UI automation: click, fill, select, type, press_key, get_snapshot, take_screenshot, wait_for, hover, scroll, get_console_logs

For full payload details, see docs/COMMAND_REFERENCE.md.

Examples

Minimal Command

{
  "command": "test_connection"
}

Targeting a Specific App

{
  "command": "get_debug_mode",
  "app": "commander"
}

UI Interaction

{
  "command": "click",
  "app": "photon",
  "params": {
    "uid": "e5"
  }
}

Development

Project Structure

rust-debug-mcp/
├── src/
│   ├── server.ts             # MCP server entry point
│   ├── bridge-manager.ts     # WebSocket bridge and manager
│   ├── app-registry.ts       # Multi-app registry and capability checks
│   ├── handlers/             # Command handlers and router
│   ├── response-formatter.ts # Concise/detailed output formatter
│   └── types.ts              # Type definitions
├── configs/
│   └── apps.json
├── docs/
├── tests/
├── package.json
└── tsconfig.json

Build

npm run build

Typecheck

npm run typecheck

Testing

npm test
npm run test:unit
npm run test:integration

Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Make and test your changes
  4. Open a pull request

License

MIT


Built with TypeScript, Rust, Tauri, and MCP.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选