# OneUptime MCP Server A Model Context Protocol (MCP) server that exposes OneUptime to AI agents. It lets MCP-compatible clients (Claude, VS Code with Copilot, Cursor, and others) manage incidents, alerts, monitors, SLOs, on-call schedules, workflows, runbooks, status pages, services, hosts, and telemetry. By default, `/mcp` lists a curated **`core` toolset** (up to 60 tools, under 64 KB) so IDE clients such as Cursor and VS Code stay well within tool-count and token budgets, while `oneuptime_call_read_tool` lets agents on `core` still execute any project-scoped read-only tool discovered via `oneuptime_list_resources`. Append `?toolsets=core,incidents,monitors,telemetry` (or `?toolsets=all` for the full 400+ tool catalog) to customize which tool groups are exposed. The ChatGPT plugin and the coding agent plugin connect with no `?toolsets=`, so `core` holds every tool their skills and ChatGPT's review test cases call, and their tests fail on one it is missing. ## How it works - **Transport**: Streamable HTTP at `/mcp`. The server is **stateless** — no session IDs are issued or required, so it is safe behind load balancers and multi-replica deployments. - **Hosted endpoint**: `https://oneuptime.com/mcp` (or `https://oneuptime.com/mcp?toolsets=core,incidents,monitors,telemetry`) - **Self-hosted endpoint**: `https:///mcp` (served by the App container behind Nginx) - **Toolsets**: `?toolsets=` accepts comma-separated profiles: `core` (default), `incidents`, `alerts`, `monitors`, `telemetry`, `on-call`, `status-pages`, `slos`, `workflows`, `infrastructure`, `security`, `data-security`, `data-observability`, `cloud-costs`, `setup`, and `all`. - **Auth**: sign in with OneUptime (OAuth 2.1, per the MCP authorization specification), or a per-request API key via the `x-api-key` header or `Authorization: Bearer ` (scheme is case-insensitive). There is no environment-variable API key — every request carries its own credential. On OneUptime Cloud, connecting a new MCP client and using API keys require the **Growth** plan or higher; already-connected OAuth clients act as the signed-in user and keep working. - **Plain Date & Color inputs**: DateTime and Color fields accept plain ISO-8601 strings (`"2026-07-04T00:00:00Z"`) and hex color strings (`"#ff0000"`, `"#f00"`) in addition to OneUptime's `{ "_type": "DateTime"|"Color", "value": ... }` envelopes, normalized automatically on the server. ## Connecting a client ### By signing in Give the client the URL and nothing else. The first call to a tool that needs an identity is answered `401` with a `WWW-Authenticate` challenge; the client discovers the authorization server from it, opens the consent screen in the user's browser, and gets tokens for the project the user picks. ```bash claude mcp add --transport http oneuptime https://oneuptime.com/mcp ``` ```json { "servers": { "oneuptime": { "type": "http", "url": "https://oneuptime.com/mcp" } } } ``` The rest of this section configures the same clients with an API key instead, for agents that run unattended. ### Claude Desktop Add to `claude_desktop_config.json`: ```json { "mcpServers": { "oneuptime": { "transport": "streamable-http", "url": "https://oneuptime.com/mcp", "headers": { "x-api-key": "your-api-key-here" } } } } ``` ### Claude Code ```bash claude mcp add --transport http oneuptime https://oneuptime.com/mcp \ --header "x-api-key: your-api-key-here" ``` ### VS Code (GitHub Copilot) `.vscode/mcp.json` or the user MCP configuration: ```json { "servers": { "oneuptime": { "type": "http", "url": "https://oneuptime.com/mcp", "headers": { "x-api-key": "${input:oneuptime-api-key}" } } }, "inputs": [ { "type": "promptString", "id": "oneuptime-api-key", "description": "OneUptime API Key", "password": true } ] } ``` ### Cursor `.cursor/mcp.json`: ```json { "mcpServers": { "oneuptime": { "url": "https://oneuptime.com/mcp", "headers": { "x-api-key": "your-api-key-here" } } } } ``` For self-hosted instances, replace `oneuptime.com` with your OneUptime host in any of the above. ## Authentication ### API key Create a **project API key** in OneUptime under **Project Settings → Advanced → API Keys** and grant it the least privilege the agent needs (read-only keys work for all `get_`/`list_`/`count_` tools). The project is inferred from the key — create tools never need a `projectId` argument. > **Warning — never give an AI agent a master key.** A OneUptime *master* API key is also accepted on this header and grants instance-wide admin access. Always use a project-scoped API key with least privilege for AI agents. Public status page tools and `oneuptime_help` / `oneuptime_list_resources` / `oneuptime_describe_resource` work without any credential. ### OAuth sign-in The code is in `OAuth/`; each file opens with the reasoning behind it. The shape of it: - **One issuer under `/mcp`.** `https:///mcp` is both the protected resource (RFC 9728) and the authorization server's issuer (RFC 8414). Every endpoint sits under `/mcp/oauth`, and every URL is built from `HOST` / `HTTP_PROTOCOL`, never from the request. - **Lazy, at the HTTP layer.** `OAuth/RequestGate` runs before the MCP SDK sees a request. `initialize`, `tools/list` and the public tools pass with no credential; a call to a tool that needs an identity is refused `401` (or `403 insufficient_scope` for a read-only grant calling a write tool) with a Bearer challenge. It cannot live in a tool handler: a refusal from inside the SDK is a `200`, and a client only starts signing its user in on a real `401`. - **Clients identify themselves.** A Client ID Metadata Document (`OAuth/ClientIdMetadataDocument`, fetched through the egress guard with private addresses always blocked) or Dynamic Client Registration (`OAuth/RegistrationEndpoint`). Nobody registers a client by hand. A client with a metadata document is public, so its document has to let it authenticate with `none`, in `token_endpoint_auth_method` or in `token_endpoint_auth_methods_supported`: ChatGPT's names `private_key_jwt` in the first and lists `none` in the second. - **Authorization code + PKCE (S256 only)**, resource indicators (RFC 8707), `iss` in the authorization response (RFC 9207), rotating refresh tokens with reuse detection, revocation (RFC 7009). - **Opaque tokens, stored as hashes.** `oumcp_ac_…` / `oumcp_at_…` / `oumcp_rt_…`; only the SHA-256 is kept (`McpOAuthToken`). A grant (`McpOAuthGrant`) is one member letting one client act for them in one project; revoking is deleting the grant, which cascades to its tokens. - **Only an access token is a credential.** `x-api-key` carries an API key and nothing else; `Authorization` carries an API key or an access token. Any other `oumcp_` secret presented in either header — a refresh token, a code, a client secret, or an access token in `x-api-key` — is refused `401 invalid_token` by `OAuth/RequestGate` and is never passed on to the API as an API key. - **Scopes** `mcp:read` and `mcp:write` (write includes read). The consent screen can narrow what a client asked for, never widen it. - **The API never sees the client's token.** Having accepted an access token, the MCP layer calls the REST API with a 60-second signed *delegation token* (`Common/Server/Utils/Mcp/McpDelegationToken`). `Common/Server/Middleware/McpDelegationAuthorization` turns that into a request authorized as the member — never as a master admin — in the grant's project, with their live permissions, and marked read-only when the grant is. A stolen access token is therefore worth exactly what the MCP tools can do with it. - **Checked on every use.** `Common/Server/Utils/Mcp/McpOAuthGrantAccess` re-evaluates the grant per request and per token exchange: the member still exists, is not blocked, still belongs to the project, is not on a team that blocks `AuthorizeMcpClient`, and still satisfies the project's SSO requirement. - **Consent** is the Accounts page `/accounts/mcp-authorize`; **managing connected clients** is Settings → MCP Server in the Dashboard. Two settings: `DISABLE_MCP_OAUTH=true` switches the whole thing off (the routes answer 404 and an unauthenticated tool call gets the in-band "API key is required" result it always got), and `DISABLE_MCP_OAUTH_CLIENT_ID_METADATA_DOCUMENTS=true` is for instances that cannot make outbound requests. ## Tool catalog ### Database resources — full CRUD Each of the 66 `@EnableMCP()` database models gets six tools: `create_`, `get_`, `list_`, `update_`, `delete_`, `count_` (e.g. `create_incident`, `get_incident`, `list_incidents`, `update_incident`, `delete_incident`, `count_incidents`), including core SRE models such as Incident, Alert, Monitor, Status Page, Scheduled Maintenance Event, Team, On-Call Policy, On-Call Schedule, Service Level Objective, Service, Host, Workflow, Runbook, Label, plus Security, Data Security, Data Observability, and Cloud Cost models. A model none of whose fields can be changed once it is made, such as Incident Alert (an incident's link to an alert), gets no `update_` tool: it would take an `id` and change nothing, which OpenAI's plugin review flags as a tool claiming what it cannot do. ### Telemetry resources — read-only Log, Metric, Span, Exception Instance, Monitor Log, Security Event, Change Event, Kubernetes Cost Allocation, and Threat Intel Indicator get `list_` and `count_` tools only (e.g. `list_logs`, `count_spans`, `list_exception_instances`). There are no create tools for telemetry — ingestion happens via OpenTelemetry. ### Workflow tools Purpose-built shortcuts for incident/alert response (`packages/App/FeatureSet/MCP/Tools/WorkflowTools.ts`): - `acknowledge_incident`, `resolve_incident` - `acknowledge_alert`, `resolve_alert` - `add_incident_note` (with `visibility: "internal" | "public"` — public notes post to the status page) - `add_alert_note` - `get_data_table_freshness` — whether a table Data Observability watches is fresh: fresh or late by its own rhythm, when it last changed, its open alerts, and its writers' latest runs (read-only) - `get_data_table_lineage` — what a table Data Observability watches is built from and what is built from it, up to five steps each way (`depth`, three by default): the tables that are late, dropped, have open alerts or whose pipeline failed first, nearest first, then the rest, the pipelines that load it from outside and the BI dashboards built on it (read-only) - `oneuptime_whoami` — returns the project (ID and name) the credential belongs to; for an OAuth sign-in, also who is signed in, through which client, and whether the connection is read-only - `get_setup_health` — returns project Setup Health findings (misconfigurations such as unrouted monitors or unverified notification channels) and recommended fixes (read-only) - `oneuptime_call_read_tool` — strictly read-only, project-scoped dispatcher (`Tools/CallReadTool.ts`) included in `core` so an agent on the default `/mcp` profile can invoke any read-only resource or workflow tool discovered through `oneuptime_list_resources` (such as `list_security_events`, `get_runbook`, `list_cloud_budgets`, or `get_data_table_lineage`). Refuses every write/mutating tool, every public/open-world tool, recursive self-calls, and any tool excluded by an explicit `?toolsets=` filter or server write policy (read-only) - `oneuptime_move_in_list` — moves a row of an ordered list (an incident or alert severity or state, a monitor status, a maintenance state, a postmortem or security case status, a security case priority) to another row's place, as a drag in the dashboard does: `{ resource, id, placeOfId }`, sent as the API's `POST /:id/move`, answered with each row whose number changed (`Tools/MoveInList.ts`). A write of a row's number with its `update_` tool places only that row since #9650, so this is how an agent moves a row past others. One tool for every list, which takes every model with MCP tools whose rows the move request answers for; `oneuptime_list_resources` and `oneuptime_describe_resource` name it among each such resource's tools ### Setup tools Ask AI's setup actions, one call each, for what a person sets up rather than one table at a time (`packages/App/FeatureSet/MCP/Tools/SetupTools.ts`, #7241, #10041): - `set_up_website_monitoring` — a Website monitor (or an API monitor, with `isApi`) for an address, with the criteria the website guided setup gives it: an incident when the address does not answer or answers with an error, checked from the locations a new monitor starts with. The person owns it. An address a monitor already checks gets no second one. It is open-world: the monitor checks an address outside OneUptime. - `set_up_service_monitor` — one of the monitors the telemetry guided setup recommends for a service that sends telemetry (`errors`, `slow_requests`, `exceptions` or `error_logs`), the one its Recommendations tab makes: it opens an alert for the team. One that reads data the project does not send yet is refused, and so is one the service has already. - `set_up_paging` — in a project that pages nobody yet, the on-call policy "Default on-call policy", paging the person and the members and teams named for every new incident and alert, with who is paged next (`escalateTo`, `afterMinutes`) and repeats (`repeatTimes`). A project that pages people already is refused: it keeps its own policies. - `add_to_on_call_policy` — members and teams added to a policy the project has, as the on-call guided setup's "Who else is on call?" adds them: to one of its levels (the first by default), or as a new level after its last, paged when nobody acknowledges within `afterMinutes`, which then sets how long the level before it waits. Someone a level pages already is left as they are, so a second identical call adds nobody and makes no second level; the run reads the level again before it writes, so a row is never made twice. Someone invited to the project who has not joined yet is added by the address they were invited at, and paged once they join; an address with no invitation to the project is never added. - `invite_people` — people invited to the project by email, as Invite User does: each joins the project's members team and is emailed an invitation in the name of the person signed in. An address in the project already, invited or a member, is not invited again. It is open-world: it emails addresses outside the project. - `set_how_to_reach_me` — the person's own How to Reach Me ladder ("text me, then call me after five minutes"), for every incident and alert at every severity, mapped to their verified methods and, only on a self-hosted server set to page them before they are verified, an SMS or call number an admin added for them, which the result names. It replaces how pages reach them now; a ladder that reaches them this way already is left as it is. - `publish_status_page` — a public status page that shows the monitors named, by name or the address they check. - `add_monitors_to_status_page` — monitors put on a status page the project has, as its Add Multiple Monitors puts them. - `who_is_told` — who is told when a monitor goes down, and what would stop them being reached (read-only). They build nothing in the MCP layer. Each call is `POST /api/setup-actions/run` with `{ action, arguments }` (`Common/Server/API/SetupActionAPI`), which runs Ask AI's own tool through `Common/Server/Utils/AI/Toolbox/SetupActionRunner`: the same prepare, the same checks Ask AI makes before its approval card (permissions, the products switched on, the plan, what is missing), then the same writes as the person - so an agent and Ask AI make the same records for the same arguments. There is no approval card: a client asks before a tool that is not read-only, so each tool's description says what the card would have said first - what it makes or replaces, the email an invitation sends, what a new monitor costs on OneUptime Cloud's Free plan, what a second identical call does - and its answer says what was made (`made`, `details` in the card's words, `message`, `record`). A refusal is an error of its own status: `403` for a permission or a product switched off, `402` for the plan, `409` for a record that moved on before it ran (a level made since the call was prepared), `400` for what is missing. The route takes only the arguments each action's schema takes. What its prepare works out from them - the record each name stands for, by id, the team an invitation joins, who a level pages already - is the action's own, read as the person, so a caller's own ids never run unseen. They act as the person signed in with OAuth: the monitor is theirs, the policy pages them, an invitation names them, and How to Reach Me is their own. A project API key is not a person, so it is refused the eight that make something, in words that say why for each (`getSetupActionApiKeyRefusal` in `Common/Types/AI/AISetupActions.ts`) and what to do instead; `who_is_told` reads for a key too. A connection authorized read-only is refused them as every write is. ### Helper and public tools - `oneuptime_help`, `oneuptime_list_resources` - `oneuptime_describe_resource` — one resource's fields: what each means, the filter operators its type takes, and whether it can be sorted or must be selected. Accepts the resource's name or any of its tool names (`Incident`, `list_incidents`). - No credential needed: `search_docs`, `read_docs` (search and read OneUptime's built-in documentation), `get_public_status_page_overview`, `get_public_status_page_incidents`, `get_public_status_page_scheduled_maintenance`, `get_public_status_page_announcements` ### Annotations and results Every tool has a title and states all three MCP hints, set in `Tools/ToolAnnotations.ts`, so clients and directories can name each tool, auto-approve safe calls and confirm the rest: - `title` twice, in the same words: on the tool, where MCP's 2025-06-18 spec and ChatGPT read it, and in its annotations (`annotations.title`), the older place, where the Claude Connectors Directory reads it. A tool is given its title once; `tools/list` puts it in both (`getListedToolAnnotations`, used by `Handlers/ToolHandler.ts`), for generated tools and those written by hand alike. - `readOnlyHint: true` on the tools that change nothing: `get_`, `list_`, `count_`, `oneuptime_whoami`, `oneuptime_call_read_tool`, `who_is_told`, the helper tools and the public status page tools. - `destructiveHint: true` on every tool that changes something: create, update and delete tools, acknowledging and resolving, adding notes, and moving a row of a list. Most writes overwrite or delete a record, change an incident's or alert's state, page someone on call or post to a status page, and the directories allow `false` only for a write that adds and sends nothing. - `openWorldHint: true` on the tools that reach past the caller's project: the public status page tools, which read any public status page on the instance, and the writes that are published, shown on a status page and sent to its subscribers. Those are the create, update and delete tools of status pages, status page announcements, incidents, incident state timelines, incident public notes, scheduled maintenance events and their state timelines (`PUBLISHED_TABLE_NAMES` in `Tools/ToolAnnotations.ts`), and `acknowledge_incident`, `resolve_incident`, `add_incident_note`, `publish_status_page` and `add_monitors_to_status_page`. `invite_people` is open-world too: it emails addresses that need not be anyone in the project yet. So are the writes that point OneUptime at an address outside it: the create and update tools of monitors, data stores and BI tools (`OUTSIDE_ADDRESS_TABLE_NAMES` in `Tools/ToolAnnotations.ts`), since a monitor checks the website or host it is given and a data store or a BI tool is reached with the connection it is given, and `set_up_website_monitoring`. Deleting one reaches nothing outside, so the delete tools are not. Every other tool stays inside the caller's project. MCP directories require them: the Claude Connectors Directory flags any tool without a title annotation (`annotations.title`) or a `readOnlyHint`/`destructiveHint` (on 2026-12-02 its submission portal flagged all 57 tools of the default listing "Missing title annotation", as each had its title only on the tool), and ChatGPT's requires all three hints as booleans. `Tests/ToolAnnotationsForDirectories.test.ts` fails on a tool that lacks one, whose two titles differ, or that breaks the rules above. On the server itself, `MCP_ALLOW_DESTRUCTIVE=false` removes the delete tools only, and `MCP_READ_ONLY=true` removes every tool that is not read-only (`Tests/WritePolicy.test.ts`). Tool results include `structuredContent` alongside the JSON text. Errors come back as in-band tool results (`isError: true`) with `statusCode`, `details`, and a `suggestion` — not as protocol errors. ## The size of tools/list Many clients load every tool definition before the first question, so `tools/list` is paid for on every connection. On 2026-11-02 oneuptime.com answered it with 283 tools in 1,202,028 bytes (about 300,000 tokens at four characters a token), more than many models hold: each `list_` and `count_` tool listed every field of its model with its operators and an example. On the code that changed this, the answer went from 289 tools in 1,228,155 bytes to 290 tools in 237,400 bytes (about 59,000 tokens): - `list_` and `count_` tools take any field in `query` and `sort` and say how a filter is written; `oneuptime_describe_resource` gives the fields on demand, one resource at a time. - Generated schemas carry no examples. A typed value such as a date (`{"_type": "DateTime", "value": ...}`) or a color keeps its shape as schema, since its example was the only place that stated it. - `create_` tools explain only the fields a call cannot leave out, and `update_` tools name and type their fields without explaining them. Every field is still listed and typed, so a client that validates a call still can. - Tool names, titles and annotations are unchanged. `Tests/ToolListBudget.test.ts` reads `tools/list` through the SDK's client and enforces BOTH the default `core` toolset budget (<= 60 tools, <= 64,000 bytes) AND the full `?toolsets=all` catalog budget (<= 381,000 bytes, <= 5,500 bytes per tool). A new model adds about 4–5 KB to `?toolsets=all`. When a change goes over, make the tools say less, or raise the budget in the same change and say why. On 2026-12-02 each tool's title in its annotations, for the Claude Connectors Directory, took `core` (57 tools) from 58,042 to 59,637 bytes and `?toolsets=all` (448 tools) from 356,831 to 371,497 bytes, so the full catalog's budget went from 357,000 to 372,000. Later on 2026-12-02 (#12038), adding `oneuptime_call_read_tool`, `list_incident_internal_notes`, and `list_monitor_status_events` to `core` (60 tools) took `core` to 62,946 bytes (budget raised to 64,000) and `?toolsets=all` (449 tools) to 372,513 bytes (budget raised to 373,500). Later on 2026-12-02 (#12110), adding `IncidentPostmortemComment` and `IncidentPostmortemVersion` (11 generated tools in `incidents`) took `?toolsets=all` (460 tools) to 379,853 bytes (budget raised to 381,000) while `core` stayed unchanged. ## Query, sort, select, and pagination To find a resource's fields, call `oneuptime_describe_resource` with the resource or one of its tools. It answers with every field, its type and meaning, the operators each type takes and how each is written, and a worked example. `Tests/DescribeResource.test.ts` runs every field and operator it offers through the code the API runs on a query. ### Queries Query fields accept a direct value or an operator object: ```json { "query": { "title": { "_type": "Search", "value": "database" }, "createdAt": { "_type": "GreaterThan", "value": "2026-07-01T00:00:00.000Z" } } } ``` Operators: `EqualTo`, `NotEqual`, `IsNull`, `NotNull`, `EqualToOrNull`, `GreaterThan`, `LessThan`, `GreaterThanOrEqual`, `LessThanOrEqual`, `InBetween` (with `startValue` and `endValue`), `Search`, `Includes` (with an array). Which a field takes depends on its type. A telemetry map field such as `attributes` is filtered by its keys: `{"attributes": {"http.method": "GET"}}`. A filter written another way, such as MongoDB's `{"$regex": "..."}` or an operator OneUptime does not have, is refused before it reaches the API, with an error that names the field and says how an operator is written (`Tools/FilterCheck.ts`). The API would pass it on, and the database would compare a text column with the object's JSON and match nothing. A relation filtered by its own fields (`{"currentIncidentState": {"isResolvedState": false}}`) and a map filtered by its keys are filters, and pass. ### Sort ```json { "sort": { "createdAt": "DESC" } } ``` Values are `"ASC"` or `"DESC"`. Each telemetry tool names the time column to filter and sort on (`time`, `startTime`, `windowStart` or `validFrom`). ### Select `get_` and `list_` tools take an optional `select` array of field names, telemetry's included (a `{ "field": true }` object still works). By default all readable fields are returned **except** heavy ones (JSON / VeryLongText / HTML columns), which must be requested explicitly. A relation comes back as its record's ID (`{"_id": ...}`), except one to a state, a status or a severity, which also says what that record is (`NAMING_FIELDS_OF_RELATED_TABLES` in `Services/SelectFieldGenerator.ts`). An incident's `currentIncidentState` comes back as `{"_id": ..., "name": "Resolved", "isResolvedState": true}` and its `incidentSeverity` as `{"_id": ..., "name": "Major"}`; an alert's state and severity the same way; a monitor's `currentMonitorStatus` with its `name`, `isOperationalState` and `isOfflineState`; a scheduled maintenance event's state with its `name`, `isOngoingState`, `isEndedState` and `isResolvedState`. So an agent can say which incidents are open, and how severe, from `list_incidents` alone. Before, it had to match IDs against `list_incident_states` and `list_incident_severities`, and ChatGPT's default model did not: it listed resolved incidents as open. A `select` that names such a relation, or the field that holds its ID (`currentIncidentStateId`), gets the same; one that names the relation's own fields (`{"currentIncidentState": {"color": true}}`) is sent as written. The API reads these fields in the join it already makes for the ID, and every reader of the record may read them, so they never make a read fail. `oneuptime_describe_resource` marks each such relation `comesBackWith`, and `Tests/RelatedRecordNames.test.ts` holds all of this, down to what an agent reads from `list_incidents`, `list_alerts` and `list_monitors`. ### Pagination `limit` defaults to 10 (max 100); `skip` offsets into the result set. List responses return the full requested page with honest pagination metadata: ```json { "returnedCount": 10, "totalCount": 42, "skip": 0, "limit": 10, "hasMore": true, "data": ["..."] } ``` ## Example workflow A typical incident-response loop an agent can run: 1. `oneuptime_whoami` — confirm which project the credential belongs to. 2. `list_incidents` with `{"sort": {"createdAt": "DESC"}, "limit": 5}` — find the active incident. 3. `acknowledge_incident` — take ownership. 4. `list_logs` with a time-range filter (`{"time": {"_type": "GreaterThan", "value": "..."}}`) and `list_exception_instances` — investigate. 5. `add_incident_note` with `"visibility": "public"` — post a status update for customers. 6. `resolve_incident` — close it out. ## HTTP endpoints | Endpoint | Method | Behavior | | ------------- | ------ | ------------------------------------------------------------------------ | | `/mcp` | POST | JSON-RPC (tool calls and all MCP operations) | | `/mcp` | GET | Without an SSE `Accept` header: friendly JSON discovery payload. With one: `405` (no standalone SSE stream in stateless mode). | | `/mcp` | DELETE | No-op (stateless — nothing to terminate) | | `/mcp/tools` | GET | REST listing of available tools | | `/mcp/health` | GET | Health check, including the protocol versions this build speaks | | `/mcp/.well-known/oauth-protected-resource` | GET | Protected resource metadata (also at `/.well-known/oauth-protected-resource[/mcp]`) | | `/.well-known/oauth-authorization-server/mcp` | GET | Authorization server metadata (also at `/mcp/.well-known/oauth-authorization-server` and the origin's root) | | `/mcp/oauth/authorize` | GET, POST | Authorization endpoint: checks the client's request and redirects to the consent screen | | `/mcp/oauth/token` | POST | Code exchange and refresh | | `/mcp/oauth/register` | POST | Dynamic Client Registration | | `/mcp/oauth/revoke` | POST | Token revocation | | `/mcp/oauth/consent/{details,approve,deny}` | POST | The consent screen's own calls (session cookie, same origin only) | ## Protocol compatibility The server negotiates rather than rejects, so a client does not have to match the MCP SDK bundled in the App container exactly. **Protocol version.** The `MCP-Protocol-Version` request header is negotiated down to the highest version both sides support. A header sent twice is read as its first value — Node collapses repeated headers into one comma-joined string, and a version never contains a comma: - a version the server supports is used as-is; - a version *newer* than anything the server knows about (for example a client on a newer revision of the spec) is negotiated down to the server's latest — the same answer `initialize` gives; - a version *older* than everything the server supports, or one that is not a `YYYY-MM-DD` version at all, has no common ground. The request is answered with `400` and a JSON-RPC error that names the requested version and lists the supported ones, instead of failing silently at the transport layer. An unusable header on an `initialize` request is dropped rather than rejected, because that request negotiates the version in its body. A header that is present but *blank* is dropped too: an empty string is not the same as an absent header to the SDK, which would otherwise reject it like any other unknown version. `GET /mcp` and `GET /mcp/health` both list the supported versions, so a failing handshake can be diagnosed without reading container logs. **Response format.** A POST is answered with whatever the client's `Accept` header allows: `text/event-stream` when the client asks for it by name or via the `text/*` range (what spec-compliant MCP clients do), and a plain `application/json` body otherwise — including for `Accept: application/json`, an `application/*` or `*/*` wildcard, or no `Accept` header at all. Both are valid replies to a POST under the MCP spec. A client that accepts neither gets a `406` naming the media types the endpoint can produce. **Diagnostics.** Negotiation logs describe the *client*: they are built from a snapshot taken before the headers are rewritten, so they report what was actually sent rather than the values this server normalised them to. Every field in them — header values and the JSON-RPC method alike — is stripped of control characters and length-capped, so a caller cannot forge log lines or flood the log through them. The API key or access token is never logged. ## Self-hosting The MCP server ships as part of the App container and is served at `/mcp` behind Nginx — no separate deployment is needed. Its tools call the OneUptime API at the App's internal address - `SERVER_APP_HOSTNAME` and `APP_PORT`, the address Nginx proxies `/api` to (inherited from the App service's environment) - never through the public `HOST`, which the App container cannot always reach (with `HOST=localhost` it is the container itself). API keys are never configured on the server; clients supply them per request. OAuth sign-in needs nothing configured either, but it does depend on `HOST` and `HTTP_PROTOCOL` being the address people actually use: the issuer, the token audience and every endpoint in the discovery documents are built from them. A reverse proxy in front of OneUptime has to forward `/.well-known/oauth-protected-resource` and `/.well-known/oauth-authorization-server` (and everything under them) to the App along with `/mcp`; the bundled Nginx does. ## MCP Registry OneUptime Cloud's server is listed in the official [MCP Registry](https://registry.modelcontextprotocol.io), which MCP clients and directories read, as `com.oneuptime/mcp`. [`server.json`](server.json) is the entry: streamable HTTP at `https://oneuptime.com/mcp`, signed in to with OAuth, or given a project API key in the optional `x-api-key` header. Its `version` is a placeholder, `0.0.0`. Every release publishes it at the release's version. The `publish-mcp-registry` job in `.github/workflows/release.yml` runs `Scripts/MCP/PublishToMcpRegistry.sh` once the GitHub release is published, and skips a version the registry already has, so re-running a release publishes nothing twice. A published version cannot be changed. Only whoever controls `oneuptime.com` may publish under `com.oneuptime`. The job signs in with an Ed25519 private key whose public key is in a TXT record on `oneuptime.com`, and it fails, publishing nothing, until both are in place. To set them up (Ed25519 needs OpenSSL 3; on macOS, `brew install openssl@3` and use its `openssl`, not the system LibreSSL): 1. Make a key pair: ```bash openssl genpkey -algorithm Ed25519 -out mcp-registry-key.pem ``` 2. Add a TXT record on `oneuptime.com` itself, not on a subdomain such as `_mcp.oneuptime.com`, with the value this prints: ```bash echo "v=MCPv1; k=ed25519; p=$(openssl pkey -in mcp-registry-key.pem -pubout -outform DER | tail -c 32 | base64)" ``` 3. In the repository's **Settings → Environments**, create `mcp-registry-publish`, limit its deployment branches to `release`, and give it the secret `MCP_REGISTRY_PRIVATE_KEY`: the private key in hex, which this prints: ```bash openssl pkey -in mcp-registry-key.pem -noout -text | grep -A3 "priv:" | tail -n +2 | tr -d ' :\n' ``` Then delete `mcp-registry-key.pem`, or keep it somewhere safe: whoever has the key can publish, and overwrite, any entry under `com.oneuptime`. To change the key, replace the TXT record and the secret together; an old record left beside the new one is tried first and fails the sign-in. To publish before the next release, run the script by hand from the repository root, with [`mcp-publisher`](https://github.com/modelcontextprotocol/registry/releases) and `jq` installed: `PACKAGE_VERSION= MCP_REGISTRY_PRIVATE_KEY= bash Scripts/MCP/PublishToMcpRegistry.sh`. ## ChatGPT plugin directory [`ChatGPTPlugin/`](ChatGPTPlugin/README.md) is the package OneUptime uploads to the ChatGPT plugin directory, which ChatGPT and Codex share: the listing, five positive and three negative review test cases, and `mcp.json`, which points at `https://oneuptime.com/mcp` and signs in with OAuth for read and write access. `npm run build-chatgpt-plugin` builds the ZIP, and adds the coding agent plugin's four skills, which ChatGPT and Codex load. Its README lists what else a submission needs: a verified developer identity, a domain-verification token served at `https://oneuptime.com/.well-known/openai-apps-challenge`, reviewer credentials for a demo project, and a demo video. `Tests/ChatGPTPlugin.test.ts` holds the package to the Agent Plugins schemas and OpenAI's limits, and checks that every tool a test case names is one this server has. ## Coding agent plugin [`CodingAgentPlugin/`](CodingAgentPlugin/README.md) is the plugin OneUptime lists for coding agents in Cursor's Marketplace and the Claude directory. It holds the hosted server's address and four skills: adding OpenTelemetry, setting up monitors and a status page, investigating an incident, and using the CLI in scripts and CI. `npm run build-coding-agent-plugin` builds a folder with the Agent Plugins, Cursor and Claude manifests side by side, taking the listing's words, links and icon from `ChatGPTPlugin/`. Both directories read a plugin from a public Git repository of its own, `OneUptime/oneuptime-agent-plugin`. Each release that changes the plugin publishes it there, through the `publish-coding-agent-plugin` job in `.github/workflows/release.yml`. A maintainer creates the repository and its deploy key once, and submits it to the directories: the package's README lists those steps. `Tests/CodingAgentPlugin.test.ts` runs the build, checks the folder against the Agent Plugins schemas and each directory's rules, and checks every tool and JSON example a skill names against this server. ## Development The MCP server lives in `packages/App/FeatureSet/MCP` and is mounted into the App service at startup (`packages/App/Index.ts`). Tests live in `packages/App/FeatureSet/MCP/Tests` and run as part of the App test suite: ```bash cd packages/App npm install npx jest ./FeatureSet/MCP/Tests --runInBand ``` New models are picked up automatically: decorate a database model with `@EnableMCP` (or set `enableMCP` on an analytics model) and the tool generator creates its tools on the next start. ## License Apache-2.0 - See LICENSE file for details.