APIGuard connects provider-side OpenAPI changes to scoped consumer-code evidence and records a versioned human release decision through a real NitroStack MCP server.
This repository contains the MCP server implementation, fixtures, widget, tests, Docker configuration and NitroCloud-ready project structure. The project was scaffolded manually to the current official NitroStack CLI layout after the execution VM could not reach registry.npmjs.org; on a normal machine, run the official CLI command shown below before comparing or replacing the scaffold.
npx @nitrostack/cli@latest init api-larp- MCP client: NitroStudio AI Chat, Tools/Resources pages, ChatGPT or another compatible host.
- MCP server: this TypeScript application using
@nitrostack/coredecorators and DI. - Registered surface: 5 tools, 3 resources, 1 prompt and 1 widget.
- External dependencies: GitHub and the LLM provider are internal server adapters, not MCP servers.
diff_api_specdiscover_consumer_evidenceassess_consumer_riskrun_impact_assessmentrecord_release_decision
apiguard://scenarios/{scenarioId}/specs/baselineapiguard://scenarios/{scenarioId}/specs/candidateapiguard://assessments/{assessmentId}
- Prompt:
review_api_release - Widget:
api-impact-summary
Requirements: Node.js 20.18+, npm 9+ and NitroStudio.
cp .env.example .env
npm run install:all
npm run devOpen this folder in NitroStudio using Add MCP Server → Nitro Project → Studio App Canvas.
npm run demoThis uses committed evidence and deterministic fallback classification. It needs no GitHub or LLM credentials.
# Set one provider key and USE_LLM=true in .env
npm run demo:llm# Requires a read-only GitHub token and configured public repository allow-list.
npm run demo:liveLive mode is not the critical judging path because it can be affected by rate limits and network latency.
flowchart LR
Client[NitroStudio / ChatGPT MCP Client] -->|MCP| Server[API-LARP NitroStack MCP Server]
Server --> Diff[Deterministic OpenAPI Diff]
Server --> Evidence[Snapshot or GitHub Evidence Adapter]
Server --> Risk[Bounded LLM Classifier]
Server --> State[Assessment State Machine]
Server --> Widget[API Impact Summary Widget]
Evidence --> GitHub[GitHub API]
Risk --> Model[OpenAI or Anthropic]
Business logic lives in injectable services. MCP controllers are thin decorator-based wrappers. All ESM imports use .js extensions.
Deterministic code parses OpenAPI, resolves local references, detects structural changes, filters test/docs/generated files, validates model output, computes severity and applies release-decision transitions. The LLM only classifies ambiguous executable snippets and proposes scoped migration guidance.
- OpenAPI 3.0 JSON
- Local
#/components/...references - Removed operation or parameter
- Parameter becoming required
- Required property removal
- Optional property becoming required
- Property type change
- Enum narrowing
- Optional property addition
Not supported: YAML, OpenAPI 3.1, remote references and complete polymorphic-schema compatibility.
npm testThe offline VM-verifiable pure-domain tests can be run with:
npm run test:offlinenpm run build
npm run start:prodThe build copies fixtures to dist/fixtures. Production automatically defaults to dist/fixtures; APIGUARD_FIXTURES_DIR is available only as an override.
See docs/NITROSTACK_ALIGNMENT.md for a requirement-by-requirement map to the official SDK, Studio, NitroCloud and supplied hackathon guidance.
- Push the public repository to GitHub.
- Open NitroStudio and verify every tool, resource, prompt, widget and health check.
- Connect NitroCloud and create an app/deployment from the repository.
- Add environment variables from
.env.examplein the NitroCloud dashboard. - Deploy and wait for
Pending → Building → Deploying → Live. - Connect the live Streamable HTTP/SSE MCP endpoint in NitroStudio and rerun the smoke flow.
- Fetch the baseline resource.
- Fetch the candidate resource.
- Run
run_impact_assessment({scenarioId:"risky"}). - Inspect the widget and provenance.
- Call
record_release_decisionwithBLOCKand a reason. - Fetch
apiguard://assessments/{assessmentId}and verify the state changed. - Show the MCP traffic log and live NitroCloud URL.
- Repository snippets are untrusted data.
- The internal model receives no tools.
- Model output is Zod-validated.
- Failure becomes
REVIEW_REQUIRED, not a green result. - Tokens and
.envare never committed. - Snapshot mode is labelled visibly.
- Search is scoped evidence collection, not complete dependency discovery.
- The MVP records a governed decision; it does not enforce CI branch protection.
Replace placeholder snapshot repositories and commit SHAs with a snapshot generated from the team's real public demonstration repositories. Then run the workflow three times, test the NitroCloud deployment, record the maximum three-minute video and submit the public repository through the required Sample Apps and NitroCloud flow.
The VM used to prepare this package had no outbound DNS access to registry.npmjs.org, so the requested npx @nitrostack/cli init api-larp command could not download the CLI. The requested exact command and the registry failure are preserved in docs/CLI_EXACT_ATTEMPT.txt; the earlier latest-version attempt is in docs/CLI_ATTEMPT.txt. The project was therefore scaffolded to the current official NitroStack CLI structure and SDK examples. Pure TypeScript domain tests were executed in the VM. A real npm install, NitroStack build, NitroStudio connection and NitroCloud deployment must be run on a networked machine before submission.