MCP setup
Connect Cursor, Claude, and other MCP clients to ServerMetry for AI-assisted monitoring.
ServerMetry exposes an MCP endpoint so AI assistants can query servers, alerts, and related resources — and perform selected write actions.
Endpoint
| Environment | MCP URL |
|---|---|
| Production | https://api.servermetry.com/mcp |
| Local API | http://localhost:3601/mcp |
Use the direct API URL for MCP clients. Do not point Cursor/Claude at the frontend origin.
Create an MCP key
- Sign in to the dashboard
- Open Settings → MCP Keys (or API Keys)
- Create a key — it is shown once; store it securely
Keys are organization-scoped (sp_mcp_…).
Cursor
Add to ~/.cursor/mcp.json or a project .cursor/mcp.json:
{
"mcpServers": {
"servermetry": {
"url": "https://api.servermetry.com/mcp",
"headers": {
"Authorization": "Bearer sp_mcp_YOUR_KEY"
}
}
}
}
Reload Cursor so the MCP connection refreshes.
Claude Desktop / Claude Code
Use the same URL and Authorization: Bearer … header in the Claude MCP server config (see the dashboard page for a ready-made JSON snippet).
Example tools
| Tool | Purpose |
|---|---|
get_dashboard | Aggregated overview |
list_servers / get_server | Fleet and server detail |
list_alerts / resolve_alert | Alert triage |
list_alert_rules / create_alert_rule / delete_alert_rule | Rule management |
list_notification_channels | Channels |
list_services / create_service / … | Service monitoring |
list_projects / create_project / … | Projects |
list_backup_plans / create_backup_plan | Backup plans |
list_maintenance_windows / … | Maintenance |
list_templates | Templates |
The full tool list is returned by the MCP tools/list handshake.
Example prompts
Use ServerMetry MCP: list all servers with status OFFLINE or CRITICAL and summarize what is going on.
Via ServerMetry MCP: list open CRITICAL alerts, group by server, and suggest which alert rules to review.
Create a global alert rule via ServerMetry MCP: name "High CPU", metric cpuUsagePercent, operator GT, threshold 90, severity CRITICAL, evaluation window 5 minutes.
Security
- Never commit MCP keys to git
- Rotate keys regularly (delete + recreate in the dashboard)
- On compromise, delete the key immediately
Troubleshooting
| Problem | Fix |
|---|---|
401 Unauthorized | Check key and Bearer prefix |
| No connection | Use API URL (not frontend), valid HTTPS |
| No tools listed | Reload MCP panel; verify key org access |
| Empty server list | Key belongs to a different organization |