# Linkly > Linkly shortens links and counts their clicks. Everything the dashboard can do, an AI agent can do too: through Linkly's MCP server, or through its REST API. A short link looks like `https://linkly-api.wasp.run/r/` and redirects to its destination URL. Each visit is counted. Clicks can be read back by day or by referrer, and links ranked by clicks. ## MCP (recommended) - [MCP server](https://linkly-api.wasp.run/mcp): use this if you support MCP (Streamable HTTP). Log in with OAuth in the user's browser: there's no API key to copy and no client registration. On the consent page, the user picks what you may do. - Deleting a link may need the user's confirmation. If your client supports URL-mode elicitation, the confirmation page opens by itself and the call finishes once the user confirms. Otherwise the result has a `confirmUrl`: share it with the user, and nothing is deleted until they confirm there. ## REST API - [OpenAPI document](https://linkly-api.wasp.run/api/v1/openapi.json): every endpoint, the scope each one needs, which operations are destructive (`x-destructive`), and how to log in. - Base URL: https://linkly-api.wasp.run/api/v1 - If you're an OAuth client, call an endpoint without a token. The `401` response's `WWW-Authenticate` header points to the login metadata. - Otherwise, ask the user for a personal access token from [Tokens](/settings/tokens), with only the scopes the task needs (only read scopes if you only read). Send it as `Authorization: Bearer `. ## Rules - Never ask the user for their Linkly password. Log in with OAuth, or ask for a personal access token. - Ask the user before any operation marked `x-destructive: true` in the OpenAPI document, such as deleting a link. - Keep a personal access token in an environment variable (for example `LINKLY_TOKEN`). Check that it's set without printing it, and never write it to output, files, or logs. ## Docs - [Getting started](/docs/getting-started) - [Links and slugs](/docs/links-and-slugs) - [Tags](/docs/tags) - [How clicks are counted](/docs/how-clicks-are-counted) - [Analytics time ranges](/docs/analytics-ranges) - [Connecting AI assistants (MCP)](/docs/connecting-ai-clients) - [Toolsets and permissions](/docs/toolsets-and-permissions) - [Deleting links](/docs/deleting-links) - [REST API](/docs/rest-api) - [The linkly CLI](/docs/cli)