Repository navigation
Figma signs in with the team's own Figma app - #518
Merged
Merged
Conversation
…ken in place of a key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A team can now use its own Figma OAuth app. Figma's MCP server only takes OAuth clients Figma approved: dynamic registration returns 403, and the
mcp:connectscope is refused to every other app. Figma's REST API takes tokens from any OAuth app, though, and a private Figma app needs no review for people in the team or organization that owns it. The catalog package (figma-developer-mcp) readsFIGMA_OAUTH_TOKENand sends it as a bearer token. So the team pastes its app's client id and secret, an admin signs in once, and the package gets that token in place of a personal access token. The token is renewed before it expires. The key path stays as a fallback.Changes
mcp_catalog::own_appdescribes the own-app sign-in for a catalog server. Figma's entry has authorizehttps://www.figma.com/oauth, tokenhttps://api.figma.com/v1/oauth/token, refreshhttps://api.figma.com/v1/oauth/refresh, scopescurrent_user:readandfile_content:read, and env varFIGMA_OAUTH_TOKEN. The scopes are exactly what the package and the connection check call, and a test pins them.mcp_remote::own_appmodule. The sign-in is a normalServerRecord(app-figma,catalog_idapp:figma) with a manual client and the secret sealed with KMS, plus PKCE, a one-time state and sealed tokens. The record has no tools and is never listed or used as an MCP server (store::is_token_only). Saving a different client id ends the old sign-in. Saving the same client id with a blank secret keeps the saved secret.token_envreturns a fresh token for the package, andcheckcallsGET /v1/meafter sign-in so the card shows a token Figma refuses.OAuthSettings.refresh_endpointcovers providers that refresh at a separate address. Figma sends the client in a Basic header and doesn't rotate the refresh token, so the old refresh token is kept.PUT /api/mcp-servers/apps/:catalog_id(admin, in the permissions table). Connect, disconnect and remove reuse/api/mcp-servers/app-figma/....own_app.plugins::package_env).load_team_pluginsadds the catalog servers signed in with an own app, or marks the existing key plugin, andbuild_env_varspasses the token instead of the key.Verification
cargo fmt --all --check: clean.cargo clippy -p common -p gateway -p worker --all-targets -- -D warnings: clean.cargo test -p common: 1563 passed, plusno_hosted_urls2 passed.cargo test -p gateway: 758 passed.cargo test -p worker: 1408 passed./v1/oauth/refreshthat keeps the old refresh token./v1/mecheck marking a refused token.figma-developer-mcp0.13.2 directly: withFIGMA_OAUTH_TOKENset it sendsAuthorization: Bearer, and it calls/v1/files,/v1/files/:key/nodes,/v1/imagesand/v1/files/:key/images, all of which needfile_content:read.