# Upload to URL — how to use (mcp.ai)

Connect your Upload to URL account and use 5 tools for file management and storage straight from your AI agent. Connect with your own API key. Upload files to public CDN URLs, retrieve or delete uploaded file metadata, and publish HTML pages.

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

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

### Endpoints
- `POST https://api.mcp.ai/api/upload_to_url/delete/file` — Permanently delete a previously uploaded file from storage and its public CDN location.
  - body: { file_id: string }
- `POST https://api.mcp.ai/api/upload_to_url/get/file/metadata` — Retrieve current metadata and the public CDN URL for a file previously uploaded by the connected account.
  - body: { file_id: string }
- `POST https://api.mcp.ai/api/upload_to_url/get/supported/formats` — Return the file extensions Upload to URL accepts or blocks, current plan size limits, and advertised upload security checks. Use this before uploading an unfamiliar file type.
- `POST https://api.mcp.ai/api/upload_to_url/publish/html` — Publish raw HTML at a public URL under a chosen page path. This irreversible public side effect consumes one monthly credit, and the API provides no way to delete the published page.
  - body: { html_code: string, page_path: string, subdomain?: string, expiry_days?: string }
- `POST https://api.mcp.ai/api/upload_to_url/upload/file` — Upload one file and return its public CDN URL, file ID, expiration, and remaining monthly credits. Each successful call consumes one upload credit.
  - body: { file: object, source?: string, expiry_days?: string }

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

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