MCP Configuration
Configure MCP servers and tools for your workflows.
Basic Configuration
Add MCP servers to your global configuration:
1import { relay } from '@relayplane/sdk'23relay.configure({4 providers: {5 openai: { apiKey: process.env.OPENAI_API_KEY! }6 },7 mcp: {8 servers: {9 // Server name : Server config10 crm: { url: 'https://mcp.salesforce.com' },11 github: { url: 'https://mcp.github.com' },12 slack: { url: 'https://mcp.slack.com' }13 }14 }15})Server Options
Each MCP server supports the following configuration options:
1{2 mcp: {3 servers: {4 myServer: {5 // Required: Server URL6 url: 'https://mcp.example.com',78 // Optional: Authentication credentials9 credentials: {10 apiKey: process.env.MY_SERVER_API_KEY,11 // or other auth methods12 },1314 // Optional: Enable/disable server15 enabled: true16 }17 }18 }19}Authentication
Pass credentials to MCP servers that require authentication:
1relay.configure({2 mcp: {3 servers: {4 salesforce: {5 url: 'https://mcp.salesforce.com',6 credentials: {7 apiKey: process.env.SALESFORCE_API_KEY,8 instanceUrl: process.env.SALESFORCE_INSTANCE_URL9 }10 },11 github: {12 url: 'https://mcp.github.com',13 credentials: {14 token: process.env.GITHUB_TOKEN15 }16 }17 }18 }19})Never hardcode credentials in your source code. Always use environment variables.
Multiple Servers
You can configure multiple MCP servers and use them in the same workflow:
1relay.configure({2 mcp: {3 servers: {4 crm: { url: 'https://mcp.salesforce.com' },5 github: { url: 'https://mcp.github.com' },6 slack: { url: 'https://mcp.slack.com' },7 jira: { url: 'https://mcp.atlassian.com/jira' }8 }9 }10})1112// Use multiple servers in one workflow13const workflow = relay14 .workflow('issue-triage')15 .step('lookupCustomer')16 .mcp('crm:getCustomer')17 .params({ email: '{{input.email}}' })18 .step('createIssue')19 .mcp('jira:createIssue')20 .params({ summary: '{{input.summary}}', customerId: '{{lookupCustomer.id}}' })21 .depends('lookupCustomer')22 .step('notifyTeam')23 .mcp('slack:sendMessage')24 .params({ channel: '#support', message: 'New issue: {{createIssue.key}}' })25 .depends('createIssue')Disabling Servers
Temporarily disable servers without removing their configuration:
1relay.configure({2 mcp: {3 servers: {4 crm: { url: 'https://mcp.salesforce.com', enabled: true },5 github: { url: 'https://mcp.github.com', enabled: false } // Disabled6 }7 }8})Type Safety
MCP configuration is fully typed. TypeScript will catch configuration errors:
1import { relay, MCPServerConfig } from '@relayplane/sdk'23const mcpConfig: Record = { 4 crm: {5 url: 'https://mcp.salesforce.com',6 credentials: { apiKey: process.env.SALESFORCE_API_KEY! }7 }8}910relay.configure({11 mcp: { servers: mcpConfig }12})Next Steps
- Examples - Real-world MCP workflow examples
- MCP Overview - How MCP works in RelayPlane