Start free trial
Start free trial Log in

14-day free trial. No credit card.

Using the NightOwl MCP Server

Browse issues, read stack traces, and resolve bugs from Claude Code, Codex, or Cursor, without leaving the editor.

  • Guide
  • 5 min read

How do I connect NightOwl to Claude Code, Codex, or Cursor?

Generate a personal access token in NightOwl (Tokens, in the account sidebar; Team or Agency plan), then run claude mcp add --transport http nightowl https://api.usenightowl.com/mcp/[app-id] --header 'Authorization: Bearer [token]'. Codex reads servers from ~/.codex/config.toml (url plus bearer_token_env_var), Cursor connects over HTTP with a .cursor/mcp.json entry, and npx mcp-remote covers stdio-only clients. The server exposes 51 tools, and every AI-initiated issue change is logged with actor_type=mcp in the issue activity timeline.

Updated

An MCP server lets an AI coding assistant talk to your monitoring directly. Instead of copy-pasting a stack trace into Claude, Claude reads it from NightOwl itself. Point Claude Code, Codex, or Cursor at NightOwl's MCP endpoint and it can list your issues, read a parsed stack trace, check how often an exception is happening, look at requests, queries, jobs and logs, and update or comment on issues the way you would in the dashboard, without leaving the editor. Every change it makes is logged in the issue activity timeline as AI-authored, so an assistant working your issues leaves the same audit trail a human would. Setup is three steps.

1. Generate a token

In your NightOwl dashboard, open Tokens in the left sidebar of the account area (next to Account, Teams and Subscription). MCP is part of the Team and Agency plans. Give the token a label that will help you recognize it later (e.g. "Laptop (Claude Code)") and copy the token immediately. NightOwl shows the plaintext token exactly once; after that only the label, creation date, and last-used time are visible.

Tokens are tied to your user account and inherit your team membership. Revoking a token from the same page rejects every later call made with it, from any client.

2. Connect your client

The endpoint is app-scoped: /mcp/[app-id]. Each connection talks to exactly one NightOwl app. Copy the app ID from the app's Settings page in the dashboard.

Claude Code

Terminal
claude mcp add --transport http nightowl \
  https://api.usenightowl.com/mcp/[app-id] \
  --header "Authorization: Bearer [token]"

Codex

~/.codex/config.tomltoml
[mcp_servers.nightowl]
url = "https://api.usenightowl.com/mcp/[app-id]"
bearer_token_env_var = "NIGHTOWL_MCP_TOKEN"

Codex: export the token

Terminal
# Add to ~/.zshrc (or ~/.bashrc), then `source` it
export NIGHTOWL_MCP_TOKEN="[token]"

Codex: CLI alternative (skip the TOML edit)

Terminal
codex mcp add nightowl \
  --url https://api.usenightowl.com/mcp/[app-id] \
  --bearer-token-env-var NIGHTOWL_MCP_TOKEN

Cursor (native HTTP)

.cursor/mcp.jsonjson
{
  "mcpServers": {
    "nightowl": {
      "url": "https://api.usenightowl.com/mcp/[app-id]",
      "headers": {
        "Authorization": "Bearer ${env:NIGHTOWL_MCP_TOKEN}"
      }
    }
  }
}

Stdio-only clients (via mcp-remote)

json
{
  "mcpServers": {
    "nightowl": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://api.usenightowl.com/mcp/[app-id]",
        "--header",
        "Authorization: Bearer [token]"
      ]
    }
  }
}

Windsurf and Zed support remote HTTP servers too: give them the same URL and Authorization header in their MCP settings. The mcp-remote shim is only a fallback for clients that can't.

In Claude Code, run /mcp after adding the server to verify it connected. You should see the NightOwl tools listed. In Cursor, the tools appear in the AI panel under the NightOwl server entry after the JSON is saved.

3. Tool reference

The per-app server has 51 tools. Every tool operates on the app ID in the URL, so AI clients never need to pass app_id as an argument. Tool names are the kebab-case class names. The issue tools:

Tool What it does
list-issues-tool Filter exception or performance issues by status, environment, priority, assignee, or search term. Returns compact summaries.
get-issue-tool Full issue detail: metadata, comments and activity timeline. Exception issues add the latest exception, its stack trace and recent occurrences; performance issues add recent executions over the threshold.
get-stack-trace-tool Parsed stack frames flagged app vs vendor. Optional trace_id for a specific occurrence.
get-issue-occurrences-tool Time-bucketed counts over 24h / 7d / 30d, plus breakdown by environment and unique users affected.
update-issue-status-tool Change status (open / resolved / ignored), priority, assignee, or description. A status change fires your configured alert channels.
bulk-update-issues-tool Change the status of up to 200 issues in one call.
add-issue-comment-tool Post a markdown comment. Pass resolve:true to resolve the issue in the same call.
Telemetry tools list-* and get-* tools for requests (including route detail), exceptions, queries, jobs, commands, scheduled tasks, cache events, logs, mail, notifications, outgoing requests and users, plus dashboard-overview-tool.
Configuration tools Alert channels (list, create, update, delete, toggle, test), settings, environments and thresholds.
Data management tools filter-options-tool, preview-deletion-tool and destroy-data-tool. Deleting requires confirm:"YES", and the server tells the assistant to preview first.

Account-level work (apps, teams, invitations, MCP tokens, agent health, subscription status) lives on a separate server at /mcp/platform with 25 tools, using the same kind of token.

4. Safety model

Letting an AI agent write to your production monitoring data deserves a careful threat model. Here is how NightOwl handles it:

  • Scoped tokens. Tokens can only access apps the owning user can open in the dashboard. The URL's app ID is checked against that access on every call.
  • Same roles as the dashboard. Tools that change data need the admin or owner role on the app. Read-only members can read but not mutate.
  • Audit trail. Every issue change made through MCP writes an activity record with actor_type=mcp and actor_meta carrying the token label and client user-agent. The dashboard timeline renders AI-authored actions distinctly.
  • Revoke. Deleting a token from the Tokens page rejects every later call made with it. A call that is already running finishes.
  • Alert parity. Status changes made via MCP fire the same alert channels (Slack, Discord, webhook, email) that a human status change would, so your on-call engineer still sees them. Comments, priority and assignee changes don't send alerts.
  • Ability-gated. A personal access token needs the mcp ability to reach the server. Tokens created on the Tokens page carry it.

5. Example triage session

With the server connected, ask your AI assistant a question that spans your NightOwl data and your codebase:

text
> What are the top three open exceptions in production right now,
  and is any of them caused by code I changed in the last week?

The assistant calls list-issues-tool with {status: "open", environment: "production", limit: 3}, then get-issue-tool for each hit, then runs git log locally to cross-reference authorship.

When you've fixed one, the assistant can close the loop:

text
> Mark issue #4812 as resolved and leave a comment explaining
  that the null check in OrderService was the fix.

One add-issue-comment-tool call with resolve:true. The comment and the status change are saved together in one transaction, then the resolved alert goes out to your channels. Both show up in the issue timeline attributed to MCP rather than to you directly.

Triage your own app's issues from the editor

MCP comes with the Team and Agency plans, and a 14-day Team or Agency trial includes it. Once your app is connected, create a token under Tokens in the account sidebar and point your editor at it.

No credit card needed.

Frequently asked questions

Anything else, write to support@usenightowl.com

What is the NightOwl MCP server?

An HTTP endpoint that exposes a NightOwl app to AI coding assistants through the Model Context Protocol. Claude Code, Codex, Cursor, and other MCP clients can triage issues, read stack traces, browse every kind of telemetry, and manage alert channels, settings and data deletion without leaving the editor. Each connection is scoped to one NightOwl app and authenticated with a personal access token that carries the mcp ability.

Is it safe to let an AI assistant read and mutate my issues?

Each MCP change to an issue is logged in the issue activity timeline with actor_type=mcp, so AI-authored edits are visually distinct from human edits. Tokens belong to a single NightOwl user and cannot reach apps that user can't open in the dashboard. Tools that change data need the admin or owner role, the same check the dashboard runs. Deleting a token rejects every later call made with it.

Does this cost extra?

The MCP server is included in the Team ($15/month) and Agency ($69/month) plans. Hobby doesn't include it. There are no per-tool-call charges and no separate billing.

What tools does it expose?

The per-app server at /mcp/[app-id] has 51 tools. Seven handle issues: list-issues-tool, get-issue-tool, get-stack-trace-tool, get-issue-occurrences-tool (counts over 24h, 7d or 30d), update-issue-status-tool, bulk-update-issues-tool and add-issue-comment-tool (optionally resolving in the same call). The rest list and open requests, exceptions, queries, jobs, commands, scheduled tasks, cache events, logs, mail, notifications, outgoing requests and users, and manage alert channels, thresholds, settings and data deletion. A separate server at /mcp/platform has 25 tools for apps, teams, invitations, MCP tokens and agent health.

How is this different from just asking the AI to curl the API?

MCP gives the AI structured tool definitions with typed schemas, so it picks the right call instead of guessing endpoints, and the client never has to be told your API routes by hand.

Does it work with Cursor, Windsurf, and Zed?

Yes. Claude Code, Codex, Cursor, Windsurf and Zed all support remote HTTP MCP servers. Point them at the NightOwl endpoint with an Authorization header. Clients that only speak stdio can use the npx mcp-remote shim, which proxies a remote HTTP MCP server as a stdio server. Configuration snippets are in the setup section below.

Where do I get a token?

Sign in to your NightOwl dashboard and open Tokens in the left sidebar of the account area (next to Account, Teams and Subscription). Create an MCP token, give it a label, and copy the value immediately. It's shown only once. You can revoke any token from the same page without affecting others. Creating tokens needs a Team or Agency plan.

Monitor Laravel and let your AI assistant triage

Every plan starts with a 14-day free trial. No credit card needed.

Hobby
$5 a month

One app for a side project. Issues and alerts, with a 14-day dashboard window.

Start my 14-day trial
TeamRecommended
$15 a month

Up to 3 apps and 5 people per team. Full history, the MCP server, data clearing and agent health.

Start my 14-day trial
Agency
$69 a month

Unlimited client apps and people, one overview of every app, and apps you can hand over.

Start my 14-day trial

Let your assistant read your stack traces

Connect your app, give your editor a token and ask it about your latest issue. No credit card needed.