Skip to content

Add "Available in MCP" badge for OpenAPI operations#4350

Merged
nolannbiron merged 4 commits into
mainfrom
nolann/rnd-11615-add-available-in-mcp-badge-for-x-gitbook-mcp-true
Jul 1, 2026
Merged

Add "Available in MCP" badge for OpenAPI operations#4350
nolannbiron merged 4 commits into
mainfrom
nolann/rnd-11615-add-available-in-mcp-badge-for-x-gitbook-mcp-true

Conversation

@nolannbiron

@nolannbiron nolannbiron commented Jun 29, 2026

Copy link
Copy Markdown
Member

Adds an "Available in MCP" badge to OpenAPI operations, driven by the x-gitbook-mcp extension.

What

  • Operations with x-gitbook-mcp: true show an "Available in MCP" badge next to the title, alongside the existing Deprecated / stability badges.
  • When x-gitbook-mcp-url is set, the badge becomes a button that copies the MCP server URL to the clipboard (reusing the existing OpenAPICopyButton).
  • x-gitbook-mcp-url resolves with cascade precedence operation → path → root (mirroring getServers), so it can be set once at the spec root and overridden per path or operation.
  • The label is localized across all supported locales; the badge uses the mcp icon and an emerald theme consistent with the existing badge styles.

Extensions

Extension Level Purpose
x-gitbook-mcp: boolean operation Gates whether the badge is shown (per-endpoint).
x-gitbook-mcp-url: string operation / path / root Optional MCP server URL; turns the badge into a copy-to-clipboard button.

Demo

CleanShot 2026-06-29 at 21 52 04@2x CleanShot 2026-06-29 at 21 52 08@2x

Resolves RND-11615.

Render a badge on operations marked with x-gitbook-mcp: true. When x-gitbook-mcp-url is set (resolved operation > path > root), the badge becomes a button that copies the MCP server URL to the clipboard. The label is localized across all supported locales.
@linear-code

linear-code Bot commented Jun 29, 2026

Copy link
Copy Markdown
@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c4a157a

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

This PR includes changesets to release 3 packages
Name Type
@gitbook/openapi-parser Patch
@gitbook/react-openapi Patch
gitbook 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

@argos-ci

argos-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) 👍 Changes approved 2 changed, 1 ignored Jul 1, 2026, 3:26 PM
customers-v2-vercel (Inspect) 👍 Changes approved 1 changed Jul 1, 2026, 3:25 PM
v2-cloudflare (Inspect) 👍 Changes approved 2 changed, 2 ignored Jul 1, 2026, 3:33 PM
v2-vercel (Inspect) 👍 Changes approved 1 changed, 1 ignored Jul 1, 2026, 3:32 PM

@zenoachtig zenoachtig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some doubts about the placement and understandability of the badge, but let's not block it and iterate as we get feedback on it

Copy link
Copy Markdown
Contributor

On my side I don't understand why we don't expose everything. If this just for us or for other customers also?

Copy link
Copy Markdown
Member Author

I have some doubts about the placement and understandability of the badge

@zenoachtig Yeah I agree it's not perfect in terms of readability. I've put it in the same row as the other badges, but happy to move it if you have a better idea for this one (or all badges ?)

On my side I don't understand why we don't expose everything. If this just for us or for other customers also?

@gregberge wdym by "expose everything" ? This could be used by anyone who did OpenAPI -> MCP it's pretty specific but it's what we did, I'll document it in our docs

@nolannbiron nolannbiron merged commit 7e55cd5 into main Jul 1, 2026
17 checks passed
@nolannbiron nolannbiron deleted the nolann/rnd-11615-add-available-in-mcp-badge-for-x-gitbook-mcp-true branch July 1, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants