MCP Configuration

Configure MCP servers and tools for your workflows.

Basic Configuration

Add MCP servers to your global configuration:

1import { relay } from '@relayplane/sdk'
2
3relay.configure({
4 providers: {
5 openai: { apiKey: process.env.OPENAI_API_KEY! }
6 },
7 mcp: {
8 servers: {
9 // Server name : Server config
10 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 URL
6 url: 'https://mcp.example.com',
7
8 // Optional: Authentication credentials
9 credentials: {
10 apiKey: process.env.MY_SERVER_API_KEY,
11 // or other auth methods
12 },
13
14 // Optional: Enable/disable server
15 enabled: true
16 }
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_URL
9 }
10 },
11 github: {
12 url: 'https://mcp.github.com',
13 credentials: {
14 token: process.env.GITHUB_TOKEN
15 }
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})
11
12// Use multiple servers in one workflow
13const workflow = relay
14 .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 } // Disabled
6 }
7 }
8})

Type Safety

MCP configuration is fully typed. TypeScript will catch configuration errors:

1import { relay, MCPServerConfig } from '@relayplane/sdk'
2
3const mcpConfig: Record = {
4 crm: {
5 url: 'https://mcp.salesforce.com',
6 credentials: { apiKey: process.env.SALESFORCE_API_KEY! }
7 }
8}
9
10relay.configure({
11 mcp: { servers: mcpConfig }
12})

Next Steps