MCP Integration
Connect FlowMason to AI assistants via Model Context Protocol for AI-native pipeline management.
Beta Feature - This feature is currently under heavy testing. For early access, contact [email protected].
FlowMason includes a Model Context Protocol (MCP) server that enables AI assistants like Claude to directly interact with your pipelines.
Overview
The MCP integration provides:
- Pipeline Management - Create, read, update, delete pipelines via AI
- Execution Control - Run pipelines and get results
- Component Discovery - Browse available components
- Natural Language - Describe what you want, AI builds it
- IDE Integration - Works with Claude Desktop, VSCode, and more
Quick Start
Start the MCP Server
fm mcp start
Or run as part of Studio:
fm studio start --mcp
Configure Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"flowmason": {
"command": "fm",
"args": ["mcp", "stdio"],
"env": {
"FLOWMASON_API_KEY": "your-api-key"
}
}
}
}
Available Tools
The MCP server exposes these tools to AI assistants:
Pipeline Operations
| Tool | Description |
|---|---|
list_pipelines | List all pipelines with optional filters |
get_pipeline | Get pipeline details by ID or name |
create_pipeline | Create a new pipeline |
update_pipeline | Update an existing pipeline |
delete_pipeline | Delete a pipeline |
validate_pipeline | Validate pipeline structure |
Execution
| Tool | Description |
|---|---|
run_pipeline | Execute a pipeline with input |
get_run_status | Check execution status |
get_run_result | Get execution result |
cancel_run | Cancel running execution |
list_runs | List recent executions |
Components
| Tool | Description |
|---|---|
list_components | List available components |
get_component | Get component details |
search_components | Search by capability |
Generation
| Tool | Description |
|---|---|
generate_pipeline | Generate from natural language |
suggest_components | Suggest components for a task |
Example Interactions
Create a Pipeline via AI
User: “Create a pipeline that summarizes articles and translates to Spanish”
Claude uses tools:
generate_pipeline- Creates pipeline structurecreate_pipeline- Saves to FlowMasonvalidate_pipeline- Verifies it’s valid
Result: Working pipeline created and ready to run.
Run a Pipeline
User: “Run the content-summarizer pipeline with this article: [text]”
Claude uses tools:
get_pipeline- Finds the pipelinerun_pipeline- Executes with inputget_run_result- Returns output
Browse Components
User: “What components can I use for data filtering?”
Claude uses tools:
search_components- Finds relevant components- Returns: filter, json_transform, conditional, router
Tool Schemas
list_pipelines
{
"name": "list_pipelines",
"description": "List all pipelines with optional filters",
"inputSchema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": ["draft", "published", "archived"]
},
"category": { "type": "string" },
"limit": { "type": "integer", "default": 20 }
}
}
}
run_pipeline
{
"name": "run_pipeline",
"description": "Execute a pipeline with input data",
"inputSchema": {
"type": "object",
"properties": {
"pipeline_id": { "type": "string" },
"input": { "type": "object" },
"async": { "type": "boolean", "default": false }
},
"required": ["pipeline_id", "input"]
}
}
generate_pipeline
{
"name": "generate_pipeline",
"description": "Generate a pipeline from natural language",
"inputSchema": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Natural language description"
},
"save": {
"type": "boolean",
"default": false
}
},
"required": ["description"]
}
}
Resources
The MCP server also exposes resources:
Pipeline Resources
flowmason://pipelines
flowmason://pipelines/{id}
flowmason://pipelines/{id}/stages
flowmason://pipelines/{id}/runs
Component Resources
flowmason://components
flowmason://components/{type}
flowmason://components/categories
Documentation Resources
flowmason://docs/getting-started
flowmason://docs/components/{type}
flowmason://docs/best-practices
VSCode Integration
The FlowMason VSCode extension includes MCP support:
- Command Palette -
FlowMason: Ask AI Assistant - Context Menu - Right-click pipeline for AI suggestions
- Inline Assist - AI-powered stage configuration
- Chat Panel - Conversational pipeline building
Enable in VSCode
{
"flowmason.mcp.enabled": true,
"flowmason.mcp.provider": "claude"
}
Security
API Key Scopes
MCP operations respect API key scopes:
| Scope | Allowed Operations |
|---|---|
pipelines:read | List, get pipelines |
pipelines:write | Create, update, delete |
pipelines:execute | Run pipelines |
components:read | Browse components |
Audit Logging
All MCP operations are logged:
{
"timestamp": "2024-01-15T10:30:00Z",
"tool": "run_pipeline",
"user": "mcp_client",
"pipeline_id": "content-summarizer",
"status": "success"
}
Python Client
Use the MCP client programmatically:
from flowmason_core.mcp.client import FlowMasonMCPClient
client = FlowMasonMCPClient(
server_url="http://localhost:8999/mcp",
api_key="your-api-key"
)
# List pipelines
pipelines = await client.call_tool("list_pipelines", {
"status": "published"
})
# Run a pipeline
result = await client.call_tool("run_pipeline", {
"pipeline_id": "content-summarizer",
"input": {"text": "Article content here..."}
})
# Generate from description
generated = await client.call_tool("generate_pipeline", {
"description": "Filter products by price and sort by rating",
"save": True
})
Configuration
Server Options
fm mcp start \
--port 8998 \
--host 0.0.0.0 \
--api-key-required \
--log-level debug
Environment Variables
| Variable | Description |
|---|---|
FLOWMASON_MCP_PORT | Server port (default: 8998) |
FLOWMASON_MCP_HOST | Server host (default: localhost) |
FLOWMASON_API_KEY | Required API key |
FLOWMASON_MCP_LOG_LEVEL | Logging level |
Best Practices
- Use descriptive names - Help AI understand your pipelines
- Add descriptions - Document what each stage does
- Validate before run - Use validate_pipeline first
- Review generated pipelines - AI suggestions may need refinement
- Use scoped API keys - Limit MCP client permissions