MCP Integration User Guide
This guide provides step-by-step instructions for setting up and using MCP (Model Context Protocol) servers with Radium.
Table of Contentsβ
- Introduction
- Quick Start
- Setting Up Your First MCP Server
- Configuration Examples
- Using MCP Tools
- Using Slash Commands
- Authentication Setup
- Troubleshooting
- Best Practices
Introductionβ
MCP (Model Context Protocol) allows Radium to connect to external servers that provide tools and prompts. This extends Radium's capabilities by enabling:
- External Tool Integration: Use tools from external services (databases, APIs, file systems)
- Slash Commands: Access MCP server prompts through slash commands in chat
- Rich Content: Handle text, images, and audio content from MCP servers
Supported Transportsβ
Radium supports three transport types for connecting to MCP servers:
- Stdio: For local MCP servers running as processes
- SSE (Server-Sent Events): For remote servers using HTTP streaming
- HTTP: For remote servers using standard HTTP requests
Quick Startβ
1. Create Configuration Fileβ
Create .radium/mcp-servers.toml in your workspace root:
[[servers]]
name = "my-server"
transport = "stdio"
command = "mcp-server"
args = ["--config", "config.json"]
2. Verify Configurationβ
# List configured servers
rad mcp list
# Test connection
rad mcp test
3. Use MCP Toolsβ
MCP tools are automatically available to agents during execution. You can also list them:
rad mcp tools
Setting Up Your First MCP Serverβ
Step 1: Choose a Transport Typeβ
For Local Servers (Stdio):
- Server runs as a local process
- Best for development and testing
- Requires server executable to be in PATH
For Remote Servers (SSE/HTTP):
- Server runs on a remote host
- Best for production deployments
- Requires network access and authentication
Step 2: Create Configurationβ
Create .radium/mcp-servers.toml in your workspace root:
[[servers]]
name = "example-server"
transport = "stdio" # or "sse" or "http"
command = "mcp-server"
args = ["--config", "config.json"]
Step 3: Test Connectionβ
rad mcp test --server example-server
Step 4: Verify Tools Are Availableβ
rad mcp tools
You should see tools from your server listed.
Configuration Examplesβ
Example 1: Local Database Server (Stdio)β
[[servers]]
name = "postgres-mcp"
transport = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
Example 2: Remote API Server (HTTP)β
[[servers]]
name = "api-server"
transport = "http"
url = "https://api.example.com/mcp"
auth = { auth_type = "oauth", params = { token_url = "https://api.example.com/oauth/token", client_id = "your-client-id", client_secret = "your-client-secret" } }
Example 3: Remote Server with SSEβ
[[servers]]
name = "streaming-server"
transport = "sse"
url = "https://stream.example.com/mcp/sse"
auth = { auth_type = "oauth", params = { token_url = "https://stream.example.com/oauth/token", client_id = "your-client-id" } }
Example 4: Multiple Serversβ
[[servers]]
name = "database-server"
transport = "stdio"
command = "mcp-postgres"
args = ["postgresql://localhost/mydb"]
[[servers]]
name = "file-server"
transport = "stdio"
command = "mcp-filesystem"
args = ["--root", "/path/to/files"]
[[servers]]
name = "api-server"
transport = "http"
url = "https://api.example.com/mcp"
Using MCP Toolsβ
Automatic Discoveryβ
MCP tools are automatically discovered when Radium starts and are available to agents during execution. Tools from different servers are prefixed with the server name to avoid conflicts.
Tool Namingβ
Tools are registered with their server name as a prefix:
- Server:
database-server - Tool:
query - Registered as:
database-server/query
Using Tools in Agentsβ
Agents can use MCP tools just like built-in tools. The tool name includes the server prefix:
{
"tool": "database-server/query",
"arguments": {
"sql": "SELECT * FROM users LIMIT 10"
}
}
Listing Available Toolsβ
# List all tools
rad mcp tools
# List tools from specific server
rad mcp tools --server database-server
Using Slash Commandsβ
MCP prompts are available as slash commands in Radium's chat interface.
Available Commandsβ
# List all available slash commands
rad mcp prompts
Using Slash Commandsβ
In the chat interface, type / followed by the prompt name:
/prompt-name argument1 argument2
Exampleβ
If an MCP server provides a prompt called generate-code, you can use it as:
/generate-code python function to sort a list
Authentication Setupβ
OAuth Authenticationβ
For servers requiring OAuth authentication:
-
Get OAuth Credentials:
- Register your application with the OAuth provider
- Obtain
client_idandclient_secret - Get the
token_urlendpoint
-
Configure Authentication:
[[servers]]
name = "oauth-server"
transport = "http"
url = "https://api.example.com/mcp"
auth = {
auth_type = "oauth",
params = {
token_url = "https://api.example.com/oauth/token",
client_id = "your-client-id",
client_secret = "your-client-secret"
}
}
-
Initial Token Acquisition:
- First-time setup may require manual token acquisition
- Tokens are stored securely in
~/.radium/mcp_tokens/ - Tokens are automatically refreshed when expired
-
Check Token Status:
rad mcp auth status
For detailed OAuth setup instructions, see OAuth Setup Guide.
Troubleshootingβ
Server Not Connectingβ
Check Configuration:
rad mcp list
Test Connection:
rad mcp test --server server-name
Common Issues:
- Server executable not in PATH (stdio)
- Incorrect URL (HTTP/SSE)
- Network connectivity issues
- Authentication required but not configured
Tools Not Availableβ
Verify Server Connection:
rad mcp test
Check Tool Discovery:
rad mcp tools
Common Issues:
- Server not connected
- Server doesn't provide tools
- Tool name conflicts (check prefixes)
Authentication Errorsβ
Check Token Status:
rad mcp auth status
Common Issues:
- Token expired (should auto-refresh)
- Invalid credentials
- Missing
token_urlin config - Token storage directory permissions
For more troubleshooting help, see Troubleshooting Guide.
Best Practicesβ
1. Server Namingβ
Use descriptive, unique names for servers:
# Good
name = "postgres-production-db"
name = "github-api-server"
# Avoid
name = "server1"
name = "test"
2. Configuration Organizationβ
Group related servers together:
# Database servers
[[servers]]
name = "postgres-main"
# ...
[[servers]]
name = "postgres-analytics"
# ...
# API servers
[[servers]]
name = "github-api"
# ...
3. Securityβ
- Store sensitive credentials securely
- Use OAuth for remote servers
- Keep tokens in
~/.radium/mcp_tokens/(restricted permissions) - Don't commit tokens to version control
4. Error Handlingβ
- Test connections before relying on tools
- Monitor server health
- Use descriptive error messages
- Implement retry logic for transient failures
5. Performanceβ
- Limit number of servers (each adds overhead)
- Use appropriate transport (stdio for local, HTTP/SSE for remote)
- Monitor connection health
- Cache tool discovery results
Extension MCP Integrationβ
Extensions can provide MCP server configurations that are automatically loaded. Extension configs have lower precedence than workspace configs.
Example: An extension might provide a database MCP server that users can use immediately.
For details on extension MCP integration, see Extension MCP Integration.
Next Stepsβ
- Configuration Reference - Detailed configuration options
- OAuth Setup Guide - Step-by-step OAuth configuration
- Using MCP Tools - Advanced tool usage
- Slash Commands - Creating and using prompts
- Troubleshooting - Common issues and solutions
- Architecture - How MCP integration works
- Extension MCP Integration - How extensions provide MCP servers
Examplesβ
See the examples directory for complete working examples:
stdio-server.toml- Local server configurationremote-server.toml- Remote HTTP serveroauth-server.toml- OAuth-authenticated server