MCP Overview
Call external tools as workflow steps with Model Context Protocol (MCP).
What is MCP?
Model Context Protocol (MCP) is an open standard for connecting AI systems with external tools and data sources. RelayPlane integrates MCP support, allowing you to call external APIs, databases, CRMs, and other services directly within your AI workflows.
With MCP, you can:
- •Call external tools as workflow steps alongside AI steps
- •Connect to CRMs, databases, GitHub, Slack, and more
- •Mix AI reasoning with external API calls in a single DAG
- •Use any MCP-compatible server
How It Works
MCP steps work just like AI steps in your workflow, but instead of calling an LLM, they call an external MCP server to execute a tool. The result is then available to subsequent steps.
1import { relay } from '@relayplane/sdk'23// Configure MCP server4relay.configure({5 providers: { openai: { apiKey: process.env.OPENAI_API_KEY! } },6 mcp: {7 servers: {8 crm: { url: 'https://mcp.salesforce.com' }9 }10 }11})1213// Use MCP in workflow14const result = await relay15 .workflow('lead-enrichment')16 .step('extract')17 .with('openai:gpt-4o')18 .prompt('Extract company name from: {{input.email}}')19 .step('lookup')20 .mcp('crm:searchCompany')21 .params({ name: '{{extract.output}}' })22 .depends('extract')23 .step('summarize')24 .with('openai:gpt-4o')25 .depends('lookup')26 .prompt('Summarize this company: {{lookup.output}}')27 .run({ email: 'john@acme.com' })Key Concepts
MCP Servers
An MCP server exposes tools that can be called via HTTP. Each server has a manifest describing available tools and their parameters. RelayPlane loads this manifest and validates tool calls at runtime.
Tool Format
MCP tools are referenced in server:tool format, similar to how AI models use provider:model format.
1// Format: server:tool2.mcp('crm:searchCompany')3.mcp('github:createIssue')4.mcp('slack:sendMessage')Parameter Interpolation
MCP parameters support the same template syntax as AI prompts. Reference previous step outputs with {{stepName.output}}.
1.mcp('github:createIssue')2.params({3 title: '{{analyze.title}}',4 body: '{{analyze.description}}',5 labels: ['bug', 'automated']6})MCP vs AI Steps
| Feature | AI Steps | MCP Steps |
|---|---|---|
| Purpose | LLM inference | External tool calls |
| Syntax | .with('provider:model') | .mcp('server:tool') |
| Output | Generated text/JSON | Tool response |
| Dependencies | .depends() | .depends() |
Next Steps
- MCP Quickstart - Run your first MCP workflow
- Configuration - Configure MCP servers
- Examples - CRM enrichment, GitHub automation