Skip to content

feat: in app mcp instructions#7438

Draft
kyle-ssg wants to merge 8 commits into
mainfrom
feat/in-app-mcp-instructions
Draft

feat: in app mcp instructions#7438
kyle-ssg wants to merge 8 commits into
mainfrom
feat/in-app-mcp-instructions

Conversation

@kyle-ssg

@kyle-ssg kyle-ssg commented May 6, 2026

Copy link
Copy Markdown
Member

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

  • Tracks viewing an integration
  • Adds generic way to add an integration from anywhere
  • Adds in-app integration for mcp considering both SaaS and Self-Hosted
  • Aligned docs remote config for integration_data to production

Features page cta

image

Organisation page cta

image

Self-hosted example

image

How did you test this code?

Claude Code

SaaS

claude mcp add --transport http "flagsmith" \
    "https://app.getgram.ai/mcp/flagsmith-mcp"

Self-hosted

claude mcp add --transport http "flagsmith" \
    "https://app.getgram.ai/mcp/flagsmith-mcp" \
    --header 'Mcp-Flagsmith-Token-Auth:${MCP_FLAGSMITH_TOKEN_AUTH}' \
    --header 'Mcp-Flagsmith-Server-Url:https://flagsmith.example.com'

Claude Desktop (claude_desktop_config.json)

SaaS

{
  "mcpServers": {
    "flagsmith": {
      "command": "npx",
      "args": [
        "mcp-remote@0.1.25",
        "https://app.getgram.ai/mcp/flagsmith-mcp"
      ]
    }
  }
}

Self-hosted

{
  "mcpServers": {
    "flagsmith": {
      "command": "npx",
      "args": [
        "mcp-remote@0.1.25",
        "https://app.getgram.ai/mcp/flagsmith-mcp",
        "--header",
        "Mcp-Flagsmith-Token-Auth:${MCP_FLAGSMITH_TOKEN_AUTH}",
        "--header",
        "Mcp-Flagsmith-Server-Url:https://flagsmith.example.com"
      ],
      "env": {
        "MCP_FLAGSMITH_TOKEN_AUTH": "Api-Key YOUR_API_KEY_HERE"
      }
    }
  }
}

Codex CLI (~/.codex/config.toml)

SaaS

[mcp_servers.flagsmith]
url = "https://app.getgram.ai/mcp/flagsmith-mcp"

Self-hosted

[mcp_servers.flagsmith]
url = "https://app.getgram.ai/mcp/flagsmith-mcp"
http_headers = { "Mcp-Flagsmith-Server-Url" = "https://flagsmith.example.com" }
env_http_headers = { "Mcp-Flagsmith-Token-Auth" = "MCP_FLAGSMITH_TOKEN_AUTH" }

Cursor

Deep link

SaaS

cursor://anysphere.cursor-deeplink/mcp/install?config=eyJ1cmwiOiJodHRwczovL2FwcC5nZXRncmFtLmFpL21jcC9mbGFnc21pdGgtbWNwIn0=&name=flagsmith

config payload: {"url":"https://app.getgram.ai/mcp/flagsmith-mcp"}

Self-hosted

cursor://anysphere.cursor-deeplink/mcp/install?config=eyJ1cmwiOiJodHRwczovL2FwcC5nZXRncmFtLmFpL21jcC9mbGFnc21pdGgtbWNwIiwiaGVhZGVycyI6eyJNY3AtRmxhZ3NtaXRoLVNlcnZlci1VcmwiOi
JodHRwczovL2ZsYWdzbWl0aC5leGFtcGxlLmNvbSIsIk1jcC1GbGFnc21pdGgtVG9rZW4tQXV0aCI6Int7TUNQLUZMQUdTTUlUSC1UT0tFTi1BVVRIfX0ifX0=&name=flagsmith

config payload: {"url":"https://app.getgram.ai/mcp/flagsmith-mcp","headers":{"Mcp-Flagsmith-Server-Url":"https://flagsmith.example.com","Mcp-Flagsmith-Token-Auth":"{{MCP-F LAGSMITH-TOKEN-AUTH}}"}}

Manual config (~/.cursor/mcp.json)

SaaS

{
  "mcpServers": {
    "flagsmith": {
      "url": "https://app.getgram.ai/mcp/flagsmith-mcp"
    }
  }
}

Self-hosted

{
  "mcpServers": {
    "flagsmith": {
      "url": "https://app.getgram.ai/mcp/flagsmith-mcp",
      "headers": {
        "Mcp-Flagsmith-Token-Auth": "${MCP_FLAGSMITH_TOKEN_AUTH}",
        "Mcp-Flagsmith-Server-Url": "https://flagsmith.example.com"
      }
    }
  }
}

Gemini CLI

SaaS

gemini mcp add --transport http "flagsmith" "https://app.getgram.ai/mcp/flagsmith-mcp"

Self-hosted

gemini mcp add --transport http "flagsmith" "https://app.getgram.ai/mcp/flagsmith-mcp" \
  --header 'Mcp-Flagsmith-Token-Auth:${MCP_FLAGSMITH_TOKEN_AUTH}' \
  --header 'Mcp-Flagsmith-Server-Url:https://flagsmith.example.com'

VS Code

Deep link

SaaS

vscode:mcp/install?%7B%22name%22%3A%22flagsmith%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapp.getgram.ai%2Fmcp%2Fflagsmith-mcp%22%7D

config payload: {"name":"flagsmith","type":"http","url":"https://app.getgram.ai/mcp/flagsmith-mcp"}

Self-hosted

vscode:mcp/install?%7B%22name%22%3A%22flagsmith%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapp.getgram.ai%2Fmcp%2Fflagsmith-mcp%22%2C%22headers%22%3A%7B%22
Mcp-Flagsmith-Server-Url%22%3A%22https%3A%2F%2Fflagsmith.example.com%22%2C%22Mcp-Flagsmith-Token-Auth%22%3A%22Api-Key%20YOUR_API_KEY_HERE%22%7D%7D

config payload: {"name":"flagsmith","type":"http","url":"https://app.getgram.ai/mcp/flagsmith-mcp","headers":{"Mcp-Flagsmith-Server-Url":"https://flagsmith.example.com","M cp-Flagsmith-Token-Auth":"Api-Key YOUR_API_KEY_HERE"}}

CLI fallback

SaaS

code --add-mcp '{"name":"flagsmith","type":"http","url":"https://app.getgram.ai/mcp/flagsmith-mcp"}'

Self-hosted

code --add-mcp '{"name":"flagsmith","type":"http","url":"https://app.getgram.ai/mcp/flagsmith-mcp","headers":{"Mcp-Flagsmith-Token-Auth":"${MCP_FLAGSMITH_TOKEN_AUTH}","Mcp-
Flagsmith-Server-Url":"https://flagsmith.example.com"}}'

kyle-ssg and others added 5 commits May 6, 2026 12:22
…ix Cursor/Codex snippets

- Prefill Mcp-Flagsmith-Server-Url from Constants.getFlagsmithSDKUrl().origin
- Cursor manual config drops "type": "http" to match Cursor's documented schema
- Codex self-hosted uses env_http_headers for the auth token
- Add VIEW_INTEGRATION event (stable name + integration property) fired from openIntegrationModal and IntegrationList

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Match docs and Gram install page exactly: 'Header:value' not 'Header: value'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kyle-ssg kyle-ssg requested a review from a team as a code owner May 6, 2026 12:51
@kyle-ssg kyle-ssg requested review from talissoncosta and removed request for a team May 6, 2026 12:51

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@vercel

vercel Bot commented May 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 22, 2026 8:55am
flagsmith-frontend-preview Ready Ready Preview, Comment May 22, 2026 8:55am
flagsmith-frontend-staging Ready Ready Preview, Comment May 22, 2026 8:55am

Request Review

@github-actions github-actions Bot added front-end Issue related to the React Front End Dashboard feature New feature or request labels May 6, 2026
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

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

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

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

passed  11 passed

Details

stats  11 tests across 8 suites
duration  44.2 seconds
commit  6cf53e8
info  🔄 Run: #16549 (attempt 1)

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

passed  11 passed

Details

stats  11 tests across 8 suites
duration  11.2 seconds
commit  6cf53e8
info  🔄 Run: #16549 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  48.4 seconds
commit  6cf53e8
info  🔄 Run: #16549 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 17 seconds
commit  6cf53e8
info  🔄 Run: #16549 (attempt 1)

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

passed  11 passed

Details

stats  11 tests across 8 suites
duration  9.7 seconds
commit  dcd8d81
info  🔄 Run: #16550 (attempt 1)

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

passed  11 passed

Details

stats  11 tests across 8 suites
duration  26.9 seconds
commit  dcd8d81
info  🔄 Run: #16550 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  42.9 seconds
commit  dcd8d81
info  🔄 Run: #16550 (attempt 1)

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

passed  17 passed

Details

stats  17 tests across 14 suites
duration  1 minute, 21 seconds
commit  dcd8d81
info  🔄 Run: #16550 (attempt 1)

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

passed  11 passed

Details

stats  11 tests across 8 suites
duration  42.9 seconds
commit  a110f0c
info  🔄 Run: #16554 (attempt 1)

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

passed  17 passed

Details

stats  17 tests across 14 suites
duration  55 seconds
commit  a110f0c
info  🔄 Run: #16554 (attempt 1)

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

passed  11 passed

Details

stats  11 tests across 8 suites
duration  33.1 seconds
commit  a110f0c
info  🔄 Run: #16554 (attempt 1)

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

passed  17 passed

Details

stats  17 tests across 14 suites
duration  1 minute, 30 seconds
commit  a110f0c
info  🔄 Run: #16554 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41 seconds
commit  0e12415
info  🔄 Run: #16904 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  35 seconds
commit  0e12415
info  🔄 Run: #16904 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  55.9 seconds
commit  0e12415
info  🔄 Run: #16904 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  42.8 seconds
commit  0e12415
info  🔄 Run: #16904 (attempt 1)

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

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

# Conflicts:
#	frontend/web/components/base/forms/Button.tsx
@github-actions github-actions Bot added the feature New feature or request label May 22, 2026
@kyle-ssg kyle-ssg requested a review from Zaimwa9 May 22, 2026 16:05

@Zaimwa9 Zaimwa9 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.

Mostly nits but requesting changes because of the URL stripping that could return a wrong url for self hosted.

Otherwise, the whole documentation is about to change but I'd lean towards going forward with this one and update as soon as we have released the new mcp

</Highlight>
<div className='flex-column hljs-docs'>
<Button
onClick={() => navigator.clipboard.writeText(code)}

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.

We could add just a notification on copy success

<div className='flex-row'>
<div
className='flex flex-1'
style={isMobile ? { overflowX: 'scroll' } : {}}

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.

We lost this one in the process, is it intentional?


const getSelfHostedServerUrl = () => {
try {
return new URL(Constants.getFlagsmithSDKUrl()).origin

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.

For context, the mcp will live in https://flagsmith.com/flagsmith/api/v1/ so if the self-hosted keeps the same pattern they might have the wrong base url, without the api/v1 or any other subpath.

Comment on lines +46 to +55
const claudeCodeSnippet = (selfHosted: boolean, serverUrl: string) =>
selfHosted
? `claude mcp add --transport http "flagsmith" \\
"${MCP_URL}" \\
--header 'Mcp-Flagsmith-Token-Auth:\${MCP_FLAGSMITH_TOKEN_AUTH}' \\
--header 'Mcp-Flagsmith-Server-Url:${serverUrl}'`
: `claude mcp add --transport http "flagsmith" \\
"${MCP_URL}"`

const cursorJsonConfig = (selfHosted: boolean, serverUrl: string) => {

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.

Leaving this to you to decide but we could extract the snippet builders in their own component so it's properly isolated and easy to find.

Overall this component could be broken up a bit I believe

@kyle-ssg kyle-ssg marked this pull request as draft June 10, 2026 09:41
@kyle-ssg

Copy link
Copy Markdown
Member Author

Drafting considering this is pending

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

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants