-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Problem
Currently, the Figma-Context-MCP server requires the API key to be configured at server startup time via:
- CLI argument:
--figma-api-key=YOUR-KEY - Environment variable:
FIGMA_API_KEY
This approach works well for single-user scenarios, but presents challenges for multi-tenant or multi-user environments where:
- Different users need different API keys - In a system where multiple users run AI coding agents on the same machine/server, each user should use their own Figma API key
- Security concerns - A global environment variable means all users share the same token, which is a security vulnerability
- Dynamic key provisioning - In orchestration systems, different AI sessions may need to use different credentials based on the task context
Proposed Solution
Add an optional figma_api_key parameter to the tool input schemas, allowing the API key to be passed per-tool-call. This would override any server-level configuration for that specific call.
Example:
{
"name": "get_figma_data",
"arguments": {
"fileKey": "abc123xyz",
"nodeId": "1:2",
"figma_api_key": "figd_abc123..."
}
}Benefits
- Multi-user support - Each user can provide their own Figma API key when making requests
- Dynamic credential management - Orchestration systems can inject user-specific tokens at call time
- Backward compatibility - Server-level configuration still works as fallback when per-call key is not provided
- Security - No need to share credentials across different user sessions
Use Case
We're building a system (https://github.com/link-assistant/hive-mind) where AI agents handle requests from multiple users on the same machine. Each user should be able to use their own Figma API key without exposing it to other users' sessions.
Alternatives Considered
- Running separate MCP server instances per user - Too resource-intensive and complex to manage
- Fork and modify - Creates maintenance burden and diverges from upstream
Thank you for considering this enhancement! Happy to discuss further or contribute a PR if this direction is acceptable.