mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-12-05 05:45:00 +00:00
Publishes a JSON schema for `mcp.json` at `https://pi.dev/schemas/mcp.schema.json`, like the existing models/settings/keybindings/theme schemas. Closes #12563. ## What **pi-mcp** (owner of the shared `mcpServers` shape): - New `./config-schema` export: the shared fields as a JSON Schema built with pi-schema, following the pi-ai compat/model-schema pattern. Field-level constraints (loopback `callbackUrl`, non-blank `clientName`, port bounds, URL patterns, `protocol`) live here, next to the validator they mirror. - `McpStdioServerConfig`, `McpHttpServerConfig`, and `McpOAuthConfig` now derive from the schema (`Static`), so schema and types cannot drift. `McpHttpServerConfig.type` now includes `"streamable-http"`, which the validator always accepted. The validator itself is unchanged, and the root export does not load pi-schema (type-only imports). **coding-agent**: - `src/core/mcp-config-schema.ts` composes pi's fields (`exposure`, `toolExposure`, `auth`, `autoEnableCodemode`, project override entries) on top of pi-mcp's property maps, re-annotated with pi's behavior, and `generate-schemas.ts` emits the committed `schemas/mcp.schema.json`. - Entries, oauth, and the document root are closed objects: the loader deliberately keeps unknown fields, so a mistyped key (`exposur`, `mcpSevers`) changes behavior silently today; the schema flags it in the editor. - Docs: `$schema` line in `docs/mcp.md`, plus a section for the previously undocumented `auth` field (separate commit). ## Intentional schema/runtime differences Documented in the `mcp-config-schema.ts` header and asserted in the tests: cross-field rules stay prose (override/`auth` file scoping, cimd restrictions, port agreement), URL schemes must be lowercase, and entries mixing `url` with `command` are flagged although the runtime picks HTTP. ## Tests - `packages/mcp/test/config-schema.test.ts`: schema/validator agreement for the shared fields. - `packages/coding-agent/test/config-schemas.test.ts`: fifth artifact pinned, representative documents, a runtime-validator agreement test (accept and reject lists plus the documented asymmetries), and a compile-time key-parity guard against the runtime config types. - `npm run check` clean; pi-mcp suite 199/199; coding-agent config-schemas/documentation/references pass. This PR is AI-generated. |
||
|---|---|---|
| .. | ||
| biome | ||
| agent-treeshake-smoke-entry.ts | ||
| auto-pi.sh | ||
| biome-check.mjs | ||
| browser-smoke-entry.ts | ||
| build-binaries.sh | ||
| build-coding-agent-bundle.mjs | ||
| check-browser-smoke.mjs | ||
| check-entry-graphs.mjs | ||
| check-lockfile-commit.mjs | ||
| check-model-catalog-compat.mjs | ||
| check-package-install.mjs | ||
| check-pinned-deps.mjs | ||
| check-pinned-deps.test.mjs | ||
| check-released-changelogs.mjs | ||
| check-released-changelogs.test.mjs | ||
| check-runtime-deps.mjs | ||
| check-runtime-deps.test.mjs | ||
| check-ts-relative-imports.mjs | ||
| coding-agent-smoke.mjs | ||
| coding-agent-smoke.test.mjs | ||
| cost.ts | ||
| create-source-archive.sh | ||
| diff-model-catalog.mjs | ||
| durable-browser-smoke-entry.ts | ||
| edit-tool-stats.mjs | ||
| generate-coding-agent-install-lock.mjs | ||
| generate-thinking-capabilities.mjs | ||
| local-package-install.mjs | ||
| local-package-install.test.mjs | ||
| local-release.mjs | ||
| model-catalog-minimum-version.mjs | ||
| model-catalog-protocol.test.ts | ||
| model-catalog-protocol.ts | ||
| npm-audit.mjs | ||
| npm-command.mjs | ||
| pack-packages.mjs | ||
| package-artifact-cli.test.mjs | ||
| package-artifacts.mjs | ||
| package-artifacts.test.mjs | ||
| package-files.mjs | ||
| package-files.test.mjs | ||
| package-workspaces.mjs | ||
| preview-packages.mjs | ||
| preview-packages.test.mjs | ||
| profile-coding-agent-node.mjs | ||
| publish-model-catalog.mjs | ||
| publish-model-catalog.test.mjs | ||
| publish-release-announcement.mjs | ||
| publish-release-announcement.test.mjs | ||
| publish.mjs | ||
| read-tool-stats.mjs | ||
| release-notes.mjs | ||
| release-packages.mjs | ||
| release-packages.test.mjs | ||
| release.mjs | ||
| repro-5893-wsl-bash.mjs | ||
| session-context-stats.mjs | ||
| session-transcripts.ts | ||
| smoke-test-codemode-binary.mjs | ||
| stats.ts | ||
| sync-versions.js | ||
| sync-versions.test.mjs | ||
| tool-stats.ts | ||
| update-model-catalog-pin.mjs | ||
| update-model-catalog-pin.test.mjs | ||
| update-source-imports-to-ts.sh | ||
| use-local-packages.mjs | ||