@extn/segi-mcp
v0.2.0
Published
MCP server that lets an AI agent (Claude) read segi error-monitoring data — issues, events, stack traces, project stats — using an organization API key
Readme
@extn/segi-mcp
MCP server for the segi error-monitoring platform. Connect Claude (Code / Desktop) or any MCP client to your segi organization and let the agent read issues, events, and stack traces — then diagnose and fix the bugs in your own codebase.
Setup
- In the segi console, go to Organization → API keys and create a key.
The plaintext key (
segi_sk_live_…) is shown once — copy it. - Add the server to Claude Code:
claude mcp add segi -e SEGI_SECRET_KEY=segi_sk_live_xxx -- npx -y @extn/segi-mcpEnvironment variables:
| Variable | Required | Description |
|---|---|---|
| SEGI_SECRET_KEY | yes | Organization API key from the segi console |
| SEGI_API_URL | no | API base URL (default https://segiapi.extn.ai) |
Tools
| Tool | Purpose |
|---|---|
| list_projects | Projects the key can read (call first to get project ids) |
| get_overview | Org-wide health: per-project counts, top unresolved issues, sparklines |
| list_issues | Search/filter a project's issues (status, level, text search, time range) |
| get_issue | Issue detail + latest event with full stack trace |
| get_issue_events | Paginated occurrences of one issue |
| search_events | Search the raw event stream |
| get_event | Full detail of a single event by eventId |
| get_project_stats | Project dashboard summary + 24h timeseries |
Monitoring tools are read-only. Analytics configuration writes require a new key with explicit analytics-write permission. Existing keys remain read-only. Keys are org-scoped (optionally restricted to a single project) and rate-limited per minute; revoke them any time from the console — revocation is immediate.
Example prompts
- "segi에서 지금 제일 시끄러운 에러가 뭐야? 원인 찾아서 고쳐줘."
- "What errors spiked after yesterday's deploy? Show me the stack traces."
- "Fix the top unresolved FATAL issue in the api project."
Analytics workflow
New tools require the server migration and the updated MCP package to be deployed together.
| Tool | Purpose |
|---|---|
| get_analytics_instrumentation_guide | Supported browser instrumentation and verification contract |
| list_analytics_items | Search received pages/events and registered definitions; 20 results per page |
| list_analytics_definitions | Get definitions and saved funnels, including id/version |
| get_analytics_receipts | Latest five receipt timestamps and page paths for one step |
| analyze_funnel | Ordered, same-session counts and independent observed counts per step |
| save_analytics_definition | Create/update an event definition or saved funnel; requires explicit write permission |
Ask your agent to inspect existing events and code before adding instrumentation. Emit
Segi.replay.event("purchase_done", { itemCount: 2 }) in the browser only after confirmed success.
Recording must be enabled and replay initialized. Do not use this browser API in server handlers.
Server-event/session correlation and exactly-once deduplication are not supplied by this workflow.
Never send raw forms, credentials, card data, or personal identifiers as properties.
Register kind: "event", eventName, name (display name), description and optional
properties: [{name: "itemCount", type: "number", description: "Purchased item count"}].
For a saved funnel use kind: "funnel", name, and steps (2–6 comma-separated conditions).
Update with the existing id and version; conflicts require re-reading before retrying.
Saving definitions does not emit events. Trigger a test action and compare receipt timestamps
against the test time, then validate the funnel. Do not claim verified delivery from code changes alone.
Definitions are project-scoped. OWNER/ADMIN may create a key with analytics writes enabled; other keys can inspect but cannot save. Changes record the key ID and revision. This permission does not grant issue triage, billing, or project-administration writes.
