RedirHub MCP API

เซิร์ฟเวอร์ MCP ของ RedirHub สำหรับจัดการการเปลี่ยนเส้นทาง URL โฮสต์ และโดเมนในระดับขนาดใหญ่ รองรับการดำเนินการ CRUD แบบเต็มรูปแบบ + การดำเนินการแบบกลุ่ม บันทึกการเข้าถึง สถิติการใช้งาน และความปลอดภัยแบบทดลองใช้งาน มีเครื่องมือ 19 รายการในทรัพยากร 15 รายการ ทำงานร่วมกับ Claude, Cursor และไคลเอนต์ MCP ใดๆ มีระดับฟรีให้ใช้งาน

GitHub
1
ลองใช้ MCP นี้ผู้สนับสนุน

เอกสาร

RedirHub MCP Server

License: MIT PRs Welcome MCP Server Built for AI Agents

Control every link from your AI assistant. Create branded links, dynamic QR codes, domain redirects and whole website migrations, then manage, audit and measure them through a standardized protocol, compatible with Claude, Cursor and any MCP client.

RedirHub is redirect infrastructure. This MCP server gives your AI agents direct access to that infrastructure: create and manage links, connect domains, invite team members and query analytics, all without opening a dashboard.

Features

  • One model for every link: branded links, dynamic QR codes, domain redirects and website migrations are created by intent and managed as one kind of object, as in the dashboard.
  • QR codes your agent can hand over: create-qr-code and get-qr-code return the QR code image itself, drawn exactly as the dashboard draws it.
  • Safe bulk changes: bulk tools preview by default and only apply changes with a confirmation token from that preview.
  • Same rules as the dashboard: links created or updated here go through the same validation, plan features and limits as the dashboard and the REST API.
  • Analytics & logs: query click statistics, raw access logs and each link's change history.
  • Team collaboration: multi-member workspaces with role-based access control.
  • MCP protocol: works with Claude, Cursor, Cline and any MCP client that calls tools.

Endpoint

https://mcp.redirhub.com/mcp/v1

Authentication

Generate a Workspace API token from dash.redirhub.com (Settings → API Tokens) and pass it as a Bearer token:

Authorization: Bearer ***

Available on all plans, including Free. Changing links and domains needs the editor role; workspace settings and members need the manager role.

Server Info

  • Name: Redirect Infra Public API
  • Version: 1.1.0
  • Transport: Streamable HTTP (JSON-RPC 2.0)

Data Model

Users belong to workspaces (organizations). A workspace has custom domains (hosts) and links.

Links are created from four intents but managed as one kind of object:

IntentToolWhat it is
Branded linkcreate-branded-linkA short URL on your own short-link domain, e.g. go.acme.co/spring
Dynamic QR codecreate-qr-codeA branded link meant for print; its destination can change after printing
Domain redirectcreate-redirectA domain, subdomain or path sent to a destination, e.g. old.acme.co → acme.com
Website migrationbulk-import with handler: "migration"Many old URLs mapped to new ones at once

Every link has an id (e.g. link_7bXmR4) that the get-link, update-link, delete-link, get-qr-code and get-link-history tools take. Domains are addressed by hostname, members by id (e.g. user_zwbJjgb8).

Tools

Links: read

ToolWhat It Does
list-linksList links, newest first. Filters: ids, handler (redirect, migration, short-url, qr), host, search, tags, status (active/paused), dns_correct, created_after, created_before. Paginate with per_page (max 100) and cursor.
get-linkOne link by id: destinations, redirect type, plugins, UTM parameters, QR style and tags.
count-linksCounts for the same filters: total, paused, dns_issue and no_clicks (no click in the last four weeks).
get-link-historyA link's changes, newest first: what changed (destination, UTM, type, status), who changed it and how. Needs the audit log feature (Pro plans and up); without it only the count is returned.
get-qr-codeA link's QR code as a PNG image, in its saved style, with the workspace logo when the style asks for it.
get-link-optionsThe accepted values: redirect types, destination routing strategies and plugins, with the plan feature each needs.

Links: create

ToolWhat It Does
create-branded-linkhost (a short-link domain) and destination required; optional alias (generated when omitted), title, description, utm, tags, status.
create-qr-codeSame arguments as create-branded-link. Returns the link and the QR code image in the default style; the style can be customized in the dashboard.
create-redirecturl (the source: domain, subdomain or path) required; optional destination, destinations + destination_routing, type (301, 302, 307, 308, frame, txt), forward_path, forward_query, plugins, utm, title, description, tags, status.

Use list-hosts with short_links_enabled: true to find the domains branded links and QR codes can use.

Links: manage

ToolWhat It Does
update-linkUpdate a link by id. Only the fields given change; the source URL and the kind of link never do.
delete-linkDelete a link by id, with its change history. Irreversible.
bulk-update-linksApply the same changes to many links. Select them with the list-links filters (except tags and status, which it sets), or all_links: true for every link.
bulk-delete-linksDelete links by source_urls[], e.g. ["acme.co/old-page"].
bulk-importImport up to ~5,000 links per call from rows[]. Each row: {url, destination?, handler?, type?, title?, description?, tags?, destinations?, destination_routing?, utm?}; handler is redirect (default), migration or short-url. mode is create (default; existing source URLs are skipped) or upsert (they are replaced). Counts against the plan's link limit.

⚠️ Bulk operation safety

bulk-update-links, bulk-delete-links and bulk-import only preview unless called with dry_run: false:

  1. Call without dry_run. The preview returns the affected count, a sample of the affected URLs and, for changes and deletions, a confirmation_token.
  2. Show the count to the user.
  3. Only after the user confirms, call again with the same arguments, dry_run: false and the confirmation_token.

The server enforces this: bulk-update-links, bulk-delete-links and bulk-import in upsert mode refuse to apply changes without a token issued for exactly the same arguments, by the same user, in the same workspace, within the last one to two hours.

Domains

ToolWhat It Does
list-hostsList custom domains with their DNS, HTTPS and short-link status. Filters: search, short_links_enabled, shared (also list the platform's shared domains).
get-hostOne domain by hostname, with the DNS records it needs.
connect-hostConnect a root (acme.com), sub (go.acme.com) or wildcard (*.acme.com) domain; returns the DNS records to add. Optional short_links_enabled, https_requested.
update-hostToggle HTTPS and short links on a domain.
refresh-hostRe-check a domain's DNS now.

Workspace & members

ToolWhat It Does
get-workspaceThe current workspace: plan, limits, usage and settings.
update-workspaceUpdate a setting: name, country, email, billing_extra, email_summary, email_host_status, email_manager.
list-membersMembers with their role (viewer, editor, manager).
add-memberInvite people by email: invites: [{email, role?}].
update-memberChange a member's role.
remove-memberRemove a member.

Account

ToolWhat It Does
get-accountThe signed-in user's profile.
update-accountUpdate a profile setting: name, language, currency, timezone, current_workspace, login_workspace, country, phone, im.

📊 Statistics

ToolWhat It Does
get-statsClick analytics. Set file/files for per-link stats (totals, daily trend, breakdowns by country, city, browser, device, referrer, protocol); omit them for workspace stats (total clicks, unique visitors, active/total link counts, breakdowns by link and kind). time_range is 7d, 30d, 90d, 180d, this_month or last_month, or use date_from + date_to. Clicks reach back 90 days (180 on plans with more analytics history); breakdowns cover the last 14 days (Enterprise: no limit).
get-access-logsRaw visits (time, IP, user agent, country, browser, referrer, ...). Filters: file, date_from/date_to, country, handler, browser, device, referrer, search (IP or user agent), bot_free. Covers the last 14 days (Enterprise: no limit). Cursor pagination.

QR codes

create-qr-code and get-qr-code return the code as a 512 px PNG, drawn exactly as the dashboard draws it: same modules, colors, margin, workspace logo and readable link underneath. The code encodes the link with ?utm_source=qr, so scans are counted separately from clicks.

For print files, the REST API serves the same code as SVG or PNG (512, 1024 or 2048 px wide):

GET https://api.redirhub.com/v1/links/{id}/qr              # SVG
GET https://api.redirhub.com/v1/links/{id}/qr?format=png&width=2048

Resources

Clients that attach MCP resources can also read the same data as resources (append query params as ?key=value): redirects://list, redirects://link_{id}, redirects://count, links://list, links://link_{id}, hosts://list, hosts://{hostname}, workspace://current, members://list, members://{user_id}, account://me, plugins://catalog and record-types://catalog.

Most clients only let the model call tools, so prefer the tools above; they cover everything the resources do.

Renamed tools

Version 1.1 dropped the -tool suffix and named the record tools after links. The old names keep working, so existing setups don't break, but new prompts and integrations should use the new ones:

Old nameNew name
create-redirect-toolcreate-redirect
create-link-toolcreate-branded-link
update-record-toolupdate-link
delete-record-tooldelete-link
bulk-update-records-toolbulk-update-links
bulk-delete-records-toolbulk-delete-links
bulk-import-toolbulk-import
connect-host-tool, update-host-tool, refresh-host-toolconnect-host, update-host, refresh-host
add-member-tool, update-member-tool, remove-member-tooladd-member, update-member, remove-member
update-workspace-tool, update-account-toolupdate-workspace, update-account
get-stats-tool, get-access-logs-toolget-stats, get-access-logs

Other changes in 1.1:

  • Create tools return the link. create-redirect used to wrap it in {created, record}.
  • Bulk tools preview by default. They used to apply changes unless told otherwise.
  • bulk-update-links needs a filter or all_links: true. It used to change every record in the workspace.

Quick Start

1. Get your API token

Sign up at redirhub.com and create a Workspace API token from dash.redirhub.com Settings → API Tokens.

2. Configure your MCP client

Add to your client config; the endpoint accepts the standard MCP HTTP transport:

{
  "mcpServers": {
    "redirhub": {
      "url": "https://mcp.redirhub.com/mcp/v1",
      "headers": {
        "Authorization": "Bearer rh_YOUR_API_TOKEN"
      }
    }
  }
}

Works with Claude Desktop, Cursor and any MCP-compatible HTTP client. To try it from a terminal:

npx @modelcontextprotocol/inspector --transport http --server-url https://mcp.redirhub.com/mcp/v1

3. Use it

Once connected, tell your AI agent what you need:

"Create a QR code for our menu on go.acme.co that points to acme.com/menu, and show it to me."

"Redirect old.acme.co to acme.com with a 301, keeping the path."

"Migrate these 500 URLs from our old site to the new one."

"How many links on go.acme.co had no clicks in the last four weeks? Pause every link on that domain."

"Who changed the destination of go.acme.co/spring, and when?"

Documentation


Built by RedirHub: redirect infrastructure for teams that can't afford broken links.