Thank you for your interest in contributing to Figma Flutter MCP! This guide will help you get started with development and testing.
- Node.js 18+
- npm or yarn
- Figma API Key (for testing)
- Git
-
Fork and Clone
git clone https://github.com/your-username/figma-flutter-mcp.git cd figma-flutter-mcp npm install -
Create .env file
# Create .env file with your Figma API key echo "FIGMA_API_KEY=your-figma-api-key-here" > .env
-
Start Development Server
npm run dev
- Use TypeScript for all new code
- Follow existing code patterns and conventions
- Use meaningful variable and function names
- Add docs in
docs/if you think its neccessary
src/
├── cli.mts # CLI entry point
├── server.mts # MCP server implementation
├── config.mts # Configuration handling
├── extractors/ # Figma data extractors
│ ├── colors/
│ ├── components/
│ ├── screens/
│ └── typography/
├── tools/ # Flutter code generators
├── services/ # External service integrations
├── types/ # TypeScript type definitions
└── utils/ # Utility functions
-
Create a Branch
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-description -
Make Your Changes
- Write clean, documented code
- Add tests for new features
- Update documentation as needed
-
Test Your Changes
# Build and check for errors npm run build # Test locally npm run dev
-
Commit and Push
git add . git commit -m "feat: add new feature description" git push origin feature/your-feature-name
-
Create Pull Request
- Use descriptive titles and descriptions
- Reference any related issues
- Include screenshots/examples if applicable
The project supports HTTP server mode for easier development and testing. This allows you to test MCP tools without setting up a full MCP client.
If you haven't already set up your Figma API key:
# Create .env file
echo "FIGMA_API_KEY=your-figma-api-key-here" > .envGet your Figma API Key:
- Go to Figma Settings > Personal Access Tokens
- Generate a new personal access token
- Copy the token and add it to your
.envfile
.env file to version control. It's already included in .gitignore.
# Start HTTP server on default port 3333
npm run dev
# Start HTTP server on a specific port
npm run dev:port 4000
# Start in stdio mode (for MCP clients)
npm run dev:stdio# Start HTTP server
npx tsx src/cli.mts --http
# Start HTTP server on specific port
npx tsx src/cli.mts --http --port 4000
# Start in stdio mode
npx tsx src/cli.mts --stdio# Build first
npm run build
# Start HTTP server
node dist/cli.mjs --http
# Start HTTP server on specific port
node dist/cli.mjs --http --port 4000To connect an MCP client to the local HTTP server, add this configuration to your MCP JSON config file:
{
"mcpServers": {
"local-figma-flutter-mcp": {
"url": "http://localhost:3333/mcp"
}
}
}When the HTTP server is running, the following endpoints are available:
- POST /mcp - Main Streamable HTTP endpoint for MCP communication
- GET /mcp - Session management for StreamableHTTP
- DELETE /mcp - Session termination for StreamableHTTP
- GET /sse - Server-Sent Events endpoint (alternative transport)
- POST /messages - Message endpoint for SSE transport
You can configure the server using environment variables. The recommended approach is to use a .env file:
# Required: Your Figma API key
FIGMA_API_KEY=your-figma-api-key-here
# Optional: Enable HTTP mode by default
HTTP_MODE=true
# Optional: Set default HTTP port
HTTP_PORT=3333Before submitting a PR:
- Code builds without errors (
npm run build) - Tests pass (if applicable)
- Documentation updated
- PR description explains changes
- Related issues referenced
- Follows existing code style
Thank you for contributing to Figma Flutter MCP! 🚀