Skip to main content
The m87 CLI includes a built-in Model Context Protocol (MCP) server, enabling AI agents to interact with your edge devices and use all m87 platform commands as tools.

Overview

The MCP integration exposes m87’s functionality to AI agents, allowing them to:
  • Query device status and metrics
  • Execute commands on remote devices
  • Manage deployments
  • Forward ports
  • Access logs and audit trails
  • Transfer files
  • And more
This enables natural language device management through AI assistants like Claude.

Setup

1

Verify m87 Installation

Ensure m87 is installed and accessible in your PATH:
which m87
If not installed, follow the installation guide.
2

Configure Your MCP Client

Add m87 to your MCP client configuration. The configuration varies by client:

Claude Desktop / Claude Code

Edit your MCP settings file:macOS: ~/Library/Application Support/Claude/claude_desktop_config.jsonLinux: ~/.config/Claude/claude_desktop_config.jsonAdd the following configuration:
{
  "mcpServers": {
    "m87": {
      "type": "stdio",
      "command": "m87",
      "args": ["mcp"]
    }
  }
}
3

Authenticate

Ensure you’re logged in to m87:
m87 login
The MCP server will use your existing authentication.
4

Restart Your MCP Client

Restart Claude Desktop or your MCP client to load the new configuration.

Configuration Options

Using Absolute Path

If m87 is not in your PATH, specify the full path to the binary:
{
  "mcpServers": {
    "m87": {
      "type": "stdio",
      "command": "/usr/local/bin/m87",
      "args": ["mcp"]
    }
  }
}
To find the full path:
which m87

Custom Environment Variables

You can pass environment variables to the MCP server:
{
  "mcpServers": {
    "m87": {
      "type": "stdio",
      "command": "m87",
      "args": ["mcp"],
      "env": {
        "RUST_LOG": "debug"
      }
    }
  }
}

Usage Examples

Once configured, you can interact with your devices through natural language in your AI assistant:

Device Management

"List all my connected devices"

Remote Execution

"Run 'systemctl status nginx' on production-server"

Logs and Monitoring

"Show me the latest logs from my edge-device-01"

Deployments

"Show me the deployment status for production-server"

Available MCP Tools

The m87 MCP server exposes all platform commands as tools, including:
  • Device Management: List devices, check status, approve devices
  • Remote Access: Execute commands, open shells, forward ports
  • File Operations: Copy files, sync directories
  • Container Management: Docker passthrough, view containers
  • Monitoring: View logs, metrics, audit trails
  • Deployments: Deploy compose files, check deployment status
  • Serial Access: Forward serial mounts
The AI agent will automatically select and use the appropriate tools based on your requests.

Supported MCP Clients

The m87 MCP server works with any MCP-compatible client:

Troubleshooting

  • Verify the configuration file path is correct for your operating system
  • Ensure the JSON syntax is valid
  • Restart your MCP client after making changes
  • Check that m87 is accessible (run which m87 or use absolute path)
Make sure you’re logged in:
m87 login
The MCP server uses your existing m87 credentials.
If you see errors about m87 not being found:
  1. Find the full path: which m87
  2. Use the absolute path in your configuration:
{
  "command": "/full/path/to/m87",
  "args": ["mcp"]
}
You can test the MCP server directly:
m87 mcp
This will start the server in stdio mode. Press Ctrl+C to exit.

Security Considerations

  • The MCP server uses your existing m87 authentication
  • All operations are subject to your device permissions
  • Audit logs track all device interactions, including those via MCP
  • The MCP server runs with the same privileges as your user account

Learn More