Custom subdomains
Custom subdomains
Configure custom subdomains for your Rapid MCP server
Overview
You can attach headers at the MCP Server level. Those headers are automatically forwarded to every tool call and are also exposed as template variables inside your tool triggers. The template variable name matches the header key (lowercase, no spaces).
Example: if you set a header subdomain, you can reference it in a tool endpoint as {{subdomain}}.
URL-based server config (with headers)
Add headers to your MCP server configuration when using a direct URL:
{
"mcpServers": {
"RapidMCP": {
"url": "https://rapid-mcp.com/mcp/<serverId>/stream",
"headers": {
"Authorization": "Bearer XXXXX",
"subdomain": "acme"
}
}
}
}- Keys in
headersare available as template variables in tool triggers. In this example,subdomain→{{subdomain}}. - Keep keys lowercase and without spaces to ensure clean templating.
Use header values in tool endpoints
You can inject header values anywhere in the tool endpoint (host, path, or query). For example:
Tool Method:
GETTool Endpoint:
https://{{subdomain}}.example-api.com/v1/projects/{{properties.projectId}}/statsRequest Body (optional):
{
"tenant": "{{subdomain}}",
"projectId": "{{properties.projectId}}"
}With the server header "subdomain": "acme" and a test argument {"projectId": 123}, the resolved request becomes:
GET https://acme.example-api.com/v1/projects/123/statsMinimal case
If you want the endpoint (or a segment) to be exactly the header value, you can reference it directly:
{{subdomain}}
This will resolve to acme with the config above. In practice, you’ll typically place {{subdomain}} into the host or path as shown earlier.
Command-based connectors (npx) note
For command-driven clients, you can also pass the same header via CLI flags; it will be exposed to tools the same way:
{
"mcpServers": {
"RapidMCP": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://rapid-mcp.com/mcp/<serverId>/stream",
"--header",
"subdomain:${SUBDOMAIN}"
],
"env": { "SUBDOMAIN": "acme" }
}
}
}You can still reference {{subdomain}} inside tool endpoints just like the URL-based example.