Skip to content

docs(MCP): Rewrite MCP server page and generate the tool catalogue#7668

Open
khvn26 wants to merge 1 commit into
mainfrom
docs/rewrite-mcp-server
Open

docs(MCP): Rewrite MCP server page and generate the tool catalogue#7668
khvn26 wants to merge 1 commit into
mainfrom
docs/rewrite-mcp-server

Conversation

@khvn26
Copy link
Copy Markdown
Member

@khvn26 khvn26 commented Jun 1, 2026

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to Flagsmith/flagsmith-private#144.

Preview: https://docs-git-docs-rewrite-mcp-server-flagsmith.vercel.app/integrating-with-flagsmith/mcp-server

Rewrites the user-facing MCP server page for the self-built server, replacing the Gram-hosted page:

  • Cloud (https://mcp.flagsmith.com) and self-hosted (https://<your-flagsmith-host>/mcp/) URLs.
  • OAuth (auto-discovered from the MCP URL) and Authorization: Api-Key authentication.
  • Per-client install tabs: Claude Code, Cursor, Claude Desktop, Codex CLI, Windsurf, Gemini CLI, VS Code, and a generic fallback.
  • Gram deprecation / migration callout and example prompts.

Generates the tool catalogue from the OpenAPI schema instead of hand-maintaining it, so the descriptions stay in sync with the tools:

  • manage.py generate_mcp_tool_catalogue renders an aligned Markdown table of the MCP-tagged operations (verbatim operationId + description). --exclude omits tools already present in another catalogue.
  • make generate-docs writes the core catalogue (_mcp-tool-catalogue.md, gated by the existing diff-check). api-tests-with-private-packages derives the enterprise-only catalogue (_mcp-tool-catalogue-enterprise.md) from it (the enterprise tools only exist with private packages installed). The page composes both via MDX imports — hence the .md.mdx rename.

Note: the page documents URLs/clients ahead of the server going live (doc-led). The install snippets and the Gram deprecation date (currently 30 June 2026) should be confirmed against the live server before/at release.

How did you test this code?

  • make -C api generate-docs reproduces _mcp-tool-catalogue.md (36 core tools) byte-identically; make -C api typecheck and ruff pass; docs Prettier passes on the rewritten page and both partials.
  • Generated the enterprise catalogue with flagsmith-private installed (--exclude the core one) → the 7 enterprise tools; verified both partials are Prettier-stable.
  • Added unit tests for the management command (tests/unit/api/test_generate_mcp_tool_catalogue.py): default rendering, --exclude, and pipe-escaping — all pass.

@khvn26 khvn26 requested review from a team as code owners June 1, 2026 16:24
@khvn26 khvn26 requested review from matthewelwell and removed request for a team June 1, 2026 16:24
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 1, 2026 7:16pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ignored Ignored Preview Jun 1, 2026 7:16pm
flagsmith-frontend-staging Ignored Ignored Preview Jun 1, 2026 7:16pm

Request Review

@github-actions github-actions Bot added api Issue related to the REST API docs Documentation updates labels Jun 1, 2026
@khvn26
Copy link
Copy Markdown
Member Author

khvn26 commented Jun 1, 2026

Vercel preview of the rewritten page: https://docs-qxrxqbi67-flagsmith.vercel.app/integrating-with-flagsmith/mcp-server

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7668 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7668 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7668 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7668 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7668 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7668 Finished ✅ Results

@github-actions github-actions Bot added docs Documentation updates and removed docs Documentation updates labels Jun 1, 2026
Rewrite the user-facing MCP server page for the self-built server, replacing the
Gram-hosted page:

- Cloud (`https://mcp.flagsmith.com`) and self-hosted (`https://<host>/mcp/`) URLs
- OAuth (auto-discovered) and `Authorization: Api-Key` authentication
- Per-client install tabs: Claude Code, Cursor, Claude Desktop, Codex CLI,
  Windsurf, Gemini CLI, VS Code, and a generic fallback
- Gram deprecation / migration callout, example prompts

Generate the tool catalogue from the OpenAPI schema rather than hand-maintaining
it, so descriptions stay in sync with the tools:

- `manage.py generate_mcp_tool_catalogue` renders an aligned Markdown table of the
  MCP-tagged operations (verbatim `operationId` + `description`); `--exclude`
  omits tools already listed in another catalogue.
- `make generate-docs` writes the core catalogue (`_mcp-tool-catalogue.md`);
  `api-tests-with-private-packages` derives the enterprise-only catalogue
  (`_mcp-tool-catalogue-enterprise.md`) against it. The page composes both via MDX
  imports (hence the `.md` -> `.mdx` rename).

Contributes to Flagsmith/flagsmith-private#144.

beep boop
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.53%. Comparing base (1ee9b7b) to head (6295a4b).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7668   +/-   ##
=======================================
  Coverage   98.52%   98.53%           
=======================================
  Files        1444     1446    +2     
  Lines       55083    55142   +59     
=======================================
+ Hits        54273    54332   +59     
  Misses        810      810           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.6 seconds
commit  5fb9cdd
info  🔄 Run: #17155 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.7 seconds
commit  5fb9cdd
info  🔄 Run: #17155 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  42 seconds
commit  5fb9cdd
info  🔄 Run: #17155 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33.1 seconds
commit  5fb9cdd
info  🔄 Run: #17155 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  45.3 seconds
commit  6295a4b
info  🔄 Run: #17157 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.7 seconds
commit  6295a4b
info  🔄 Run: #17157 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  43.1 seconds
commit  6295a4b
info  🔄 Run: #17157 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.8 seconds
commit  6295a4b
info  🔄 Run: #17157 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Visual Regression

19 screenshots compared. See report for details.
View full report

@khvn26 khvn26 force-pushed the docs/rewrite-mcp-server branch from 5fb9cdd to 6295a4b Compare June 1, 2026 19:15
@github-actions github-actions Bot added docs Documentation updates and removed docs Documentation updates labels Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API docs Documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants