Remote Server Example
This example shows how to configure a remote MCP server using HTTP or SSE transport.
Overviewβ
Remote servers run on a different host and communicate over HTTP. Radium supports two transport types for remote servers:
- HTTP: Standard HTTP requests/responses
- SSE (Server-Sent Events): HTTP streaming with server-sent events
HTTP Transportβ
Basic Configurationβ
[[servers]]
name = "remote-api"
transport = "http"
url = "https://api.example.com/mcp"
With Authenticationβ
[[servers]]
name = "authenticated-api"
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"
}
}
SSE Transportβ
Basic Configurationβ
[[servers]]
name = "streaming-api"
transport = "sse"
url = "https://api.example.com/mcp/sse"
With Authenticationβ
[[servers]]
name = "authenticated-streaming"
transport = "sse"
url = "https://api.example.com/mcp/sse"
auth = {
auth_type = "oauth",
params = {
token_url = "https://api.example.com/oauth/token",
client_id = "your-client-id"
}
}
Common Examplesβ
Example 1: Public APIβ
[[servers]]
name = "public-api"
transport = "http"
url = "https://api.publicservice.com/mcp"
Example 2: Internal API with OAuthβ
[[servers]]
name = "internal-api"
transport = "http"
url = "https://internal.company.com/mcp"
auth = {
auth_type = "oauth",
params = {
token_url = "https://internal.company.com/oauth/token",
client_id = "radium-client",
client_secret = "secret-key"
}
}
Example 3: Streaming Serviceβ
[[servers]]
name = "streaming-service"
transport = "sse"
url = "https://stream.example.com/mcp/events"
auth = {
auth_type = "oauth",
params = {
token_url = "https://stream.example.com/oauth/token",
client_id = "stream-client"
}
}
Requirementsβ
- Network Access: Server must be accessible from your network
- HTTPS Recommended: Use HTTPS for secure communication
- Authentication: Configure OAuth for protected endpoints
- CORS: Server must allow requests from Radium (if applicable)
Testingβ
# Test connection
rad mcp test --server remote-api
# Verify tools
rad mcp tools --server remote-api
Troubleshootingβ
Connection Refusedβ
Problem: Cannot connect to remote server
Solution:
- Verify URL is correct:
curl https://api.example.com/mcp - Check network connectivity
- Verify firewall settings
- Check if server requires authentication
Authentication Errorsβ
Problem: 401 Unauthorized responses
Solution:
- Verify OAuth credentials are correct
- Check token status:
rad mcp auth status - Ensure
token_urlis correct - Verify client_id and client_secret
- Check token storage:
~/.radium/mcp_tokens/
Timeout Errorsβ
Problem: Connection times out
Solution:
- Check network latency
- Verify server is responding:
curl -v https://api.example.com/mcp - Check firewall/proxy settings
- Verify server is not overloaded
SSL/TLS Errorsβ
Problem: Certificate validation errors
Solution:
- Verify server certificate is valid
- Check certificate chain
- Ensure system time is correct
- For development, server may need to accept self-signed certificates
Best Practicesβ
- Use HTTPS: Always use HTTPS for remote servers
- Secure Credentials: Store OAuth credentials securely
- Monitor Health: Regularly check server connectivity
- Handle Errors: Implement retry logic for transient failures
- Test First: Test connection before relying on tools
Security Considerationsβ
- Token Storage: Tokens are stored in
~/.radium/mcp_tokens/with restricted permissions (0600) - Credential Management: Don't commit credentials to version control
- Network Security: Use HTTPS to encrypt communication
- Token Refresh: Tokens are automatically refreshed when expired