MCP Server Documentation
Connect Claude, Codex, Cursor and any MCP-compatible AI agent to your UseClick account. Create short links and query click analytics in plain language.
On this page6
What is the UseClick MCP Server?
The Model Context Protocol (MCP) is an open standard that lets AI assistants use external tools. The UseClick MCP server exposes your short links, click analytics and website analytics as tools, so an AI agent can create links, manage campaigns and answer analytics questions about your links and your website traffic. It works with every client that supports remote MCP servers over Streamable HTTP.
https://useclick.io/api/mcpQuick Start
- Step 01
1. Get your API key
The MCP server uses the same API keys as the REST API. Sign in and create one in Account, MCP & API Keys, Keys. Keys look like
uc_live_...and are available on every plan, including Free. - Step 02
2. Add the server to your AI client
Use the endpoint above with your API key as a bearer token. Client-specific instructions are below.
- Step 03
3. Ask your agent
That is it. Ask for a new short link or your click stats and the agent picks the right tool automatically.
Client Setup
Coding agents & IDEs
Paste one config and your editor can create links and read analytics.
Claude Code
Works with your API keyTerminal
Run this in your terminal. The server is registered for the current project. Add --scope user to register it globally.
claude mcp add --transport http useclick https://useclick.io/api/mcp \
--header "Authorization: Bearer uc_live_YOUR_API_KEY"Cursor
Works with your API key.cursor/mcp.json
Add to .cursor/mcp.json in your project, or ~/.cursor/mcp.json to enable it everywhere. Then turn the server on under Settings, MCP.
{
"mcpServers": {
"useclick": {
"url": "https://useclick.io/api/mcp",
"headers": {
"Authorization": "Bearer uc_live_YOUR_API_KEY"
}
}
}
}VS Code (Copilot)
Works with your API key.vscode/mcp.json
VS Code uses a top-level "servers" key, not "mcpServers". With the input below, VS Code prompts for your key once and stores it in the OS keychain instead of your repo.
{
"inputs": [
{
"id": "useclick-key",
"type": "promptString",
"description": "UseClick API key",
"password": true
}
],
"servers": {
"useclick": {
"type": "http",
"url": "https://useclick.io/api/mcp",
"headers": {
"Authorization": "Bearer ${input:useclick-key}"
}
}
}
}Windsurf
Works with your API key~/.codeium/windsurf/mcp_config.json
Windsurf uses "serverUrl" for remote servers. Open Settings, Cascade, MCP Servers, View raw config, paste this, then press Refresh. If your version does not pick it up, check the Windsurf MCP docs for the current key names.
{
"mcpServers": {
"useclick": {
"serverUrl": "https://useclick.io/api/mcp",
"headers": {
"Authorization": "Bearer uc_live_YOUR_API_KEY"
}
}
}
}Gemini CLI
Works with your API key~/.gemini/settings.json
Gemini CLI uses "httpUrl" for Streamable HTTP servers. Add this to ~/.gemini/settings.json for all projects, or .gemini/settings.json for one. If your version does not pick it up, check the Gemini CLI docs for the current key names.
{
"mcpServers": {
"useclick": {
"httpUrl": "https://useclick.io/api/mcp",
"headers": {
"Authorization": "Bearer uc_live_YOUR_API_KEY"
}
}
}
}OpenAI Codex CLI
Works with your API key~/.codex/config.toml
This is the ChatGPT-family path that works with a UseClick API key today. Remote MCP support in Codex is still evolving, so if your version does not pick the server up, check codex --version against the current Codex config docs.
[mcp_servers.useclick]
url = "https://useclick.io/api/mcp"
http_headers = { "Authorization" = "Bearer uc_live_YOUR_API_KEY" }Desktop & chat apps
Chat clients. Some only accept OAuth connectors, see the notes.
Claude Desktop
Works with your API keyclaude_desktop_config.json
Claude Desktop's built-in Connectors only accept OAuth servers, so an API key cannot be entered there. Use the mcp-remote bridge instead: Settings, Developer, Edit Config, paste this into claude_desktop_config.json, then restart Claude. Requires Node.js.
{
"mcpServers": {
"useclick": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://useclick.io/api/mcp",
"--header",
"Authorization: Bearer uc_live_YOUR_API_KEY"
]
}
}
}ChatGPT (app)
Not supported yetThe ChatGPT custom connector dialog only accepts servers that use OAuth or no authentication. It cannot attach a static Authorization header, and putting the key in the URL gets the connector flagged as unsafe. We would rather say so than ship a config that breaks.
Working alternatives: OpenAI Codex CLI, OpenAI Responses API, OpenAI Agents SDK.
Build your own agent
Pass the MCP server straight to the model API, no local client needed.
Anthropic Messages API
Works with your API keycurl
Pass the server directly in the Messages API. The anthropic-beta header is required, without it the mcp_servers field is rejected.
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: mcp-client-2025-04-04" \
-d '{
"model": "claude-sonnet-4-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "List my top links this week"}],
"mcp_servers": [
{
"type": "url",
"url": "https://useclick.io/api/mcp",
"name": "useclick",
"authorization_token": "uc_live_YOUR_API_KEY"
}
]
}'OpenAI Responses API
Works with your API keyPOST https://api.openai.com/v1/responses
OpenAI's hosted MCP tool takes the API key in the "authorization" field and sends it as a bearer token, so a UseClick key works directly.
{
"model": "gpt-5",
"input": "Create a short link for https://mysite.com/launch",
"tools": [
{
"type": "mcp",
"server_label": "useclick",
"server_url": "https://useclick.io/api/mcp",
"authorization": "uc_live_YOUR_API_KEY",
"require_approval": "never"
}
]
}OpenAI Agents SDK
Works with your API keyPython
The same hosted MCP tool, expressed through the Agents SDK. The connection runs on OpenAI's side, so nothing is installed locally.
from agents import Agent, HostedMCPTool, Runner
agent = Agent(
name="Link assistant",
tools=[
HostedMCPTool(
tool_config={
"type": "mcp",
"server_label": "useclick",
"server_url": "https://useclick.io/api/mcp",
"authorization": "uc_live_YOUR_API_KEY",
"require_approval": "never",
}
)
],
)
result = await Runner.run(agent, "Which link performed best this month?")
print(result.final_output)Automation & other clients
No-code tools and any client that speaks stdio MCP.
n8n
Configured in the UIn8n is configured in the UI rather than a config file. Add the MCP Client Tool node to an AI Agent workflow:
- Add an AI Agent node, then attach an MCP Client Tool node to its Tool input.
- Set Endpoint to https://useclick.io/api/mcp and Server Transport to "HTTP Streamable".
- Set Authentication to "Bearer", or create a Header Auth credential with the name "Authorization".
- Paste your UseClick key as the token. The full header value is "Bearer uc_live_YOUR_API_KEY".
- Set Tools to Include to "All", then run the workflow once to confirm the eleven tools are discovered.
Other JSON clients
Works with your API keyyour client's MCP config
Most clients with remote MCP support accept this shape. If yours rejects it, try dropping "type": "http", or renaming the top-level key to "servers".
{
"mcpServers": {
"useclick": {
"type": "http",
"url": "https://useclick.io/api/mcp",
"headers": {
"Authorization": "Bearer uc_live_YOUR_API_KEY"
}
}
}
}Any stdio-only client
Works with your API keyyour client's MCP config
If your agent or harness only speaks stdio MCP, bridge to the remote server with mcp-remote. Requires Node.js on the machine running the agent.
{
"mcpServers": {
"useclick": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://useclick.io/api/mcp",
"--header",
"Authorization: Bearer uc_live_YOUR_API_KEY"
]
}
}
}Available Tools
Once connected, your agent can use these eleven tools:
create_short_linkCreate a short link with optional custom slug, title, campaign, UTM parameters, expiration date and click limit
list_linksList your links with click counts, pagination and campaign filtering
get_linkGet the details of one link by its slug
update_linkUpdate destination URL, title, campaign, expiration or click limit of an existing link
delete_linkPermanently delete a link and its click history
get_link_analyticsAggregated click analytics: totals, unique visitors, breakdowns by country, browser, device, OS, referrer, plus a daily time series and top links
list_websitesList the websites you track with UseClick Website Analytics (Starter+)
get_website_analyticsAggregated website traffic without bots: page views, unique visitors, sessions, bounce rate, time on site, top pages, referrers, UTM sources, countries, devices and a daily time series (Starter+)
get_custom_eventsCustom events a website sent (signups, downloads, clicks) with counts, visitors and property values
list_goalsConversion goals of a website with conversions, revenue and how many came from short links (Growth+)
get_account_infoYour subscription plan, feature availability, usage limits and API rate limit
Example Prompts
Things you can ask your AI assistant after connecting:
- "Create a short link for https://mysite.com/launch with the slug product-launch"
- "How many clicks did my links get in the last 7 days, and from which countries?"
- "Which of my links performed best this month?"
- "Create 3 short links for my newsletter campaign with UTM source newsletter"
- "Show me the daily click trend for the link black-friday over the last 30 days"
- "How many visitors did my website get today, and what were the top pages?"
Security and Rate Limits
- The agent only sees links belonging to your account or organization.
- Your subscription plan is enforced: features like campaigns, UTM parameters or link expiration return a clear error on plans that do not include them.
- Revoke access at any time by deleting the API key in your dashboard.
- MCP requests share the same rate limit as the REST API:
- Free100requests/minute
- Starter300requests/minute
- Growth600requests/minute
- Pro1,200requests/minute
- Business3,000requests/minute
Analytics quota
The analytics tools (get_link_analytics, get_website_analytics, get_custom_events) run heavier database queries, so they additionally have a daily quota per API key. Identical queries are cached for 5 minutes and served from cache without consuming quota, and every response includes an analytics_quota object so agents can pace themselves. Always-on agents and harnesses should query once and reuse the result instead of polling.
- Free25queries/day
- Starter100queries/day
- Growth300queries/day
- Pro1,000queries/day
- Business5,000queries/day
