MCP Connection Variables: One Server for Every Account Domain
MCP connection variables let one GetMCP server work with APIs whose address changes from account to account. A Freshdesk subdomain, a Mailchimp data centre such as us21 or an ActiveCampaign account name becomes a named value you write once, then reference in any tool as {{name}}. When every user has their own account domain, the value can come from a header their MCP client sends instead.
This guide is for anyone building MCP servers for APIs that are not one fixed URL: agencies connecting client accounts, SaaS teams publishing a server for their customers, and developers wiring regional or multi-tenant APIs into Claude or Cursor.
What are MCP connection variables?
A connection variable is a name and value stored on the server, not on any one tool. At call time GetMCP substitutes the value into the tool’s endpoint URL and custom headers wherever {{name}} appears, including the hostname. A Mailchimp tool’s endpoint can be https://{{dc}}.api.mailchimp.com/3.0/lists, and the server supplies dc.
Variables live on the server’s Settings tab, in the Connection Variables section. Each row has a name, a source and a value. There are two sources:
- Fixed value: you type the value once, and every caller uses it. Right when the server talks to one account.
- From client header: each connecting user supplies their own value in an HTTP header such as
X-Account-Domain. Right when every user has their own account domain.
Variables are operator configuration, like credentials. A model calling your tools cannot see them, and it cannot overwrite them with a tool argument it invents.
How it works
- Open the server, go to Settings, and find Connection Variables.
- Click Add Variable. Enter a name such as
dcorsubdomain. - Choose Fixed value and type the value, or choose From client header and enter the header name. When you switch a row to a header, GetMCP suggests one built from the variable name, such as
X-Account-Domainforaccount_domain. - Save the settings.
- In each tool, use
{{name}}wherever the value belongs: the hostname, a path segment or a custom header value.

On every tool call, GetMCP resolves values in a fixed order. A tool argument the tool declares, with the same name, wins. Next comes a value from the client’s header. A fixed variable of the same name is the default when the header is missing.
If a placeholder is still unfilled, the call stops before anything is sent upstream. The error says exactly what is missing: “subdomain” was not resolved. Provide it as a tool argument, or define it as a connection variable in the server settings. For a header variable, the message names the exact header the user must send.
Key options and rules
| Setting | Rule from the code |
|---|---|
| Variable name | Letters, numbers and underscores, up to 40 characters. |
| Fixed value | Letters, numbers, dots, dashes and underscores, up to 100 characters. Never slashes. |
| Header name | Starts with a letter or number; letters, numbers and dashes only. |
| Header value sent by a client | Same safe character set as fixed values, up to 200 characters. Anything else is ignored. |
| Placeholder syntax | {{name}} (the editor’s documented form); {name} is also substituted. |
| Where it applies | The tool’s endpoint URL, hostname included, and custom header values. |
| Duplicates | One fixed and one header variable may share a name on purpose; two of the same kind may not. |
The character rules are a security boundary. Because a value can never contain a slash, an @ or a port, it cannot change where a request goes beyond the slot you put it in.
Header variables and your users’ MCP clients
With a header variable, each user adds the header once in their MCP client’s connection settings. GetMCP does the rest of the setup for you:
- The How to connect snippets on the server page include the header with a placeholder such as
<YOUR_ACCOUNT_DOMAIN>, plus a notice to replace it. - Quick Connect for Cursor carries the same header into the install link.
- The header is added to the endpoint’s allowed CORS headers, so browser-based clients can send it.
One limit: Claude’s no-config Connector method cannot send custom headers. Users of a server with header variables connect through the config-file method instead, and the How to connect panel steers them there. The full client walkthrough is in connecting an MCP server to Claude, Cursor and more.
Use cases for MCP connection variables
Point a Mailchimp server at the right data centre
Mailchimp’s API host includes the account’s data centre. Store dc = us21 as a fixed variable and every audience and campaign tool resolves to the right host.
Claude → GetMCP ({{dc}} = us21) → us21.api.mailchimp.com
Reuse one helpdesk server for each agency client
An agency builds a Freshdesk server with https://{{subdomain}}.freshdesk.com/api/v2/... endpoints, then exports it. On each client’s install, they import it and set subdomain to acme or northwind. Variables travel in the export; credentials do not.
Export server → import per client → set {{subdomain}} → live
Serve every customer of a multi-tenant SaaS from one endpoint
Each customer of a helpdesk product has their own domain, such as app.acme.example.com. Set account_domain to From client header with X-Account-Domain. Amelia Okafor and Yuki Tanaka call the same tools on the same server, and each request reaches their own account.
Cursor (X-Account-Domain) → GetMCP → customer's own API host
Keep a WordPress or WooCommerce template portable
The bundled WordPress and WooCommerce templates use {{site}} and {{store}} in their endpoints. Installing a template seeds the variable and never overwrites a value you already filled in. Until you set it, calls fail with a clear “not resolved” error instead of a wrong host.
Install template → set {{site}} → tools call your site
Switch between staging and production without editing tools
Put the environment host in a variable such as env_host. Changing one value moves every tool from staging.example.com to api.example.com, with no tool edits.
Settings: {{env_host}} → all tools follow
Pass a tenant ID in a header the API requires
Some APIs want an account or workspace ID in a header on every call. Add a custom header to each tool with the value {{workspace_id}}, and keep the ID itself in one fixed variable.
Tool header X-Workspace: {{workspace_id}} → API
Tips and gotchas
- Arguments win only when declared. A tool argument fills a placeholder only if the tool declares that parameter. An argument the model makes up cannot fill a variable, so it cannot redirect your tools to another host.
- Values are not URLs. Store
acme, nothttps://acme.freshdesk.com/. The field drops slashes and colons as you type, and the server refuses them on save. - Placeholders left by an AI assistant count as unset. If Manage with AI drafted the server, a value like
REPLACE_ME__DCis treated as unconfigured, and the error names the variable. - Bad header values are ignored, not repaired. If a user sends an invalid value and no fixed default exists, they get the error naming the header, which tells them what to fix.
- Variables are not secrets. They travel in server exports and are shown in the admin. Put keys and tokens in the Authentication tab instead.
Related features
- MCP server authentication: the credentials that go with each account.
- MCP server templates: ready-made servers that declare their own variables.
- Connecting clients: how users add header values in each client.
FAQ
Can I use a variable in the hostname of an endpoint?
Yes. Placeholders are substituted anywhere in the endpoint URL, including the subdomain, as in https://{{subdomain}}.freshdesk.com. The value’s character rules stop it from adding a path, port or user info.
How do multi-tenant users supply their own domain?
Set the variable’s source to From client header and name the header, for example X-Account-Domain. Each user adds that header once in their MCP client’s config. The How to connect snippets already include it with a placeholder to replace.
What happens if a variable is missing?
The tool call fails before any request is sent, with an error naming the placeholder. For a header variable, the error names the header the client must send. Nothing reaches the upstream API with a half-built URL.
Do connection variables work with Claude’s Connector?
Fixed variables work with every client, because they live on the server. Header variables need a client that can send custom headers, which Claude’s Connector method cannot. Those users connect through the config-file method instead.
Connection variables turn one server definition into one per account, without copying tools. See the full feature list on the features page.
Ship an MCP server for your product this week.
Install GetMCP on any PHP host, import your API and share one URL. Your users can call your tools from Claude tonight.