Skip to main content
Model Context Protocol (MCP) libraries allow you to extend Rilo’s capabilities by connecting to external MCP servers. MCP servers provide custom tools, data sources, and capabilities not available in standard integrations.

What is MCP?

Model Context Protocol (MCP) is a protocol for connecting AI applications to external tools and data sources. Rilo supports MCP servers to extend its capabilities beyond standard integrations.
MCP enables you to add custom tools and capabilities to Rilo without building full integrations. Perfect for specialized use cases or internal tools.

How MCP Works in Rilo

1. MCP Server Connection

Connect to an MCP server by providing:
  • Server URL: The MCP server endpoint
  • Authentication: API keys, bearer tokens, or other auth methods
  • Server Name: Optional name for the MCP service

2. Tool Discovery

Rilo automatically:
  • Connects to the MCP server
  • Fetches available tools
  • Generates a library class
  • Makes tools available in workflows

3. Tool Execution

MCP tools are executed via the MCP protocol:
  • Tools are called through the MCP server
  • Results are returned to workflows
  • Tools work just like built-in libraries

Adding an MCP Server

Step 1: Navigate to Integrations

  1. Go to the Integrations page
  2. Find the MCP Servers section
  3. Click “Add MCP Server”

Step 2: Configure Server

Provide MCP server details:
{
  "name": "My Custom MCP Server",
  "server_url": "https://mcp.example.com/api/mcp",
  "auth_type": "bearer",
  "auth_config": {
    "token": "your-api-token"
  }
}

Step 3: Connect

Rilo will:
  • Test the connection
  • Fetch available tools
  • Generate the library
  • Make tools available
MCP servers must be accessible from Rilo’s infrastructure. Ensure the server URL is publicly accessible or configure appropriate network access.

MCP Tool Generation

Automatic Library Generation

When you add an MCP server, Rilo:
  1. Fetches tools: Gets available tools from the server
  2. Generates class: Creates a Python library class
  3. Creates methods: Each MCP tool becomes a method
  4. Enhances metadata: Uses AI to improve tool descriptions

Generated Library Structure

class MyMCPServerTool(BaseTool):
    """
    My Custom MCP Server
    
    Tools are executed via the MCP protocol.
    """
    
    IS_MCP_LIBRARY = True
    
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.mcp_server_url = "https://mcp.example.com/api/mcp"
    
    def tool_method_1(self, param1, param2):
        """Execute tool_method_1 via MCP"""
        return self._call_mcp_tool("tool_method_1", {
            "param1": param1,
            "param2": param2
        })

Using MCP Tools in Workflows

Via Natural Language

Describe what you want:
"Use my custom MCP tool to process the data"
The AI agent will:
  • Identify the MCP tool
  • Use it in generated code
  • Handle authentication automatically

In Generated Code

MCP tools are used like any other library:
from library.my_mcp_server_tool import MyMCPServerTool

mcp_tool = MyMCPServerTool()
result = mcp_tool.tool_method_1(
    param1="value1",
    param2="value2"
)

MCP Server Requirements

Server Requirements

MCP servers must:
  • ✅ Implement the MCP protocol
  • ✅ Be accessible via HTTP/HTTPS
  • ✅ Support tool discovery
  • ✅ Handle tool execution requests
  • ✅ Return results in MCP format

Authentication

MCP servers can use various authentication methods:
  • Bearer Token: API key in Authorization header
  • API Key: Key in headers or query parameters
  • OAuth: OAuth 2.0 flow (if supported)
  • Custom: Custom authentication methods
Ensure MCP servers handle authentication securely. Never expose sensitive credentials in server URLs or configurations.

MCP vs Custom APIs

When to Use MCP

Use MCP when:
  • ✅ You have an existing MCP server
  • ✅ You want to leverage MCP protocol features
  • ✅ You need dynamic tool discovery
  • ✅ Tools are provided by an MCP-compatible service

When to Use Custom APIs

Use Custom APIs when:
  • ✅ You have a standard REST API
  • ✅ You want more control over tool definitions
  • ✅ You need custom authentication flows
  • ✅ You prefer direct HTTP integration
Both MCP and Custom APIs achieve similar goals. Choose based on your existing infrastructure and preferences.

Best Practices

Store MCP server credentials securely. Use encrypted storage for sensitive tokens.
Test MCP server connections before using in production workflows.
Monitor MCP tool usage and server performance to ensure reliability.
Provide clear tool descriptions in your MCP server for better AI understanding.

Troubleshooting

  • Verify server URL is correct and accessible
  • Check authentication credentials
  • Ensure server implements MCP protocol correctly
  • Test server endpoint directly
  • Verify tool discovery is working
  • Check server returns tools in correct format
  • Ensure authentication has proper permissions
  • Review server logs for errors
  • Verify tool parameters are correct
  • Check server handles tool execution properly
  • Review error messages from server
  • Ensure server is accessible and responsive

Example MCP Servers

Common Use Cases

  • Internal Tools: Connect to internal company tools
  • Specialized Services: Integrate with specialized MCP-compatible services
  • Custom Workflows: Extend Rilo with custom workflow capabilities
  • Data Sources: Connect to custom data sources via MCP

MCP libraries are a powerful way to extend Rilo’s capabilities. If you have an MCP server, connecting it to Rilo is straightforward and enables custom tools in your workflows.