MCP Servers
MCP (Model Context Protocol) is an open standard for connecting AI models to external tools and data sources. Runtype supports both built-in MCP integrations and custom MCP servers.
Overview
MCP servers provide tools that AI models can call during flow execution. Unlike simple HTTP tools, MCP servers offer:
- Tool discovery - Automatic detection of available tools
- Rich schemas - Detailed parameter definitions
- Stateful connections - Session management for complex workflows
- Standardized protocol - Works with any MCP-compatible server
Two Ways to Use MCP Servers
Using Saved MCP Servers
Save an MCP server once, use it across all flows.
Step 1: Add the Server
Dashboard
API
- Go to Settings > Integrations > MCP Servers
- Click Add Server
- Enter the server URL and authentication
- Click Test Connection to verify
- Save the configuration
Step 2: Discover Available Tools
Response:
Step 3: Use in Flows
Passthrough Mode (mcp:<server>:*)
To attach every tool a saved server exposes — current and future — include a single wildcard entry in toolIds:
The wildcard is expanded into concrete tool ids at execution time, so:
- New tools added to the upstream MCP server appear automatically — no need to re-edit the agent.
- Approval rules,
toolConfigs,perToolLimits, and usage tracking still operate on real, fully-qualified tool ids. - If both a wildcard and curated picks are present for the same server (
mcp:mynotion:*+mcp:mynotion:create_page), the wildcard wins and the curated picks are skipped.
Use passthrough when you trust the server end-to-end and want the agent to pick up new capabilities without configuration changes. Use the curated form (specific tool ids) when you want an explicit, audited subset.
Using Runtime MCP Servers
Pass server configuration inline for dynamic use cases.
When to Use Runtime Servers
- Multi-tenant apps where each user has their own credentials
- Testing new servers before saving
- One-off integrations
- Dynamic server URLs
Example
Authentication Types
MCP servers support multiple authentication methods:
The headers type carries an arbitrary map of HTTP header name → value, for servers that need two or more headers (for example a hosted MCP that requires both an X-Api-Key and an X-Base-URL). Every value may contain a {{secret:NAME}} reference, resolved from your managed secrets at request time exactly like token or password. The headers field is valid only on type: "headers", and the record must be non-empty with valid HTTP header names.
In the dashboard, multi-header auth is tucked under Advanced authentication → Multiple headers so the common single-credential choices stay concise. Saved header values remain encrypted and hidden; editing them requires entering a complete replacement set. The same headers record is also supported by POST /v1/mcp/servers, inline tools.mcpServers, and FPO agent configurations.
OAuth 2.1 authentication
Some MCP servers protect their tools with OAuth instead of a static token. For these servers, Runtype handles the full OAuth 2.1 authorization in the dashboard, so you authorize once in the browser and never paste a token by hand.
Auto-detection on URL entry
When you enter an MCP server URL in the dashboard, Runtype probes the server to find out whether it requires OAuth2. This uses RFC 9728 protected-resource discovery to locate the server’s authorization server.
If OAuth2 is detected, Runtype surfaces a Connect with OAuth2 option instead of asking you for a manual token. The discovered issuer and scopes appear so you can confirm you’re authorizing the right provider.
Detection works for real RFC 9728 servers, including ones whose authorization-server metadata lives only at the host root but reports a path-based issuer (for example, mcp.grafana.com/mcp).
Authorizing in the browser
Clicking Connect with OAuth2 opens a popup where you sign in and approve access with the provider. Runtype uses PKCE for the exchange, so no client secret is handled in the browser.
After you approve, the popup closes and the server’s tools appear for selection. You can then pick the tools you want, exactly as you would for any other MCP server.
Discovery diagnostics
If OAuth2 is not detected, an expandable diagnostics panel shows what each discovery phase tried — the URL it probed, the response status, and any error. Use this to troubleshoot servers that should support OAuth2 but aren’t being detected.
Where OAuth2 setup works
OAuth2 setup, auto-detection, and tool discovery are available in both places you add an MCP server:
- Settings > Integrations > MCP Servers — the main MCP server management area.
- The agent tool-selection modal — when adding a server while choosing tools for an agent.
Previously-configured OAuth2 servers now appear correctly in the agent tool-selection modal, showing their discovered tool count rather than appearing unconfigured.
Tool ID Format
MCP tool IDs follow this pattern:
Examples:
mcp:context7:resolve-library-id- Context7 documentation servermcp:myslack:send_message- Your saved Slack servermcp:github:create_issue- Your saved GitHub server
For runtime servers, tool IDs become:
The reserved * toolName is the passthrough wildcard — see Passthrough Mode above:
Server Configuration Options
Environment Support
Saved servers can have environment-specific configurations:
Specify environment in dispatch:
Limits
Combining with Other Tools
MCP tools work alongside other tool types:
Security
Credential Security
- Auth tokens are encrypted at rest for saved servers
- Runtime credentials are never logged or stored
- Use environment variables, never hardcode tokens
- Limit tool access with
allowedToolswhen possible
Troubleshooting
Connection timeout
- Check the server URL is accessible
- Increase
timeoutvalue (max 60000ms) - Verify firewall/network rules
Authentication failed
- Verify token is valid and not expired
- Check auth type matches server expectations
- For
api_key, ensureheaderNameis correct
Tools not appearing
- Call
GET /mcp/toolsto verify discovery - Check
allowedToolsfilter if set - Ensure server implements
tools/listendpoint