MCP Integration Guide
Connect any API to your CFFBRW workflows using the Model Context Protocol (MCP).
What is MCP?
The Model Context Protocol (MCP) is an open protocol that lets AI applications connect to external tools and data sources. Instead of writing custom integration code for every API, you register an MCP server and CFFBRW discovers its tools automatically.
Think of MCP servers as universal adapters. One server, any workflow.
Why MCP + CFFBRW?
| Traditional Integration | MCP + CFFBRW |
|---|---|
| Write custom code per API | Register an MCP server once |
| Update code when API changes | Update the MCP server only |
| Tied to one platform | Works with any MCP-compatible tool |
| Integration code in your workflow | Clean markdown step references |
Quick Start: Connect Your First MCP Server
1. Find or deploy an MCP server
You can:
- Use an existing community MCP server (browse the MCP ecosystem)
- Deploy your own using the MCP SDK (Python, TypeScript, or any language)
Popular community servers:
- Slack — send messages, read channels
- GitHub — manage repos, PRs, issues
- Google Drive — read/write files
- PostgreSQL — run queries
2. Register the MCP server
From your dashboard:
- Go to Settings → MCP Servers
- Click Add Server
- Enter:
- Name: A friendly name (e.g., "My Slack Server")
- URL: The server's HTTP endpoint
- Headers: Any auth headers (e.g.,
Authorization: Bearer xoxb-...)
- Click Save
CFFBRW will immediately discover all tools exposed by the server.
3. Use MCP tools in your workflow
Reference MCP tools directly in your markdown steps:
### 5. Post to Slack
Use the "send_message" tool from the Slack MCP server to post the summary
from step 4 to the #daily-standup channel.
The AI compiler automatically:
- Discovers the MCP server's tool catalog
- Maps your prose description to the correct tool
- Generates the tool call with the right parameters
- Pipes the output to subsequent steps
4. Compile and run
Compile your workflow. The execution plan will include mcp_call step types with resolved tool references.
Building Your Own MCP Server
TypeScript Example
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import express from "express";
const server = new McpServer({
name: "my-custom-server",
version: "1.0.0",
});
// Define a tool
server.tool(
"search_database",
"Search the database for records matching the query",
{
query: z.string().describe("The search query"),
limit: z.number().optional().describe("Max results (default: 10)"),
},
async ({ query, limit = 10 }) => {
const results = await db.search(query, limit);
return {
content: [{ type: "text", text: JSON.stringify(results) }],
};
},
);
// Start the HTTP server
const app = express();
app.post("/mcp", async (req, res) => {
const transport = new StreamableHTTPServerTransport({
sessionIdGenerator: undefined,
});
await server.connect(transport);
});
app.listen(3000);
Python Example
from mcp.server.fastmcp import FastMCP
import httpx
mcp = FastMCP("weather-server")
@mcp.tool()
async def get_weather(city: str) -> str:
"""Get current weather for a city."""
async with httpx.AsyncClient() as client:
resp = await client.get(
f"https://api.weather.com/{city}"
)
return resp.json()["description"]
if __name__ == "__main__":
mcp.run(transport="streamable-http")
Where to Deploy
Your MCP server must be publicly reachable. Some options:
- Cloudflare Workers — deploy as a serverless Worker
- Fly.io / Railway / Render — any container host
- Your own server — as long as it's publicly accessible
How Tool Discovery Works
When you register an MCP server, CFFBRW:
- Connects to the server's endpoint
- Calls
tools/listto discover all available tools - Caches the tool catalog (name, description, parameters)
- Makes tools available to the AI compiler
The compiler matches your markdown descriptions to tool names using semantic similarity.
Security
Authentication
Always pass auth headers when registering MCP servers. CFFBRW stores headers securely and sends them with every tool call.
SSRF Protection
CFFBRW blocks MCP calls to:
- Private IP ranges (10.x, 172.16.x, 192.168.x)
- Cloud metadata endpoints
- Localhost addresses
Tool Permissions
By default, all discovered tools are available to all workflows. To restrict:
- Go to Settings → MCP Servers → [your server] → Permissions
- Select which workflows can use this server
- Optionally restrict specific tools
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| "No MCP tools found" | Server URL unreachable | Check the URL and server status |
| "Tool not found" | Tool name mismatch | Be more specific in your step description |
| "Authentication failed" | Wrong/missing auth headers | Re-register the server with correct credentials |
| "SSRF blocked" | Private IP access | MCP servers must be publicly accessible |