RedirHub MCP integration
Point any MCP-compatible client at one authenticated RedirHub endpoint so an agent can discover redirect-management tools and run them behind your client’s approval flow.
- MCP endpoint
- POST https://api.redirhub.com/mcp/v1
- Protocol
- JSON-RPC 2.0 over HTTP
- Credential
- Authorization: Bearer <token>
- Install flow
- https://account.redirhub.com/mcp
- REST source
- https://api.redirhub.com/v1
5-minute setup
A token, the endpoint, and one verification call get an agent talking to RedirHub. Do them in that order — a failed verification is much cheaper to read before a client is in the way.
- Get a token. Use the MCP install flow linked from the MCP product page, or create an API token from the account tokens page. Treat the value as opaque: copy it exactly as issued and do not validate it against a prefix or length — working tokens do not all share one shape.
- Export it. Keep the value in
REDIRHUB_MCP_TOKENin the shell, secret store, or client credential field that launches your MCP client. Never commit it, paste it into a prompt, or leave it in CI logs and screenshots. - Point your client at the endpoint. Configure
https://api.redirhub.com/mcp/v1as a remote HTTP MCP server and send the bearer header with every request. - Verify before wiring anything else. Run the checks below. A
401means the token never reached the server; a connection error means the client never did.
# Service discovery — no token required, returns no workspace data
curl -s "https://api.redirhub.com/mcp/v1"Endpoint and authentication
GET https://api.redirhub.com/mcp/v1 returns unauthenticated service discovery — server name, version, the advertised endpoints, and a quick-start block. POST to the same URL is the JSON-RPC endpoint: every call is a JSON-RPC 2.0 envelope with jsonrpc, id, method, and optional params, and it requires the Authorization header.
Two paths reach the same tools. The cURL checks above are the direct shortcut: one authenticated tools/list or resources/read POST answers 200 on its own, which is what makes them a good first check. A client instead runs the full MCP lifecycle — initialize, which returns the server capabilities and a session id, then a notifications/initialized acknowledgement, then tools/list and the tool calls. Your client library handles that for you; it matters when you read MCP logs, because a failure at initialize looks nothing like a failure at tools/list.
GET /mcp/v1 returns service metadata and the quick-start commands. It exposes no workspace data, so it is a safe first reachability check from any network.POST /mcp/v1 with no bearer token returns {"message":"Unauthenticated."}. Use this to prove the client is reaching RedirHub even before a token works.notifications/initialized returns 202 with no body. JSON-RPC notifications carry no id and get no result — an empty response there is success, not a dropped request.Client setup
The block below is the canonical RedirHub server information — the endpoint plus a bearer header — written in the shape many clients use. Treat it as a pattern, not a schema: field names, environment-variable syntax, and credential storage belong to each client. Keep the endpoint and the header, then map the rest to your client’s current docs.
{
"mcpServers": {
"redirhub": {
"url": "https://api.redirhub.com/mcp/v1",
"headers": {
"Authorization": "Bearer ${REDIRHUB_MCP_TOKEN}"
}
}
}
}Claude
Claude connects to remote MCP servers through the custom-connector UI rather than a hand-edited config file: add a custom connector, give it the remote MCP URL, connect, then enable it in the conversation. Follow the remote MCP connector docs for the current flow, and prefer any Claude-specific configuration the RedirHub install flow generates for you.
Cursor
Cursor reads MCP config from project .cursor/mcp.json or global ~/.cursor/mcp.json, supports remote servers by url, and expands environment variables inside headers using ${env:NAME}. See the Cursor MCP docs for the current UI and enterprise policy controls.
{
"mcpServers": {
"redirhub": {
"url": "https://api.redirhub.com/mcp/v1",
"headers": {
"Authorization": "Bearer ${env:REDIRHUB_MCP_TOKEN}"
}
}
}
}Codex CLI
Codex reads ~/.codex/config.toml, or a trusted project-scoped .codex/config.toml. For Streamable HTTP servers it documents url and bearer_token_env_var, so the token stays in the environment rather than the file. Keeping default_tools_approval_mode at prompt leaves every tool call behind an approval. See the Codex MCP docs.
[mcp_servers.redirhub]
url = "https://api.redirhub.com/mcp/v1"
bearer_token_env_var = "REDIRHUB_MCP_TOKEN"
default_tools_approval_mode = "prompt"Any other MCP client
For any other host, register RedirHub as a remote HTTP (Streamable HTTP) server at https://api.redirhub.com/mcp/v1 and send Authorization: Bearer <token> with each JSON-RPC request. Field names below are illustrative — check your host’s schema and the official MCP remote-server docs. Custom clients should initialize, discover capabilities, then call tools; the MCP server guide covers tools, resources, prompts, and approval expectations.
{
"name": "redirhub",
"transport": "streamable-http",
"url": "https://api.redirhub.com/mcp/v1",
"headers": {
"Authorization": "Bearer ${REDIRHUB_MCP_TOKEN}"
}
}Verify the connection
- Confirm the client lists RedirHub as a connected server, then confirm it lists tools. A server that connects but shows no tools is usually an authorization problem, not a config problem.
- Run the
tools/listcURL check to split the two: if cURL returns tools and the client does not, the fault is on the client side — reload it and read its MCP logs. - Make the first authenticated call a read.
resources/readonaccount://meconfirms the token resolves to the workspace you expect. - Ask the agent to state the read or write it intends before it calls anything, and check the arguments in the approval dialog against that statement.
Capabilities and limits
The tool surface is discovered from the server at connection time, so this page documents the connection rather than a catalog that would drift. tools/list and resources/list on your own authenticated connection are the authority on what the agent can reach.
POST /mcp/v1is the JSON-RPC endpoint and requires a bearer token;GETon the same URL returns discovery metadata unauthenticated.- An authenticated client discovers both tools and resources on connect. Read the names, descriptions, and input schemas from that live list — in the client’s server view or in the Inspector with the token set — before you let an agent act on them.
resources/readwith theaccount://meURI is the account-context read, and the cheapest way to confirm which workspace a token resolves to.- Tools carry MCP annotations: delete operations are hinted as destructive, and some analytics reads are hinted read-only. Use the hints to decide what stays behind an approval prompt, but read a missing hint as unknown rather than safe.
tools/list and resources/list, or from the server repository, and treat a change in the discovered surface as a breaking change until you have re-checked. Whatever the annotations say, your client’s approval flow is the boundary that stops an unwanted write.A safe operating workflow
Redirects are production routing. The same loop works for a one-off edit and for a bulk migration, and it is worth following even when the agent sounds confident.
- Discover. List tools and read their input schemas so you know what the agent can reach.
- Inspect. Read the current state of the redirects in scope before proposing a change.
- Preview. Ask for the affected set and the exact before/after values, with nothing applied.
- Approve. Check the count and the target hosts against your intent in the client approval dialog. Keep destructive tools behind a prompt rather than an allowlist.
- Execute. Apply the previewed set only, one call at a time for anything bulk, so a wrong argument stops at one record.
- Verify. Re-read the changed redirects and confirm the new state. Rollback is your own workspace exports and the REST API — the MCP server does not promise one.
Prompt examples
These describe intent and leave tool selection to the client and server, which keeps them working as the tool surface changes. Start read-only, then move up the list.
Using the RedirHub MCP server, list the redirects in my workspace with
their source hosts, destinations, and status. This is a read-only
inventory — do not create, update, or delete anything.Troubleshooting
mcpServers in JSON, [mcp_servers.<name>] in Codex TOML, UI fields in Claude. A pattern copied from another client is the usual cause.${env:NAME} inside headers; Codex reads the variable named by bearer_token_env_var.tools/list cURL check. Tools in cURL but not in the client is a client discovery problem — reload or restart the client after any config change and read its MCP logs.GET https://api.redirhub.com/mcp/v1 at all, that outbound HTTPS is allowed through any proxy, and that TLS interception is not breaking the connection.REST API and next steps
MCP and the REST API are two doors into the same workspace. Use MCP when an agent should discover and operate tools conversationally; use REST when you need an exact, versioned contract — request fields, response bodies, error payloads, filtering, pagination, and rate-limit headers. Where MCP coverage stops, REST is the fallback rather than a workaround.
- Authentication — token handling, rotation, and header rules for the REST API.
- API reference — the exact REST operations behind redirect management.
- Filtering & sorting — the read workflows worth doing over REST.
- Official MCP documentation — the protocol, capabilities, and client expectations.
- RedirHub MCP product page and the server repository — positioning, install entry points, and the server implementation.
