Skip to main content

MCP Message

Sends messages using Claude AI with Model Context Protocol (MCP) integration, enabling Claude to access remote tools and resources through MCP servers.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The Claude client session identifier from Connect node (optional if API Key is provided directly).
  • Prompt - Your question or request for the MCP-enabled Claude. Claude can use MCP servers to access tools and data.
  • MCP Servers - MCP server configuration for remote tool access. Defines which MCP servers Claude can connect to and what tools are available.

Options

Authentication

  • API Key - Claude API key (optional if using Connection ID).
  • Use Robomotion AI Credits - Not supported for MCP. This feature requires direct API mode with your own API key.

Model Selection

  • Model - Select which Claude model to use. Options include:
    • Claude Opus 4.5 - Best for complex MCP interactions
    • Claude Opus 4 - Highly capable with MCP
    • Claude Sonnet 4.5 - Latest balanced model
    • Claude Sonnet 4 - Balanced performance and speed (default)
    • Claude 3.7 Sonnet - Latest 3.x generation Sonnet
    • Claude 3.5 Sonnet - Previous generation Sonnet
    • Claude 3.5 Haiku - Fastest model for simple MCP tasks
    • Custom Model - Specify your own model name
  • Custom Model - Enter custom model name when Custom Model is selected.

Generation Settings

  • Max Tokens - Maximum tokens for response (default: 4096).
  • Stream Response - Enable streaming to receive responses incrementally as they're generated (default: true).

Advanced

  • Timeout (seconds) - Request timeout in seconds (default: 120).
  • Include Raw Response - Include full API response in output (default: false).

Outputs

  • Text - Claude's text response after interacting with MCP servers.
  • Stream Events - Streaming events when streaming is enabled. Contains the incremental response chunks.
  • Raw Response - Complete API response object (when Include Raw Response is enabled).

What is MCP (Model Context Protocol)?

Model Context Protocol (MCP) is an open standard that allows Claude to connect to external data sources and tools through MCP servers. MCP enables:

  • Remote Tool Access - Claude can use tools hosted on MCP servers
  • Data Source Integration - Connect to databases, APIs, filesystems, etc.
  • Extensibility - Add custom tools and data sources without changing Claude
  • Security - Fine-grained control over what Claude can access

Think of MCP servers as "plugins" that give Claude new capabilities, like accessing a database, reading files, or calling external APIs.

MCP Server Configuration Format

The MCP Servers input should be a JSON array of server configurations:

[
{
"url": "https://mcp-server.example.com",
"name": "my-mcp-server",
"authorization_token": "optional-token-for-auth",
"tool_configuration": {
"enabled": true,
"allowed_tools": ["tool1", "tool2", "tool3"]
}
}
]

Each MCP server configuration includes:

  • url - The MCP server endpoint URL
  • name - A unique identifier for this server
  • authorization_token (optional) - Authentication token if the server requires it
  • tool_configuration - Controls which tools Claude can use:
    • enabled - Whether tools are enabled for this server
    • allowed_tools - Array of tool names Claude is allowed to use (empty array means all tools)

How It Works

The MCP Message node enables Claude to work with MCP servers. When executed, the node:

  1. Validates the connection (requires direct API mode, not Robomotion credits)
  2. Parses the MCP servers configuration
  3. Creates an MCP-enabled Claude client with the Beta header
  4. Configures the selected model and parameters
  5. If streaming is enabled:
    • Opens a streaming connection to Claude
    • Sends the prompt with MCP server configurations
    • Receives and accumulates streaming events
    • Each event can contain text deltas or tool interactions
    • Returns the final message and all events
  6. If streaming is disabled:
    • Sends the prompt with MCP server configurations
    • Waits for the complete response
    • Returns the response text
  7. Claude can use the MCP servers to access tools and data as needed

Requirements

  • Direct API mode - Robomotion AI Credits are not supported for MCP
  • Valid Connection Id or direct API Key credentials
  • Non-empty Prompt
  • Valid MCP Servers configuration
  • MCP servers must be accessible from where Robomotion is running

Error Handling

The node will return specific errors in the following cases:

  • Using Robomotion AI Credits mode - "MCP (Model Context Protocol) is not supported with Robomotion AI Credits"
  • Empty or missing Prompt
  • Empty or missing MCP Servers configuration
  • Invalid MCP Servers JSON format
  • Invalid Connection Id
  • MCP server connection errors
  • Empty Custom Model name when Custom Model is selected
  • API authentication errors (401)
  • API rate limit errors (429)
  • API service errors (500, 503)
  • Streaming errors

Usage Notes

MCP Server Setup

  • MCP servers must be running and accessible
  • Test MCP server connectivity before use
  • Ensure authentication tokens are correct
  • Verify tool names match what the MCP server provides

Streaming vs Non-Streaming

  • Streaming (default):
    • Get responses as they're generated
    • Better user experience for long responses
    • Can show progress to users
    • Slightly more complex to handle
  • Non-Streaming:
    • Wait for complete response
    • Simpler to use
    • Better for automated processing

Tool Access Control

  • Use allowed_tools to restrict which tools Claude can use
  • Empty allowed_tools array means all tools are available
  • Recommended to explicitly list allowed tools for security

Security Considerations

  • MCP servers can access sensitive resources
  • Only connect to trusted MCP servers
  • Use authorization tokens for server authentication
  • Limit allowed_tools to only what's needed

Examples

Example 1: File System MCP Server

MCP Servers Configuration:

[
{
"url": "https://filesystem-mcp.example.com",
"name": "filesystem",
"authorization_token": "your-token-here",
"tool_configuration": {
"enabled": true,
"allowed_tools": ["read_file", "list_directory"]
}
}
]

Prompt: "Read the contents of config.json and list all files in the data directory"

Configuration:

  • Model: Claude Sonnet 4
  • Stream Response: true

Claude will use the MCP server to access the filesystem and complete the request.


Example 2: Database MCP Server

MCP Servers Configuration:

[
{
"url": "https://database-mcp.example.com",
"name": "postgres-db",
"authorization_token": "db-access-token",
"tool_configuration": {
"enabled": true,
"allowed_tools": ["query", "get_schema"]
}
}
]

Prompt: "Get the schema of the users table and show me all users created in the last 7 days"

Configuration:

  • Model: Claude Sonnet 4
  • Max Tokens: 2000

Claude will query the database through the MCP server to get the information.


Example 3: Multiple MCP Servers

MCP Servers Configuration:

[
{
"url": "https://github-mcp.example.com",
"name": "github",
"authorization_token": "github-token",
"tool_configuration": {
"enabled": true,
"allowed_tools": ["search_repos", "get_issues", "create_issue"]
}
},
{
"url": "https://jira-mcp.example.com",
"name": "jira",
"authorization_token": "jira-token",
"tool_configuration": {
"enabled": true,
"allowed_tools": ["get_tickets", "create_ticket"]
}
}
]

Prompt: "Find all critical issues in the backend repository on GitHub and create corresponding tickets in Jira"

Configuration:

  • Model: Claude Opus 4.5
  • Max Tokens: 4000

Claude can orchestrate across multiple MCP servers to complete complex tasks.


Example 4: API Integration MCP Server

MCP Servers Configuration:

[
{
"url": "https://weather-api-mcp.example.com",
"name": "weather-api",
"tool_configuration": {
"enabled": true,
"allowed_tools": ["get_current_weather", "get_forecast"]
}
}
]

Prompt: "What's the weather like in New York today, and what's the forecast for the weekend?"

Configuration:

  • Model: Claude 3.5 Haiku
  • Stream Response: false

Claude will use the weather API MCP server to fetch and present the information.


Example 5: Streaming Response

MCP Servers Configuration:

[
{
"url": "https://knowledge-base-mcp.example.com",
"name": "kb",
"tool_configuration": {
"enabled": true,
"allowed_tools": ["search", "get_article"]
}
}
]

Prompt: "Search our knowledge base for information about API authentication and summarize the findings"

Configuration:

  • Model: Claude Sonnet 4
  • Stream Response: true

Output - Stream Events:

[
{
"type": "anthropic.BetaRawContentBlockDeltaEvent",
"text": "I'll search the knowledge base for "
},
{
"type": "anthropic.BetaRawContentBlockDeltaEvent",
"text": "API authentication information...\n\n"
},
// ... more events as Claude generates the response
]

You can use stream events to show real-time progress to users.


Example 6: Custom MCP Server

MCP Servers Configuration:

[
{
"url": "https://my-custom-mcp.company.com",
"name": "company-tools",
"authorization_token": "internal-token-xyz",
"tool_configuration": {
"enabled": true,
"allowed_tools": [
"get_employee_info",
"check_calendar",
"book_meeting_room"
]
}
}
]

Prompt: "Check if John Smith is available tomorrow at 2 PM and book the large conference room if he is"

Claude will use your custom MCP server to access internal company systems.

Best Practices

  1. MCP Server Management:

    • Keep MCP server configurations in a centralized location
    • Version your MCP server configurations
    • Document what each MCP server provides
    • Monitor MCP server health and availability
  2. Security:

    • Use authorization tokens for all MCP servers
    • Explicitly list allowed_tools instead of allowing all
    • Use HTTPS for all MCP server URLs
    • Regularly rotate authorization tokens
    • Audit MCP server access logs
  3. Tool Configuration:

    • Only enable tools that are needed
    • Use descriptive tool names
    • Document tool purposes and parameters
    • Test tools individually before combining
  4. Error Handling:

    • Handle MCP server connection failures
    • Provide fallback options if MCP servers are down
    • Validate MCP server responses
    • Implement retry logic for transient failures
  5. Streaming:

    • Use streaming for better user experience
    • Process stream events in real-time
    • Handle streaming errors gracefully
    • Provide visual feedback during streaming
  6. Performance:

    • Use appropriate timeouts for MCP operations
    • Monitor MCP server response times
    • Cache MCP server responses when appropriate
    • Optimize tool configurations
  7. Testing:

    • Test MCP server connectivity before deployment
    • Verify tool configurations are correct
    • Test with various prompts
    • Validate authorization tokens work
  8. Model Selection:

    • Use Opus for complex MCP orchestrations
    • Use Sonnet for general MCP interactions
    • Use Haiku for simple MCP queries
  9. Monitoring:

    • Log MCP server interactions
    • Track tool usage patterns
    • Monitor for errors and failures
    • Alert on MCP server issues
  10. Documentation:

    • Document available MCP servers
    • List available tools for each server
    • Provide example prompts for each tool
    • Keep configurations up to date

Common Use Cases

  1. Data Access:

    • Query databases through MCP
    • Read files from filesystems
    • Access cloud storage
    • Retrieve API data
  2. System Integration:

    • Connect to internal systems
    • Access enterprise applications
    • Integrate with third-party services
    • Bridge multiple data sources
  3. Automation:

    • Automate complex workflows
    • Orchestrate multiple systems
    • Process data across platforms
    • Execute multi-step operations
  4. Knowledge Access:

    • Search knowledge bases
    • Retrieve documentation
    • Access internal wikis
    • Query specialized databases
  5. Development Tools:

    • Access version control systems
    • Query issue trackers
    • Manage projects
    • Deploy applications

MCP Server Development

If you need to create your own MCP server:

  1. Choose an MCP Server Framework:

    • Use existing MCP server implementations
    • Follow the MCP specification
    • Implement required endpoints
  2. Define Tools:

    • Create clear tool definitions
    • Use JSON Schema for parameters
    • Provide helpful descriptions
  3. Implement Security:

    • Require authentication
    • Validate inputs
    • Implement rate limiting
    • Audit access
  4. Test Thoroughly:

    • Test with various Claude prompts
    • Verify error handling
    • Check performance
    • Validate security
  5. Document:

    • Document all available tools
    • Provide usage examples
    • Explain authentication
    • List requirements

Troubleshooting

MCP server not responding:

  • Verify the server URL is correct
  • Check network connectivity
  • Validate authorization token
  • Check server logs

Tools not working:

  • Verify tool names in allowed_tools
  • Check tool is implemented on server
  • Validate tool parameters
  • Test tool directly

Authorization failures:

  • Verify token is correct
  • Check token hasn't expired
  • Ensure token has required permissions
  • Check server authentication configuration

Streaming issues:

  • Verify network stability
  • Check timeout settings
  • Validate stream event handling
  • Monitor for connection drops

Integration with Other Nodes

With Data Processing

1. MCP Message → Access database via MCP
2. JavaScript → Process results
3. Excel → Write to spreadsheet

With Automation Workflows

1. Schedule Trigger
2. MCP Message → Check system status via MCP
3. If node → Check status
4. MCP Message → Take action if needed
5. Email → Send notification

With Multi-Step Tasks

1. MCP Message → Get data from System A
2. Transform node → Process data
3. MCP Message → Write to System B
4. Log results