@extn/segi-mcp-nextjs
v0.2.0
Published
MCP server for adding @extn/segi-nextjs to a Next.js project via an AI agent
Readme
@extn/segi-mcp-nextjs
Model Context Protocol server that walks an AI coding agent (Claude Code, Cursor, etc.) through wiring @extn/segi-nextjs into a Next.js project.
Connect (Claude Code)
claude mcp add segi-nextjs -- npx -y @extn/segi-mcp-nextjsThen ask the agent something like "Add segi error monitoring to this Next.js app, my project key is segi_pk_live_…" and it will call the tools below to fetch the right install command, env vars, and file contents, and write them into your repo.
Tools exposed
| Tool | Returns |
| --- | --- |
| get_install_command(packageManager) | The install command for pnpm, npm, yarn, or bun |
| get_required_env_vars() | List of required + optional env vars with descriptions |
| get_setup_files(publicKey?) | File contents for app/segi-init.tsx, instrumentation.ts, plus a layout patch |
| get_test_snippets() | Client + server snippets to verify ingestion |
| get_session_recording_setup(publicKey?, endpoint?, blockRoutes?) | Patch for <SegiReplayProvider> in the root layout, a segi-mask CSS utility, and a reminder note (recording is off-by-default per project). Gated by the org plan (Free 10 / Team 30 / Enterprise ∞ per project per month) |
| get_session_recording_test_snippet() | A probe component that shows in the click heatmap within ~5s |
The MCP server is read-only — it only describes what to install and write. The AI agent applies the changes.
Adding session recording
After error monitoring is wired, ask the agent "Also turn on segi session recording" and it will call get_session_recording_setup to fetch the provider patch and the operator's enable-toggle reminder. The recording quota lives on your organization plan — see Plans & Billing.
LLM guides
Single-file references the agent can fetch when this MCP isn't enough context:
