Skip to content

repr0bated/dbus-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

D-Bus MCP - Universal Linux System Automation

CI License: MIT Rust

A Model Context Protocol (MCP) server with automatic D-Bus service discovery and universal tool introspection. Exposes 100+ tools from any D-Bus service on Linux systems with zero configuration required.

πŸš€ Features

  • πŸ” Automatic Discovery - Finds all D-Bus services and exposes them as MCP tools
  • πŸ› οΈ Universal Bridge - Any D-Bus service becomes MCP-accessible instantly
  • πŸ“Š 100+ Tools - Auto-discovered from systemd, NetworkManager, and custom services
  • 🎯 Smart Organization - Services grouped by category (system, network, automation)
  • ⚑ Zero Configuration - New D-Bus services work without code changes
  • πŸ€– AI-Ready - Perfect context for AI assistants to understand tool relationships

πŸ“‹ Quick Start

One-Command Setup

# Clone and run the installer
git clone https://github.com/yourusername/dbus-mcp.git
cd dbus-mcp
./install-mcp-configs.sh

The installer will:

  • Build all components
  • Discover D-Bus services
  • Generate MCP configurations
  • Configure your MCP client (Claude Code/Cursor)
  • Show you what's available

Manual Setup

# Build the project
cargo build --release

# Run discovery
./target/release/dbus-mcp-discovery-enhanced

# Install bridge system-wide
sudo cp ./target/release/dbus-mcp-bridge /usr/local/bin/

# Configure your MCP client with generated configs
cp ~/.config/Claude/mcp-servers/*.json ~/.config/Claude/

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MCP Clients (Claude/Cursor)        β”‚
β”‚  See multiple organized servers:     β”‚
β”‚  β€’ systemd (50 tools)                β”‚
β”‚  β€’ orchestrator (10 tools)           β”‚  
β”‚  β€’ executor-agent (8 tools)          β”‚
β”‚  β€’ file-agent (8 tools)              β”‚
β”‚  β€’ monitor-agent (8 tools)           β”‚
β”‚  β€’ network-agent (8 tools)           β”‚
β”‚  β€’ systemd-agent (8 tools)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β”‚ MCP Protocol (stdio)
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MCP Bridge Instances                β”‚
β”‚  (One per D-Bus service)             β”‚
β”‚  β€’ Dynamic tool generation           β”‚
β”‚  β€’ Automatic schema creation         β”‚
β”‚  β€’ Type conversion                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β”‚ D-Bus
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  D-Bus Services                     β”‚
β”‚  β€’ org.freedesktop.systemd1         β”‚
β”‚  β€’ org.dbusmcp.Orchestrator         β”‚
β”‚  β€’ org.dbusmcp.Agent.*              β”‚
β”‚  β€’ Any future service (auto-works!)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Available Tools

System Management (systemd)

  • start_unit - Start systemd services
  • stop_unit - Stop systemd services
  • restart_unit - Restart systemd services
  • get_unit_status - Check service status
  • list_units - List all services
  • ...and 45+ more systemd tools

Automation Orchestrator

  • spawn_agent - Create new automation agents
  • send_task - Send tasks to agents
  • list_agents - View active agents
  • get_agent_status - Check agent health

Specialized Agents

  • Executor Agents - Shell command execution
  • File Agents - File system operations
  • Monitor Agents - System monitoring
  • Network Agents - Network management
  • Systemd Agents - Service management

πŸ“– Documentation

πŸ”§ Configuration

Discovery Configuration

Edit discovery_config.toml to customize which services to expose:

[services."org.freedesktop.systemd1"]
enabled = true
format = "xml"

[services."org.freedesktop.NetworkManager"]
enabled = true
format = "xml"

[services."org.dbusmcp.*"]
enabled = true
format = "xml"

MCP Client Configuration

Claude Code (~/.config/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "systemd1": {
      "command": "dbus-mcp-bridge",
      "args": ["--service", "org.freedesktop.systemd1"]
    },
    "orchestrator": {
      "command": "dbus-mcp-bridge", 
      "args": ["--service", "org.dbusmcp.Orchestrator"]
    }
  }
}

Cursor (similar configuration):

{
  "mcp": {
    "servers": {
      "systemd1": {
        "command": "dbus-mcp-bridge",
        "args": ["--service", "org.freedesktop.systemd1"]
      }
    }
  }
}

πŸ§ͺ Testing

# Run all tests
cargo test

# Test discovery
./test_discovery.sh

# Test individual bridge
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | \
  ./target/release/dbus-mcp-bridge --service org.freedesktop.systemd1

# Test system integration
./test_system.sh

πŸš€ Usage Examples

Start a Service

# Via MCP client, call systemd1.start_unit
{
  "name": "start_unit",
  "arguments": {
    "name": "nginx.service",
    "mode": "replace"
  }
}

Execute Commands

# Via MCP client, call executor agent
{
  "name": "execute",
  "arguments": {
    "command": "ls -la /tmp",
    "background": false
  }
}

Monitor System

# Via MCP client, call monitor agent
{
  "name": "get_system_info",
  "arguments": {}
}

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Areas for Contribution

  • New D-Bus agents for specialized tasks
  • Client configuration examples
  • Documentation improvements
  • Performance optimizations
  • Additional discovery patterns

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“Š Project Status

  • βœ… Core Discovery - Automatic D-Bus service discovery
  • βœ… Universal Bridge - Any service becomes MCP-accessible
  • βœ… 100+ Tools - Auto-discovered and working
  • βœ… Client Integration - Works with Claude Code and Cursor
  • βœ… Documentation - Comprehensive guides and examples
  • πŸ”„ Active Development - New features and improvements ongoing

Transform any Linux system into an AI-controllable automation platform with zero configuration!

About

Dbus mcp

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors