# L2s — how to use (mcp.ai)

Connect your L2s account and use 4 tools for URL shortener straight from your AI agent. Connect with your own API key. L2S is a professional URL shortener offering advanced analytics, QR code generation, and team collaboration features.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_l2s?ms=1787293500000`
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. `l2s_get_url_details`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/l2s`
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/l2s/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/l2s/get/url/details` — Tool to retrieve details of a shortened URL. Use when you need metadata about a specific shortened link. Use after obtaining a valid URL ID.
  - body: { id: string }
- `POST https://api.mcp.ai/api/l2s/l2/s/get/user/settings` — Tool to retrieve current user's settings. Use after authentication to fetch email, notification, and appearance preferences.
- `POST https://api.mcp.ai/api/l2s/l2/s/list/urls` — Tool to list all shortened URLs. Use after user authentication to retrieve the user's URLs with pagination details.
  - body: { page?: integer, page_size?: integer }
- `POST https://api.mcp.ai/api/l2s/l2/s/shorten/url` — Tool to shorten a given long URL. Use when you need a concise link representation.
  - body: { url: string, tags?: string[], title?: string, utmTerm?: string, customKey?: string, utmMedium?: string, utmSource?: string, utmContent?: string, utmCampaign?: string }

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

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