fetch_external tool is Reacher’s HTTP proxy for calling external APIs. Two environment variables control its behavior: PROXY_ALLOWED_DOMAINS defines which domains Claude is permitted to reach, and FETCH_EXTERNAL_TOKEN_MAP tells the server which credential to inject for each domain.
Together they give Claude authenticated access to any REST API without you ever pasting a token into a prompt.
Why domain whitelisting matters
Without a domain restriction, a compromised prompt or an unintended instruction could cause Reacher to proxy requests to arbitrary hosts on the internet — potentially leaking data or triggering unintended side effects on external services.PROXY_ALLOWED_DOMAINS is a strict allowlist. The server parses the hostname from the requested URL and checks it against the list before making any outbound connection. If the domain is not listed, the request is rejected immediately and Claude receives an error — no HTTP call is made.
How token injection works
FETCH_EXTERNAL_TOKEN_MAP is a JSON object that maps domain hostnames to the names of environment variables holding credentials:
fetch_external receives a request for api.github.com, it:
- Confirms the domain is in
PROXY_ALLOWED_DOMAINS - Looks up
"api.github.com"inFETCH_EXTERNAL_TOKEN_MAP→ finds"GITHUB_TOKEN" - Reads the value of the
GITHUB_TOKENenvironment variable from the server process - Injects
Authorization: Bearer <token>into the outbound request headers - Forwards the request and returns the response to Claude
If a domain is in
PROXY_ALLOWED_DOMAINS but not in FETCH_EXTERNAL_TOKEN_MAP, the request proceeds without injecting any authorization header. This is correct for public APIs that do not require authentication.JSON format
FETCH_EXTERNAL_TOKEN_MAP must be valid JSON. The keys are exact hostnames (not URLs or patterns), and the values are the names of other environment variables — not the token values themselves.
.env, the entire JSON object must be on a single line:
Adding a new API integration
Adding support for a new API is a two-line change to your.env:
Add the domain to PROXY_ALLOWED_DOMAINS
Add the token mapping to FETCH_EXTERNAL_TOKEN_MAP
Add the token value as its own environment variable
FETCH_EXTERNAL_TOKEN_MAP.Real examples
GitHub
Example Claude prompt
fetch_external with something like:
Authorization: Bearer ghp_xxx header automatically and returns the GitHub API response to Claude.
Linear
https://api.linear.app/graphql with the appropriate query body.
Notion
Bearer auth — Reacher’s injection pattern matches exactly.
Jira (Atlassian Cloud)
Jira Cloud hostnames are instance-specific (e.g.,your-org.atlassian.net). Use your exact subdomain:
Jira Cloud uses HTTP Basic auth, not Bearer tokens. The standard token injection adds a
Bearer header. For Jira, you may need to pass credentials differently — check the Atlassian REST API authentication docs and construct the auth header manually if needed.How the domain check works
The allowlist check infetch_external parses the full URL to extract the hostname, then checks exact membership in the allowed list:
api.github.com does not match github.com or gist.github.com. If you need access to multiple subdomains of the same service, add each one explicitly.
What happens when a domain is blocked
When Claude callsfetch_external for a domain not in the allowlist, the tool returns an error object immediately: