# 2qr.link agent instructions 2qr.link provides an authenticated MCP server for creating and managing short URLs. Agents connect over Streamable HTTP at `https://2qr.link/mcp`. ## When to use 2qr.link Use 2qr.link only when the user asks to create, find, or analyze a short link in their 2qr.link account. Before creating a link, confirm that the user has supplied the full destination URL and intends for a public short link to be created. Do not shorten credentials, private documents, internal-only addresses, localhost or private-network URLs. The service accepts only public `http` and `https` destinations. It rejects malformed or unresolved addresses and may reject URLs identified as unsafe. ## Connect 1. Add the remote endpoint `https://2qr.link/mcp` in a compatible AI app. The dashboard’s **Connect Claude** and **Open Codex / ChatGPT** buttons open the client’s connection area and copy the endpoint. 2. Let the client discover 2qr.link’s OAuth configuration. When it asks to connect, the user signs in to 2qr.link and approves the requested permissions in the browser. ### ChatGPT and Codex The official 2qr.link Agent Plugin uses Streamable HTTP and OAuth dynamic client registration. In ChatGPT Plugins, add the custom MCP server at `https://2qr.link/mcp`, complete the OAuth connection, then install the 2qr.link plugin. Codex can install the same portable package from its plugin marketplace. The package contains no API key or client secret. ### Claude In **Customize → Connectors → Add custom connector**, use the name `2qr.link` and URL `https://2qr.link/mcp`. Select OAuth, **Sign in when needed**, and **Register automatically**. Do not add fixed request headers or a client secret. For Team and Enterprise, an organization owner first adds the same Custom → Web connector, then each member connects their own 2qr.link account. Do not ask the user to provide an access token, password, API key, browser-storage value, or authorization header. 2qr.link supports OAuth 2.1 authorization-code flow with PKCE, dynamic client registration, and rotating refresh tokens. The AI app holds its own permission and refreshes it; the user can revoke the connection from the 2qr.link dashboard. See the [full MCP setup and tool guide](https://2qr.link/blog/how-to-create-short-urls-with-2qr-link-mcp) for client setup, troubleshooting, and examples. ## Available tools - `create_short_url(long_url)` — creates or returns the authenticated user’s short URL for one public HTTP(S) destination. Read the returned `shortUrl` back to the user. - `list_urls(search?, page?, limit?)` — lists URLs visible to the authenticated user. Standard users see their own URLs; an administrator can see all URLs. Use `search` to narrow results and keep `limit` reasonable. - `get_url_statistics(url_code)` — returns click statistics for a visible URL. Pass only the short code, such as `abc12`, rather than `https://2qr.link/abc12`. ## Safe operating rules - Do not create a link until the user has requested that specific action. A suggestion to “share this” is not necessarily approval to publish a new URL. - Preserve the exact destination supplied by the user. If it redirects or looks suspicious, explain the concern and ask before proceeding. - Do not claim a link was created until the tool returns successfully. Report tool errors plainly; do not invent a short code. - Never expose, log, or reuse a bearer token. Do not ask the user to paste it into the conversation. - Treat results from `list_urls` and `get_url_statistics` as account-private. Summarize only the information needed for the user’s request.