Skip to main content

server-change

Rules for changes to the inspector's Hono server (mcpjam-inspector/server), including routes, services, logging, error reporting and the browserd daemon. Use before editing anything under mcpjam-inspector/server.

Datos de origen

Repositorio
MCPJam/inspector
Última actividad en el origen
11 de octubre de 2026 a las 07:23
Idioma detectado de SKILL.md
inglés
Estrellas
2265
Forks
295

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
server-change
description
Rules for changes to the inspector's Hono server (mcpjam-inspector/server), including routes, services, logging, error reporting and the browserd daemon. Use before editing anything under mcpjam-inspector/server.
# Server change ## Logging and errors Never use `console.*` in `server/`. ```ts import { logger } from "@/utils/logger"; ``` - `logger.error` goes to Sentry and Axiom. Use it only for real failures in MCPJam's own code. - `logger.warn`, `logger.info` and `logger.debug` go to Axiom only. - Route catch sites call `reportRouteFailure` from `server/utils/route-error-report.ts`, not `logger.error`. Pass the hop that failed, so a user's broken MCP server does not page MCPJam: ```ts reportRouteFailure("[mcp/chat-v2] stream error", error, { source: "mcp.chat-v2.stream", hop: "user_server_hop", // or "mcpjam_internal" }); ``` Anything under `/api/mcp/*` that proxies to a user's server is `user_server_hop`. - Never log tokens, access links, API keys or request bodies that may hold them. Background: `mcpjam-inspector/docs/server-error-reporting.md`. ## Tests - Route tests: `server/routes/mcp/__tests__/`. Helpers in `server/routes/mcp/__tests__/helpers/` (`createTestApp()`, `createMockMcpClientManager()`, `postJson()`, `expectError()`). - Anything whose correctness depends on WorkOS behavior (refresh tokens, API key revocation, JWKS) uses the emulator suites (`*.emulator.test.ts`) and `server/test/support/workos-emulator.ts`. Do not stub `fetch` for those. Do not export `WORKOS_API_BASE_URL` in the shell. - Cover the happy path, validation errors, error handling and empty/null input. ```bash npm run test -w @mcpjam/inspector -- server/routes/<area> ``` ## browserd daemon `server/services/browserd/dist/` is checked in and is what ships. After changing anything under `server/services/browserd/daemon/`, or anything it imports (`protocol.ts`, the WebMCP launch flags): ```bash npm run bundle:browserd -w @mcpjam/inspector ``` Commit both files in `dist/`. `pretest` fails if the bundle is stale. ## Auth-sensitive areas Changes to `server/routes/workos-authkit.ts`, `server/services/authkit-jwt.ts`, `server/services/guest-token*.ts`, `server/services/api-keys-relay.ts` or `server/middleware/` need a PR description that states who can reach the code path before and after the change.
Ver en GitHub