MCP Integration
Model Context Protocol server for AI agents.
What MCP Enables
AI agents (Claude, GPT, custom) can:
- Create pipelines from natural language
- Query pipeline state and metrics
- Diagnose issues
- Suggest optimizations
Start the Server
fungi mcp serve
CLI Tools
fungi mcp tools # list available tools
fungi mcp call <tool> --args '{...}' # invoke a tool
Available Tools
| Tool | Purpose |
|---|---|
create-pipeline | Build a pipeline from a description |
query-state | Get pipeline metrics / state |
optimize | Suggest pipeline improvements |
debug | Diagnose pipeline issues |
deploy | Deploy to a cluster |
Configuration
# fungi.toml
[mcp]
enabled = true
host = "0.0.0.0"
port = 3000
[mcp.skills]
enabled = ["create-pipeline", "query-state", "optimize", "debug", "deploy"]
Connect Claude
fungi mcp install --agent claude
This registers Fungi as an MCP server in Claude's config.
Custom Agent (Python)
import fungi_mcp
client = fungi_mcp.Client("http://localhost:3000")
pipeline = client.create_pipeline(
source="kafka://events",
filter="amount > 100",
aggregate="GROUP BY user_id, SUM(amount)",
sink="kafka://processed-events",
)
state = client.query_state(pipeline.id)
print(state.throughput)
Example Conversation
User: Filter purchases over $100 from Kafka and aggregate by user.
Agent → create-pipeline → returns pipeline-abc123
→ query-state → throughput, errors, lag
Related
- Operations / CLI —
fungi mcpcommands ~/.pi/agent/skills/fungi/SKILL.md— Pi agent skill bundled with this repo