D-Bus MCP Server

D-Bus MCP Server

Bridges AI assistants to Linux D-Bus for system interaction, enabling clipboard, notifications, screenshots, and service discovery with configurable security levels.

Category
访问服务器

README

D-Bus MCP Server

A Model Context Protocol (MCP) server that exposes D-Bus functionality to AI assistants, enabling deep integration with Linux systems - from vacuum cleaners to supercomputers.

D-Bus MCP Server - AI Maintenance Robot

Vision

This project enables AI assistants to interact with Linux systems through the standardized D-Bus interface. While Linux runs on everything from vacuum cleaners to supercomputers, this MCP server focuses on two major system roles where D-Bus integration provides the most value:

1. Workstation Role (Interactive Desktop Systems)

For Linux desktop/laptop users, AI assistants can enhance productivity by:

  • Managing clipboard content and history
  • Sending desktop notifications
  • Taking and analyzing screenshots
  • Controlling media playback
  • Monitoring system resources
  • Integrating with desktop applications

2. Dedicated System Role (Servers, Appliances, Embedded)

For systems with specific purposes (web servers, routers, NAS, IoT devices), AI operates as a "maintenance robot" that can:

  • Connect to servers via standardized D-Bus interfaces
  • Discover available services and capabilities
  • Monitor system health and performance
  • Analyze logs and diagnose issues
  • Perform authorized remediation actions
  • Generate reports across server fleets

Key Features

  • Secure by Design: Multiple privilege levels, PolicyKit integration, audit logging
  • Desktop Environment Agnostic: Uses freedesktop.org standards where possible
  • Discoverable: Services self-document through D-Bus introspection
  • Type-Safe: D-Bus provides strong typing for all operations
  • Rate Limited: Prevents abuse of system resources

Architecture

The MCP server acts as a bridge between AI assistants and the D-Bus system:

graph LR
    subgraph "AI Layer"
        A[fa:fa-robot AI Assistant<br/>Claude, GPT, etc.]
    end
    
    subgraph "Protocol Layer"
        B[fa:fa-exchange-alt MCP Protocol<br/>JSON-RPC over stdio/SSE]
    end
    
    subgraph "Bridge Layer"
        C[fa:fa-server D-Bus MCP Server<br/>Security & Translation]
    end
    
    subgraph "System Layer"
        D1[fa:fa-desktop Session Bus<br/>Desktop Services]
        D2[fa:fa-cog System Bus<br/>System Services]
    end
    
    A <-->|"Tools & Resources"| B
    B <-->|"Request/Response"| C
    C <-->|"Method Calls"| D1
    C <-->|"Monitoring"| D2
    
    style A fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#000
    style B fill:#f3e5f5,stroke:#4a148c,stroke-width:2px,color:#000
    style C fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px,color:#000
    style D1 fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#000
    style D2 fill:#ffebee,stroke:#b71c1c,stroke-width:2px,color:#000

🔒 Security Model - Safety First

The D-Bus MCP server implements configurable safety levels to balance functionality with security:

🟢 HIGH Safety (Default) - Safest Choice

Essential operations with minimal risk: clipboard, notifications, media control, system monitoring

🟡 MEDIUM Safety - Productivity Mode

Adds text editing, file management, and browser operations for AI-assisted workflows

🔴 LOW Safety (Future) - Advanced Users

Maximum functionality for expert users who understand the risks

NEVER ALLOWED - Hard Security Boundaries

Operations like shutdown, disk formatting, and package management are always blocked

# Choose your safety level
python -m dbus_mcp --safety-level high    # Default - safest
python -m dbus_mcp --safety-level medium  # Productivity features

📖 Complete Security Guide

Quick Start

📖 Complete Quick Start Guide

🚀 Recommended: Production Installation with systemd

For production use, we recommend running D-Bus MCP as a systemd service with Unix socket support:

# Clone and install with systemd service
git clone https://github.com/aaronsb/dbus-mcp.git
cd dbus-mcp
./install.sh --prod-only

# Configure safety level
sudo nano /etc/dbus-mcp/config  # Set SAFETY_LEVEL="medium"

# Start the service
systemctl --user start dbus-mcp-standalone.service
systemctl --user enable dbus-mcp-standalone.service

# Configure your MCP client with:
# socat UNIX-CONNECT:$XDG_RUNTIME_DIR/dbus-mcp.sock STDIO

# KDE Users: Enable screenshot permission
sudo cp systemd/dbus-mcp-screenshot.desktop /usr/share/applications/

📖 SystemD Mode Guide - Complete setup and configuration

🛠️ Alternative: Development Mode

For development or testing, you can run directly:

# Quick development setup
./quickstart.sh

# Test the installation
python test_installation.py

# Run directly
python -m dbus_mcp --safety-level medium

The Quick Start Guide includes:

  • System requirements and prerequisites
  • Multiple installation methods (systemd recommended for production)
  • Configuration for Claude Desktop, Claude Code, and VS Code
  • Troubleshooting tips

Core Tools

The server starts with essential tools for D-Bus interaction:

Basic Tools (Always Available)

  1. help - Show available capabilities and tools
  2. notify - Send desktop notifications
  3. status - Get system status (battery, network, etc.)
  4. discover - Explore available tool categories
  5. list_services - List all D-Bus services
  6. introspect - Explore service interfaces and methods
  7. call_method - Call D-Bus methods (with security controls)

Desktop Tools (When Display Available)

  1. clipboard_read/clipboard_write - Clipboard access (KDE/GNOME)
  2. capture_active_window - Screenshot the active window 📸
  3. capture_screen - Screenshot entire screen 📸
  4. list_screenshot_files - List captured screenshots

📸 Screenshot Capability

The server can now capture screenshots through D-Bus, storing them as temporary files with reference IDs. This enables AI assistants to:

  • Capture windows or screens for visual context
  • Document UI states
  • Create visual bug reports
  • Guide users with annotated screenshots

KDE Users: To enable screenshots, install the desktop entry file:

sudo cp systemd/dbus-mcp-screenshot.desktop /usr/share/applications/

See the Screenshot Authorization Guide for details.

Screenshots are stored in ~/.cache/dbus-mcp/screenshots/ with proper user permissions, ensuring privacy and persistence. See Screenshot Authorization for KDE setup.

Documentation

📚 Full Documentation

Key Documents:

For Developers:

For Operators:

Status

🚧 Alpha - Basic functionality implemented, ready for testing

What's Working:

  • ✅ Core MCP server with stdio transport
  • ✅ SystemD service integration with Unix socket support
  • ✅ System profile auto-detection (KDE/Arch tested)
  • ✅ Basic tools: notify, clipboard, status, help
  • ✅ Screenshot capability with file management
  • ✅ Security policies and rate limiting
  • ✅ Progressive tool disclosure

🚀 Roadmap

See our comprehensive Development Roadmap for planned features including:

  • 🎵 Media control and window management
  • 🖥️ Server fleet management tools
  • 🐧 GNOME, Sway, and Ubuntu profiles
  • 🔌 Native socket support
  • 🤖 AI-specific enhancements
  • And much more!

License

MIT License - see LICENSE for details

Contributing

We welcome contributions! Areas where help is especially appreciated:

  • 🐧 System Profiles: Add support for your distro/desktop environment
  • 🔧 Tools: Implement new D-Bus tools for common operations
  • 📖 Documentation: Improve guides and examples
  • 🧪 Testing: Test on different Linux systems

See CLAUDE.md for development guidelines.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选