[ GUIDE ]

Using the NightOwl MCP Server

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

QUICK ANSWER

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

Generate a personal access token in NightOwl (Tokens page from the platform top nav), then run claude mcp add --transport http nightowl https://your-nightowl-host/mcp/<app-id> --header 'Authorization: Bearer <token>'. Codex reads servers from ~/.codex/config.toml (set url and bearer_token_env_var, then export the token in your shell). Cursor and Windsurf use npx mcp-remote. The server exposes six tools: list_issues, get_issue, get_stack_trace, get_issue_occurrences, update_issue_status, add_issue_comment. Every AI-initiated change is logged with actor_type=mcp in the issue activity timeline.

Updated · 2026-04-14

1. Generate a token

In your NightOwl dashboard, open the Tokens page from the platform top nav (alongside Account, Teams, Subscription). 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 invalidates it instantly for all clients that were using it.

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 Apps page in the dashboard.

Claude Code

sh
claude mcp add --transport http nightowl \
  https://your-nightowl-host/mcp/<app-id> \
  --header "Authorization: Bearer <token>"

Codex

~/.codex/config.tomltoml
[mcp_servers.nightowl]
url = "https://your-nightowl-host/mcp/<app-id>"
bearer_token_env_var = "NIGHTOWL_MCP_TOKEN"

Codex — export the token

sh
# Add to ~/.zshrc (or ~/.bashrc), then `source` it
export NIGHTOWL_MCP_TOKEN="<token>"

Codex — CLI alternative (skip the TOML edit)

sh
codex mcp add nightowl \
  --url https://your-nightowl-host/mcp/<app-id> \
  --bearer-token-env-var NIGHTOWL_MCP_TOKEN

Cursor (native HTTP)

.cursor/mcp.jsonjson
{
  "mcpServers": {
    "nightowl": {
      "url": "https://your-nightowl-host/mcp/<app-id>",
      "headers": {
        "Authorization": "Bearer ${env:NIGHTOWL_MCP_TOKEN}"
      }
    }
  }
}

Windsurf, Zed, and other stdio-only clients (via mcp-remote)

json
{
  "mcpServers": {
    "nightowl": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://your-nightowl-host/mcp/<app-id>",
        "--header",
        "Authorization: Bearer <token>"
      ]
    }
  }
}

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

3. Tool reference

Every tool operates on the app ID in the URL. AI clients never need to pass app_id as an argument.

Tool What it does
list_issues Filter issues by type, status, environment, priority, assignee, or search term. Returns compact summaries.
get_issue Full issue detail including latest exception, stack trace, recent occurrences, comments, and activity timeline.
get_stack_trace Parsed stack frames flagged app vs vendor. Optional trace_id for a specific occurrence.
get_issue_occurrences Time-bucketed counts over 24h / 7d / 30d, plus breakdown by environment and unique users affected.
update_issue_status Change status (open / resolved / ignored), priority, or assignee. Fires configured alert webhooks.
add_issue_comment Post a markdown comment. Pass resolve:true to auto-resolve the issue in the same call.

4. Safety model

AI agents writing to production monitoring data deserves a careful threat model. NightOwl's guarantees:

  • Scoped tokens. Tokens can only access apps where the owning user is a team member. The URL's app ID is checked against team membership on every call.
  • Audit trail. Every mutating tool call 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.
  • Instant revoke. Deleting a token from the Tokens page blocks all in-flight and future calls using it.
  • Webhook parity. Status changes made via MCP fire the same alert channels (Slack, Discord, webhook, email) that a human change would — your oncall still sees them.
  • Ability-gated. Only tokens minted with the mcp ability can reach the server. Dashboard session cookies and other PATs cannot.

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 with {status: "open", environment: "production", limit: 3}, then get_issue for each hit, then runs git log locally to cross-reference authorship. Root cause in one turn.

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 call with resolve:true. The comment, the status change, and the resulting webhook all happen atomically — and show up in the issue timeline attributed to MCP rather than to you directly.

Frequently asked questions

What is the NightOwl MCP server?

An HTTP endpoint that exposes NightOwl's issue data to AI coding assistants through the Model Context Protocol. Claude Code, Codex, Cursor, and other MCP clients can list issues, read stack traces, and update statuses without leaving the editor. Everything is scoped to your own NightOwl app and authenticated with a personal access token.

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

Each MCP action is logged in the issue activity timeline with actor_type=mcp, so AI-authored edits are visually distinct from human edits and revokable by deleting the token. Tokens are scoped to a single NightOwl user and cannot access apps you aren't a team member of. The server uses the same team-membership check as the dashboard API.

Does this cost extra?

No. The MCP server is included with every NightOwl plan. There are no per-tool-call charges and no separate billing — your existing BYOD or Managed plan covers it.

What tools does it expose?

Six tools today: list_issues (filter and page through issues), get_issue (full detail with comments and activity), get_stack_trace (parsed app vs vendor frames), get_issue_occurrences (time-bucketed counts over 24h / 7d / 30d), update_issue_status (change status, priority, assignee), add_issue_comment (post a comment, optionally auto-resolve).

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 the first time instead of guessing endpoints. The protocol also handles streaming responses, error signaling, and progress notifications — the raw HTTP API doesn't. And the client never has to be told your OpenAPI spec by hand.

Does it work with Cursor, Windsurf, and Zed?

Yes. Claude Code, Codex, and Cursor all speak bearer-token HTTP MCP natively — point them at the NightOwl endpoint with an Authorization header. Windsurf, Zed, and other stdio-only clients 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 the Tokens page from the platform top nav (alongside Account, Teams, 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.

PRICING

Monitor Laravel + let your AI assistant triage

14-day free trial, no credit card. Your PostgreSQL, your data.

HOBBY

$5 /month

1 app · 14 days lookback · all Laravel events

TEAM

$15 /month

Up to 3 connected apps · unlimited environments · all Laravel events

AGENCY

$69 /month

Unlimited apps · unlimited agent instances · same flat rate at any traffic