# Tinyurl — how to use (mcp.ai)

Connect your Tinyurl account and use 2 tools for URL shortener straight from your AI agent. Connect with your own API key. TinyURL shortens lengthy URLs, generating concise links for easier sharing and managing, often used in social media and marketing campaigns.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_tinyurl?ms=1787291460000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `tinyurl_create_short_url`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/tinyurl`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/tinyurl/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/tinyurl/create/short/url` — Creates a shortened URL using TinyURL's API. This action takes a long URL and returns a shortened version, with optional parameters for customization like domain, alias, tags, and expiration date.
  - body: { url: string, tags?: string[], alias?: string, domain?: string, expires_at?: string }
- `POST https://api.mcp.ai/api/tinyurl/list/urls` — Tool to retrieve a list of TinyURLs from your account. Use when you need to view available or archived shortened URLs. Supports pagination and filtering by URL type (available or archived).
  - body: { page?: integer, type: string, limit?: integer }

## Example prompts
- "What can I do in Tinyurl?"
- "Show me a summary of my Tinyurl account"

## More
- Page: https://mcp.ai/tinyurl
- Agent spec (llms.txt): https://mcp.ai/tinyurl/llms.txt
- Postman collection: https://mcp.ai/tinyurl/postman.json
