Documentation
Setup, commands, config. Everything in one place.
Quick Start
Three steps. Under 2 minutes. No, really.
Step 1: Connect your messenger
Find mttrly in your messenger: Telegram (@mttrly_bot), Slack (add to workspace), or Discord (invite bot). Start a chat — you'll get your API token right away.
Step 2: Install the agent
SSH into your server and run this. It's a lightweight Go binary (~10MB), no dependencies, no bloat.
Step 3: Say hello
Send /status in your messenger. If you see your server's CPU, RAM, and disk stats — you're done. That was fast.
Commands
Every command mttrly understands, with options and examples.
$ /statusServer health at a glance: CPU, RAM, disk, running services.
Options:
-vVerbose — includes process list-jOutput as JSON (for scripts)
Example:
$ /logsRead logs without SSH. Filter by service, tail in real-time, or show only errors.
Options:
<service>Which service (nginx, app, etc.)-n <lines>How many lines (default: 50)-fFollow — like tail -f--errorsErrors only
Example:
$ /restartRestart a service. Asks you to confirm first (unless you --force it).
Options:
<service>Service to restart--forceSkip confirmation — you're sure
Example:
$ /deployGit pull + restart. The deploy button you always wanted.
Options:
<app>Which app to deploy--branch <name>Git branch (default: main)
Example:
$ /runRun a custom playbook you've defined in config.
Options:
<playbook>Playbook name
Example:
Configuration
One YAML file. Three main sections. Here's what you can tweak.
Config file location: /etc/mttrly/config.yaml
servicesTell mttrly which services it can manage. Only these will show up in commands.
services: - nginx - myapp - redis
playbooksYour own scripts, triggerable via /run. Set confirm: true for anything scary.
playbooks:
cleanup-logs:
script: /opt/scripts/cleanup.sh
confirm: truealertsGet pinged when resource usage crosses a threshold. Set percentages that make sense for your setup.
alerts: cpu_threshold: 80 memory_threshold: 90 disk_threshold: 85
Security
How mttrly keeps your servers safe. The short version: we're paranoid so you don't have to be.
Outbound-only connections
The agent connects to us — not the other way around. No ports to open. Your firewall stays exactly as it is.
Confirmation before anything scary
Restart, deploy, custom scripts — all need you to tap "Confirm" first. No surprises, no accidental nukes.
Minimal permissions
The agent runs as its own user with bare minimum privileges. You decide which commands get sudo. Nothing else does.
Encrypted everything
All traffic between your server and your messenger is encrypted. We don't store your logs or sensitive data. Period.
Token rotation
Think your token leaked? Regenerate it. The old one dies instantly. Takes 10 seconds.
Troubleshooting
Something not working? Start here.
Agent won't connect
- →Make sure outbound WebSocket connections are allowed (port 443)
- →Double-check your API token — copy-paste errors are real
- →Check agent logs: journalctl -u mttrly
Commands timeout
- →Your server might be under heavy load — the agent needs CPU too
- →Check if the server has internet access
- →Try restarting the agent: systemctl restart mttrly
Permission denied
- →The mttrly user needs access to the service you're managing
- →Add specific sudo permissions in /etc/sudoers.d/mttrly
MCP Server
Connect mttrly to AI coding assistants via the Model Context Protocol. Endpoint: https://api.mttrly.com/mcp
Connection
mttrly MCP server uses HTTP transport with OAuth 2.1 authentication. Add it to your client:
claude mcp add mttrly --transport http https://api.mttrly.com/mcp
OAuth login opens in browser automatically.
{
"mcpServers": {
"mttrly": {
"url": "https://api.mttrly.com/mcp"
}
}
}Cursor → Settings → Cursor Settings → MCP → Add server.
{
"mcpServers": {
"mttrly": {
"url": "https://api.mttrly.com/mcp"
}
}
}Settings → Developer → Edit Config → claude_desktop_config.json.
[mcp_servers.mttrly] url = "https://api.mttrly.com/mcp"
Add to ~/.codex/config.toml. Run codex mcp login mttrly for OAuth.
Authentication
Two authentication modes are supported:
OAuth 2.1 (recommended)
Standard OAuth flow with PKCE S256. JWT tokens signed with RS256. Issuer: https://app.mttrly.com. Audience: https://api.mttrly.com/mcp. MCP clients handle this automatically — you just approve the login in browser.
API Key
Bearer token with mtr_ prefix. Pass as Authorization: Bearer mtr_your_key. Available from your dashboard.
Unauthenticated requests return 401 with a WWW-Authenticate header pointing to the OAuth discovery endpoint.
Tools Reference
35+ tools organized by access level. Always call mttrly_get_capabilities first to check your plan and available tools.
Available on all plans
mttrly_get_capabilitiesGet current plan, available tools, restricted tools, and plan limits. Call this first before using any other tool.
mttrly_list_serversList all connected servers with their status (online/offline).
mttrly_get_server_statusGet detailed server status including CPU, RAM, disk usage and active alerts count.
mttrly_get_alertsGet alerts (incidents) for a server with severity/status filtering. Plan-based retention limits apply.
mttrly_run_diagnosticRun AI-powered diagnostic on a server. Describe the problem and the system will investigate. 30-second cooldown per server.
mttrly_list_playbooksList available playbooks (remediation actions) with categories and approval requirements.
Requires Deployment Bro plan
mttrly_run_playbookExecute a playbook on a server. Read-only playbooks run immediately. Dangerous playbooks return pending_approval — call mttrly_approve_action after explicit user confirmation.
mttrly_execute_commandRequest execution of a shell command on a server. Always returns pending_approval. Call mttrly_approve_action after explicit user confirmation.
mttrly_get_pending_actionsList pending actions awaiting approval.
mttrly_approve_actionApprove or reject a pending action. Only call after explicit user confirmation — never automatically. Blocks until execution completes (up to 60s).
mttrly_get_audit_logGet audit trail for a server — approval decisions, command executions, playbook runs, and agent fixes.
Approval workflow
Destructive actions follow a two-step approval pattern:
Read-only playbooks execute immediately without approval. Check requires_approval field from mttrly_list_playbooks.
Error codes
All errors return a JSON object with code, message, and suggested_action.
PLAN_REQUIREDTool requires a higher plan. The response includes an upgrade URL.
→ Inform the user about the plan limitation and show the upgrade URL.
SERVER_OFFLINEThe target server agent is not connected.
→ Check if the agent is running on the server.
SERVER_NOT_FOUNDInvalid server_id.
→ Call mttrly_list_servers to see available server IDs.
DIAGNOSTIC_COOLDOWN30-second per-server cooldown on diagnostics has not expired.
→ Wait for the cooldown period to expire before retrying.
DOCKER_NOT_AVAILABLEDocker playbook requested but Docker is not installed on the target server.
→ Skip Docker-related playbooks or install Docker on the server.
ACTION_EXPIREDPending action exceeded 30-minute TTL and was automatically cancelled.
→ Re-run the original command or playbook to create a new pending action.
RATE_LIMITEDAPI key exceeded 60 requests per minute. Returns HTTP 429.
→ Wait and retry after the rate limit window resets (1 minute).
VALIDATION_ERRORRequest body failed validation (e.g. missing required field, description over 2000 chars).
→ Check the request parameters against the tool schema.
TIMEOUTRequest exceeded the timeout (default 60s).
→ Retry the request.
Rate limits
Plan limits
Each plan has concrete resource limits enforced by the API:
| Limit | Watchdog (Free) | Deployment Bro ($39/mo) | Deployment Crew ($99/mo) |
|---|---|---|---|
| Servers | 1 | 3 | 9 |
| Log lines per request | 50 | 500 | 500 |
| Alert/log retention | 7 days | 30 days | 30 days |
| Scheduled checks | — | 5 | Unlimited |
Plan access matrix
| Tool | Watchdog (Free) | Deployment Bro ($39/mo) | Deployment Crew ($99/mo) |
|---|---|---|---|
| mttrly_get_capabilities | ✓ | ✓ | ✓ |
| mttrly_list_servers | ✓ | ✓ | ✓ |
| mttrly_get_server_status | ✓ | ✓ | ✓ |
| mttrly_get_alerts | ✓ | ✓ | ✓ |
| mttrly_run_diagnostic | ✓ | ✓ | ✓ |
| mttrly_list_playbooks | ✓ | ✓ | ✓ |
| mttrly_run_playbook | — | ✓ | ✓ |
| mttrly_execute_command | — | ✓ | ✓ |
| mttrly_get_pending_actions | — | ✓ | ✓ |
| mttrly_approve_action | — | ✓ | ✓ |
| mttrly_get_audit_log | — | ✓ | ✓ |
* Deployment Crew has the same MCP tool access as Deployment Bro, plus: up to 9 servers, team access, and webhook integrations.