MCP Tools
Pre-built Model Context Protocol tools for Figma and n8n integrations
Overview
AgentSea includes built-in MCP tools for popular services, allowing your agents to interact with Figma designs and n8n workflows out of the box. These tools are production-ready with built-in retry logic, error handling, and comprehensive validation.
Figma Tools
Interact with Figma files, nodes, images, and comments programmatically
Available Tools:
- • Get file information & structure
- • Retrieve specific nodes by ID
- • Export images (PNG, SVG, PDF)
- • Read and post comments
- • Version control access
n8n Tools
Execute and manage n8n workflows for powerful automation
Available Tools:
- • Execute workflows with data
- • Monitor execution status
- • List available workflows
- • Trigger webhooks
- • Get workflow details
Figma Tools
The Figma tools allow agents to interact with Figma's design files, components, and collaboration features.
Setup
First, obtain a Figma access token:
- Go to your Figma account settings
- Navigate to "Personal Access Tokens"
- Generate a new token
- Set it as an environment variable:
export FIGMA_ACCESS_TOKEN="your_figma_token_here"Available Figma Tools
| Tool Name | Description | Key Parameters |
|---|---|---|
figma_get_file | Get file info and structure | fileKey, version?, depth? |
figma_get_nodes | Get specific nodes by ID | fileKey, nodeIds[] |
figma_get_images | Export images | fileKey, nodeIds[], format?, scale? |
figma_get_comments | Get all comments | fileKey |
figma_post_comment | Post a new comment | fileKey, message, clientMeta? |
Figma Usage Example
import {
Agent,
figmaGetFileTool,
figmaGetImagesTool,
figmaPostCommentTool,
} from '@lov3kaizen/agentsea-core';
const agent = new Agent({
name: 'figma-agent',
description: 'Agent with Figma integration',
model: 'claude-sonnet-4-20250514',
provider: 'anthropic',
tools: [
figmaGetFileTool,
figmaGetImagesTool,
figmaPostCommentTool,
],
});
// Agent can now interact with Figma
const response = await agent.execute(
'Get the Figma file "abc123" and export all frames as PNG images at 2x scale',
context,
);Figma Workflow Examples
Get latest designs, export screenshots, and post feedback comments automatically
Export design assets, optimize images, and update documentation
Monitor design changes, track versions, and notify team members
n8n Tools
The n8n tools allow agents to execute and manage automation workflows, making it easy to integrate complex business processes.
Setup
Configure your n8n connection:
export N8N_API_KEY="your_n8n_api_key"
export N8N_BASE_URL="https://your-n8n-instance.com"Available n8n Tools
| Tool Name | Description | Key Parameters |
|---|---|---|
n8n_execute_workflow | Run a workflow | workflowId, data?, waitForCompletion? |
n8n_get_execution | Check execution status | executionId |
n8n_list_workflows | List available workflows | active?, tags?[], limit? |
n8n_trigger_webhook | Trigger a webhook | webhookPath, method?, data? |
n8n_get_workflow | Get workflow details | workflowId |
n8n Usage Example
import {
Agent,
n8nExecuteWorkflowTool,
n8nListWorkflowsTool,
n8nTriggerWebhookTool,
} from '@lov3kaizen/agentsea-core';
const agent = new Agent({
name: 'automation-agent',
description: 'Agent with n8n workflow automation',
model: 'claude-sonnet-4-20250514',
provider: 'anthropic',
tools: [
n8nExecuteWorkflowTool,
n8nListWorkflowsTool,
n8nTriggerWebhookTool,
],
});
// Agent can now execute workflows
const response = await agent.execute(
'Execute the "Data Processing" workflow with this data: {"name": "John", "email": "john@example.com"}',
context,
);n8n Workflow Examples
Trigger workflows to process, transform, and store data automatically
Execute multi-step onboarding workflows with dynamic data
Trigger webhooks to send notifications across multiple channels
Combined Workflow Example
Use both Figma and n8n tools together to create powerful automation pipelines:
import {
Agent,
figmaGetFileTool,
figmaGetImagesTool,
figmaPostCommentTool,
n8nTriggerWebhookTool,
} from '@lov3kaizen/agentsea-core';
const agent = new Agent({
name: 'design-automation',
description: 'Automated design-to-production pipeline',
model: 'claude-sonnet-4-20250514',
provider: 'anthropic',
tools: [
figmaGetFileTool,
figmaGetImagesTool,
figmaPostCommentTool,
n8nTriggerWebhookTool,
],
});
// Multi-step automation
const response = await agent.execute(
`
1. Get the latest version of Figma file "design123"
2. Export the main frame as a high-res PNG
3. Trigger the n8n webhook at "webhook/process-design" with the image URL
4. Post a comment on the Figma file: "Design exported and sent for processing"
`,
context,
);Error Handling & Retries
All MCP tools include built-in error handling and retry logic:
- Max Attempts: 3 automatic retries
- Backoff Strategy: Exponential backoff
- Initial Delay: 1000ms
- Max Delay: 10000ms
// Tools automatically retry on failure
try {
const result = await agent.execute(
'Get Figma file and trigger n8n workflow',
context
);
} catch (error) {
// Error after all retries exhausted
console.error('Automation failed:', error.message);
}Best Practices
- Environment Variables: Always use environment variables for API keys in production
- Rate Limiting: Be mindful of API rate limits for both Figma and n8n
- Webhook Security: Secure your n8n webhooks with authentication
- Data Validation: Validate workflow input data before execution
- Error Monitoring: Log and monitor errors for debugging
- Caching: Cache Figma file data when possible to reduce API calls
- Testing: Test n8n workflows independently before integrating with agents
Common Use Cases
🎨 Design Review Automation
Automatically export designs, process them, and post feedback
📦 Asset Export Pipeline
Export design assets and trigger processing workflows
🔔 Design Change Notifications
Monitor Figma changes and notify stakeholders via n8n
🚀 Automated Deployment
Trigger deployment workflows based on design approvals
📊 Analytics & Reporting
Collect design metrics and generate reports automatically
🔄 Version Synchronization
Keep designs and documentation in sync across tools
API Documentation
For detailed API references, see: