Overview
MCP servers are external processes that provide:- Tools with JSON schemas
- Resources (files, data)
- Prompts and templates
Quick Start
Add a Server
Authenticate (OAuth)
Test Connection
List Servers
Server Configuration
OAuth Server
For servers requiring authentication:- client_id: Your OAuth app client ID
- auth_url: Authorization endpoint (optional, can be discovered)
- token_url: Token endpoint (optional, can be discovered)
- scopes: Comma-separated list of scopes
Localhost Server
For development servers:Dynamic Client Registration (DCR)
Remote HTTPS servers without pre-configured OAuth can use DCR:- Discover OAuth endpoints via
.well-known/oauth-authorization-server - Register a client dynamically
- Complete the OAuth flow
- Store tokens securely
Authentication Flow
When you runironclaw mcp auth <server>:
- Check environment variable: If the server’s
env_varis set, use that token - Use stored tokens: If previously authenticated, use stored access/refresh tokens
- OAuth flow: Open browser for login, exchange code for tokens
- DCR fallback: If no OAuth config, try Dynamic Client Registration
Managing Servers
Enable/Disable
Remove
View Details
Configuration Storage
MCP server configurations are stored:- Database (preferred): If connected, stored in the
settingstable - File (fallback):
~/.ironclaw/mcp-servers.json
Using MCP Tools
Once configured, MCP tools appear in the agent’s tool list:MCP vs WASM Tools
Both are first-class in IronClaw’s extension system, but have different strengths:WASM Tools (IronClaw Native)
Pros:- Sandboxed: fuel metering, memory limits, capability-based permissions
- Credentials injected by host, tool never sees the token
- Output scanned for secret leakage
- Single binary, no process management
- Works offline
- Must build in Rust
- No ecosystem (yet)
- Synchronous only
MCP Servers
Pros:- Growing ecosystem (GitHub, Notion, Postgres, etc.)
- Any language (TypeScript, Python most common)
- Supports streaming, websockets, background polling
- Pre-built servers available
- External process with full system access
- Manages own credentials (IronClaw can’t prevent leaks)
- Network overhead
Decision Guide
| Scenario | Use |
|---|---|
| Good MCP server exists | MCP |
| Handles sensitive credentials | WASM |
| Quick prototype | MCP |
| Core capability, long-term | WASM |
| Needs streaming/websockets | MCP |
| Multiple tools share OAuth token | WASM |
OAuth Setup
Creating an OAuth App
Most services require OAuth app registration:- Register app with the service (e.g., Notion, GitHub)
- Set redirect URIs:
http://localhost:9876/callbackthroughhttp://localhost:9886/callback(IronClaw tries multiple ports) - Copy client ID and secret
- Configure environment (if needed):
Service-Specific Guides
Notion
- Go to Notion Integrations
- Create “Public Integration”
- Add redirect URIs:
http://localhost:9876/callbackto9886 - Copy Client ID and Secret
GitHub
- Go to GitHub OAuth Apps
- Create “OAuth App”
- Set Authorization callback URL:
http://localhost:9876/callback - Copy Client ID and Secret
Troubleshooting
Authentication Failed
OAuth error or 401 responses:- Check client ID/secret are correct
- Verify redirect URIs include
http://localhost:9876/callbackthrough9886 - Re-authenticate:
ironclaw mcp auth <server>
Connection Failed
Can’t connect to server:- Check the server URL is correct and accessible
- For remote servers, ensure HTTPS (HTTP only allowed for localhost)
- Test manually:
curl https://mcp.example.com/health
Token Expired
Stored tokens no longer work:Server Not Found
“Server ‘name’ not found”:Advanced Configuration
PKCE (Proof Key for Code Exchange)
PKCE is enabled by default (OAuth 2.1 requirement). To disable: Edit~/.ironclaw/mcp-servers.json:
Extra OAuth Parameters
Some servers require additional parameters:~/.ironclaw/mcp-servers.json:
Token Storage
Tokens are stored with these secret names:- Access token:
mcp_<server_name>_access_token - Refresh token:
mcp_<server_name>_refresh_token - Client ID (DCR):
mcp_<server_name>_client_id
Building Your Own MCP Server
See the MCP Protocol Specification for details. Basic server structure:Next Steps
- Learn about building WASM tools for tighter integration
- Explore Docker sandbox for secure command execution
- Set up Telegram channel for messaging
