Monitoring as Code
Set up OnlineOrNot with Claude Code or Cursor
Coding agents can set up OnlineOrNot monitoring for you. Ask the agent to monitor your app, and it reads your repository, proposes checks and heartbeats, and creates them in your OnlineOrNot account after you approve.
There are three pieces. You usually need the first two.
| Piece | What it gives the agent |
|---|---|
| OnlineOrNot Agent Skill | Monitoring judgment: how to find production endpoints, health routes and cron jobs in a repository, and what's worth monitoring |
| MCP server | Authenticated access to the OnlineOrNot API: checks, heartbeats, status pages, incidents and maintenance windows |
| CLI | Terminal commands the agent can run, and a local MCP bridge for clients that only support stdio servers |
Claude Code
Install the OnlineOrNot plugin. It includes the skill and the MCP server:
/plugin marketplace add OnlineOrNot/skills
/plugin install onlineornot@onlineornot
Run /reload-plugins. Claude Code opens the OnlineOrNot sign-in page the first time it uses the MCP server.
To add only the MCP server, run:
claude mcp add --transport http onlineornot https://mcp.onlineornot.com/mcp
Cursor
Install the skill:
npx -y skills add OnlineOrNot/skills --skill onlineornot --yes --global
Then add the MCP server. Use the Install in Cursor button on the MCP installation page, or add this to .cursor/mcp.json:
{
"mcpServers": {
"onlineornot": {
"url": "https://mcp.onlineornot.com/mcp"
}
}
}
Cursor opens the OnlineOrNot sign-in page when it first connects.
Codex
codex plugin marketplace add OnlineOrNot/skills
Open /plugins, choose the OnlineOrNot marketplace and install onlineornot. For Codex versions without plugin marketplaces, install the skill with the npx skills add command above, then run:
codex mcp add onlineornot --url https://mcp.onlineornot.com/mcp
For other agents, see Connect an MCP client. You can also give any agent the setup instructions at onlineornot.com/agent-setup/prompt.md.
Ask the agent
Try prompts like these:
- "Monitor my production app. Inspect this repository, propose the smallest useful setup, and ask before creating more than five monitors."
- "Add monitoring for what I just deployed and verify it is healthy."
- "Set up a heartbeat for every production cron job that is not already monitored."
- "Add a browser check that proves login works, using a dedicated synthetic account."
- "Tell me which important production endpoints are not monitored yet."
- "Investigate whether our site is currently down."
The skill tells the agent to skip localhost and preview URLs, avoid duplicate checks, keep secrets out of check configuration, and only add browser checks for journeys that need them.
What the MCP server can do
The MCP server exposes two tools by default: search, which finds endpoints and schemas in the OnlineOrNot API description, and execute, which makes authenticated API requests. Through them the agent can manage uptime, browser, DNS and TCP checks, heartbeats, status pages, status page incidents, maintenance windows, webhooks and API tokens.
The agent has the same access as the credential it uses. OAuth connections act as you, within your role and plan. To limit an agent, connect with an API token that has READ access, and add EDIT only for the resources it should change. See the MCP reference for details.
Use the CLI from an agent
Agents that can run shell commands can also use the CLI:
npm install -g onlineornot
onlineornot auth login
onlineornot checks list
onlineornot checks http create --name "Homepage" --url "https://example.com"
Resource commands print JSON, so agents can read the output. Add --dry-run to preview a request without sending it. In CI, set ONLINEORNOT_API_TOKEN instead of logging in.
onlineornot mcp starts a local stdio MCP server that forwards to the hosted one, for clients that can't connect to a remote URL:
{
"mcpServers": {
"onlineornot": {
"command": "npx",
"args": ["-y", "onlineornot@latest", "mcp"]
}
}
}
Run onlineornot auth login first, as the same user the MCP client runs as.
Keep monitoring in code
If you want the checks an agent creates to live in your repository, ask it to write them as Terraform or with the TypeScript SDK instead of creating them directly.