Skip to content

fix: register google-duration format to silence unknown format warnings - #2601

Open
appflowsolution wants to merge 3 commits into
modelcontextprotocol:mainfrom
appflowsolution:fix/register-google-duration-format
Open

fix: register google-duration format to silence unknown format warnings#2601
appflowsolution wants to merge 3 commits into
modelcontextprotocol:mainfrom
appflowsolution:fix/register-google-duration-format

Conversation

@appflowsolution

Copy link
Copy Markdown

Why

Firebase MCP (and other Google Cloud API MCP servers) use the google-duration format in their JSON Schemas — values like "3600s", "1.5s", "100ms". AJV logs unknown format "google-duration" ignored in schema at path "#/properties/versionRetentionPeriod" warnings for every schema that references it, creating noisy startup output for every user of these MCP servers.

What

Register the google-duration format on the default AJV instances created by AjvJsonSchemaValidator. The regex matches Google's Duration proto format: a number (integer or decimal) followed by a time unit suffix (s, ms, us, ns, m, h, d).

Impact

  • Silences the unknown format "google-duration" warnings at startup
  • No behavior change — AJV already ignores unknown formats; this just registers it so the warning is not emitted
  • Applies to all three dialect engines (2020-12, 2019-09, draft-07) since they all go through createDefaultAjvInstance
  • Users who pass their own AJV instance are unaffected (they own their format registration)

Testing

No new tests needed — this is a format registration that silences a warning. The existing test suite covers AjvJsonSchemaValidator behavior.

Firebase MCP and other Google Cloud API MCP servers use the
'google-duration' format (e.g. '3600s', '1.5s') in their JSON Schemas.
AJV logs 'unknown format "google-duration" ignored' warnings for each
schema that references it, creating noisy startup output.

Register the format with a regex validator matching Google's Duration
proto format: a number followed by a time unit suffix (s, ms, us, ns,
m, h, d). This silences the warnings without affecting validation
behavior since the SDK already ignores unknown formats.
@appflowsolution
appflowsolution requested a review from a team as a code owner August 2, 2026 00:24
@changeset-bot

changeset-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fce58bc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/core-internal Patch
@modelcontextprotocol/client Patch
@modelcontextprotocol/server Patch
@modelcontextprotocol/core Patch
@modelcontextprotocol/server-legacy Patch
@modelcontextprotocol/codemod Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2601

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2601

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2601

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2601

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2601

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2601

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2601

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2601

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2601

commit: fce58bc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants