> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the LinklyHQ MCP server

The LinklyHQ MCP connector routes your AI agent's tool calls to LinklyHQ's own MCP server through Scalekit. Each user signs in to LinklyHQ once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 25 tools.

**Authentication:** OAuth 2.1/PKCE
**Categories:** Marketing, Analytics
**Tools:** 25: 13 read, 7 write, 5 destructive
**Users sign in with:** OAuth
**OAuth app:** Scalekit's or your own
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=LINKLYMCP)

## What you can do

- **Create and manage short links**: shorten URLs, update destinations and tracking tags, and delete links one by one or in bulk
- **Find links**: list links or search them by name, destination URL, or note
- **Analyze clicks**: get click counts over time, break them down by country, platform, or browser, and export click details
- **Get click webhooks**: subscribe and unsubscribe webhook URLs for click events on one link or the whole workspace
- **Manage custom domains**: add, list, and remove custom domains and update their favicons

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the LinklyHQ MCP connection

   In **AgentKit > Connections**, create a LinklyHQ MCP connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   Scalekit credentials are available for LinklyHQ MCP server, so you don't need to register an OAuth app. To show your own app on the consent screen, use your own credentials instead.

   **Use your own OAuth app:**

   LinklyHQ MCP uses Dynamic Client Registration (DCR), so you don't need a client ID or secret. Create a connection in Scalekit, then have each user authorize their LinklyHQ account.

   1. ### Create a connection in Scalekit

      - In the [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** > **Connections** > **Create Connection**.
      - Search for **LinklyHQ MCP** and click **Create**.
      - Note the **Connection name**. Use it as `connection_name` in your code, for example `linklymcp`.

   2. ### Authorize your LinklyHQ account

      Generate an authorization link and open it in a browser. The user signs in to LinklyHQ and grants access to their workspace.

      Scalekit stores the token and adds it to every tool call, so no further configuration is needed.

      > note: Check the connection first
      >
      > After connecting, call `linklymcp_test_authentication` to confirm the credentials work, then `linklymcp_list_workspaces` to get the workspace ID and name.

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'linklymcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize LinklyHQ MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'linklymcp_export_clicks',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "linklymcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize LinklyHQ MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="linklymcp_export_clicks",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'linklymcp_export_clicks',
  toolInput: {},
  connector: 'linklymcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="linklymcp_export_clicks",
    tool_input={},
    connection_name="linklymcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `linklymcp_export_clicks`

Export Clicks · Read-only

Export detailed click records with full information including timestamp, browser, country, URL, platform, referrer, bot status, ISP, and URL parameters.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `bots` (`string`, optional): Bot filtering. One of: `include`, `exclude`, `only`.
- `country` (`string`, optional): Filter by country code
- `end` (`string`, optional): End date in YYYY-MM-DD format (default: yesterday)
- `link_id` (`integer`, optional): Filter by specific link ID
- `platform` (`string`, optional): Filter by platform
- `start` (`string`, optional): Start date in YYYY-MM-DD format (default: 30 days ago)

Example input: `{}`

### `linklymcp_get_analytics`

Get Analytics · Read-only

Get time-series click analytics data for charting. Returns click counts over time with optional date range, link, and demographic filters.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `bots` (`string`, optional): Bot filtering: include (default), exclude, or only. One of: `include`, `exclude`, `only`.
- `browser` (`string`, optional): Filter by browser name
- `country` (`string`, optional): Filter by country code (e.g., 'US', 'GB')
- `end` (`string`, optional): End date in YYYY-MM-DD format (default: today)
- `frequency` (`string`, optional): Time granularity: 'day' (default) or 'hour'. One of: `day`, `hour`.
- `link_id` (`integer`, optional): Filter by specific link ID
- `platform` (`string`, optional): Filter by platform (e.g., 'desktop', 'mobile', 'tablet')
- `start` (`string`, optional): Start date in YYYY-MM-DD format (default: 30 days ago)
- `unique` (`boolean`, optional): Count unique clicks only (by IP)

Example input: `{}`

### `linklymcp_get_analytics_by`

Get Analytics by Dimension · Read-only

Get click counts grouped by a dimension such as country, platform, or browser. Useful for breakdowns and top-N reports.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `counter` (`string`, required): Dimension to group by (required). One of: `country`, `platform`, `referer`, `isp`, `link_id`, `destination`, `bot_name`.
- `bots` (`string`, optional): Bot filtering. One of: `include`, `exclude`, `only`.
- `country` (`string`, optional): Filter by country code
- `end` (`string`, optional): End date in YYYY-MM-DD format (default: today)
- `link_id` (`integer`, optional): Filter by specific link ID
- `platform` (`string`, optional): Filter by platform
- `start` (`string`, optional): Start date in YYYY-MM-DD format (default: 30 days ago)
- `unique` (`boolean`, optional): Count unique clicks only

Example input: `{"counter":"country"}`

### `linklymcp_get_clicks`

Get Clicks · Read-only

Get recent click data for the workspace, optionally filtered by a specific link ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `link_id` (`integer`, optional): Filter clicks by link ID. Provide the integer ID of the link to scope results to that link only. If omitted, returns clicks across all links in the workspace.

Example input: `{}`

### `linklymcp_get_link`

GetLink · Read-only

Get details of a specific LinklyHQ link by its ID, including destination URL, slug, UTM parameters, and settings.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `link_id` (`integer`, required): The ID of the link to retrieve

Example input: `{"link_id":1}`

### `linklymcp_list_domains`

List Domains · Read-only

List all custom domains configured in the LinklyHQ workspace.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `linklymcp_list_link_webhooks`

List Link Webhooks · Read-only

List all webhook URLs subscribed to a specific LinklyHQ link's click events.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `link_id` (`integer`, required): The ID of the link

Example input: `{"link_id":1}`

### `linklymcp_list_links`

ListLinks · Read-only

List links in the workspace with optional sorting and search filtering.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `page` (`integer`, optional): Page number for pagination
- `page_size` (`integer`, optional): Number of links per page
- `search` (`string`, optional): Search query to filter links
- `sort_by` (`string`, optional): Field to sort results by
- `sort_dir` (`string`, optional): Sort direction: asc or desc. One of: `asc`, `desc`.

Example input: `{}`

### `linklymcp_list_webhooks`

List Webhooks · Read-only

List all webhook URLs subscribed to the LinklyHQ workspace. These webhooks receive click events for all links.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `linklymcp_list_workspaces`

ListWorkspaces · Read-only

Return details of the authenticated LinklyHQ workspace, including ID and name.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `linklymcp_ping`

Ping · Read-only

Health check for the LinklyHQ MCP server.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `message` (`string`, required): A message to ping

Example input: `{"message":"<message>"}`

### `linklymcp_search_links`

Search Links · Read-only

Search for links by name, destination URL, or note. Returns matching links with click statistics.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): Search query to match against link names, destination URLs, and notes. The search is performed across all three fields to find relevant links.

Example input: `{"query":"<query>"}`

### `linklymcp_test_authentication`

TestAuthentication · Read-only

Test API authentication with LinklyHQ. Use this to verify your credentials are valid.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `linklymcp_create_domain`

Create Domain · Write

Add a custom domain to the LinklyHQ workspace. The domain must already be configured to point to LinklyHQ servers via DNS.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): The fully-qualified domain name to add to the LinklyHQ workspace. The domain must already have DNS configured to point to LinklyHQ servers before calling this.

Example input: `{"name":"<name>"}`

### `linklymcp_create_link`

CreateLink · Write

Create a short link or URL shortener. Use when the user asks to shorten a URL, create a short link, or make a link shorter. Supports UTM tracking, custom domains, pixel tracking, and link expiry.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Destination URL for the short link
- `block_bots` (`boolean`, optional): Block known bots and spiders
- `cloaking` (`boolean`, optional): Hide destination URL by opening in an iframe
- `domain` (`string`, optional): Custom domain for the short link (without trailing /)
- `enabled` (`boolean`, optional): Whether the link is active (default: true)
- `expiry_datetime` (`string`, optional): ISO 8601 datetime when the link expires
- `expiry_destination` (`string`, optional): Fallback URL after expiry (404 if blank)
- `fb_pixel_id` (`string`, optional): Meta/Facebook Pixel ID for tracking
- `forward_params` (`boolean`, optional): Forward URL parameters to destination
- `ga4_tag_id` (`string`, optional): Google Analytics 4 tag ID
- `gtm_id` (`string`, optional): Google Tag Manager container ID
- `hide_referrer` (`boolean`, optional): Hide referrer information when users click
- `name` (`string`, optional): Nickname for the link
- `note` (`string`, optional): Private note about this link
- `og_description` (`string`, optional): Open Graph description for social media previews
- `og_image` (`string`, optional): Open Graph image URL for social media previews
- `og_title` (`string`, optional): Open Graph title for social media previews
- `slug` (`string`, optional): Custom slug/suffix (must start with /)
- `utm_campaign` (`string`, optional): UTM campaign parameter
- `utm_content` (`string`, optional): UTM content parameter
- `utm_medium` (`string`, optional): UTM medium parameter
- `utm_source` (`string`, optional): UTM source parameter
- `utm_term` (`string`, optional): UTM term parameter

Example input: `{"url":"<url>"}`

### `linklymcp_subscribe_link_webhook`

Subscribe Link Webhook · Write

Subscribe a webhook URL to receive click events for a specific LinklyHQ link.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `link_id` (`integer`, required): The ID of the link
- `url` (`string`, required): The webhook URL to receive click event notifications

Example input: `{"link_id":1,"url":"<url>"}`

### `linklymcp_subscribe_webhook`

Subscribe Webhook · Write

Subscribe a webhook URL to receive click events for all links in the LinklyHQ workspace.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): The webhook URL to receive click event notifications

Example input: `{"url":"<url>"}`

### `linklymcp_update_domain_favicon`

Update Domain Favicon · Write

Update the favicon URL for a custom domain in the LinklyHQ workspace.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `domain_id` (`integer`, required): The integer ID of the domain whose favicon should be updated. Use list_domains to find the domain's ID.
- `favicon_url` (`string`, required): The fully-qualified URL pointing to the favicon image to use for this custom domain (e.g., https://example.com/favicon.ico).

Example input: `{"domain_id":1,"favicon_url":"<favicon_url>"}`

### `linklymcp_update_link`

UpdateLink · Write

Update an existing LinklyHQ link by its ID. Modify the destination URL, name, UTM parameters, tracking pixels, or expiry settings.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `link_id` (`integer`, required): The ID of the link to update
- `block_bots` (`boolean`, optional): Block bots
- `cloaking` (`boolean`, optional): Enable URL cloaking
- `enabled` (`boolean`, optional): Whether the link is active
- `expiry_datetime` (`string`, optional): Expiry datetime ISO 8601
- `expiry_destination` (`string`, optional): Fallback URL after expiry
- `fb_pixel_id` (`string`, optional): Meta Pixel ID
- `forward_params` (`boolean`, optional): Forward URL parameters
- `ga4_tag_id` (`string`, optional): Google Analytics 4 tag ID
- `gtm_id` (`string`, optional): Google Tag Manager ID
- `hide_referrer` (`boolean`, optional): Hide referrer
- `name` (`string`, optional): New nickname for the link
- `note` (`string`, optional): New private note
- `og_description` (`string`, optional): Open Graph description
- `og_image` (`string`, optional): Open Graph image URL
- `og_title` (`string`, optional): Open Graph title
- `url` (`string`, optional): New destination URL
- `utm_campaign` (`string`, optional): UTM campaign parameter
- `utm_content` (`string`, optional): UTM content parameter
- `utm_medium` (`string`, optional): UTM medium parameter
- `utm_source` (`string`, optional): UTM source parameter
- `utm_term` (`string`, optional): UTM term parameter

Example input: `{"link_id":1}`

### `linklymcp_update_workspace`

UpdateWorkspace · Write

Update workspace settings including the workspace name and webhook notification URL.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Workspace name
- `webhooks` (`array`, required): REPLACES the workspace's full webhook subscription list. Omit to leave webhooks unchanged; prefer subscribe_webhook / unsubscribe_webhook for adding or removing a single URL.

Example input: `{"name":"<name>","webhooks":[]}`

### `linklymcp_batchdeletelinks`

Batch Delete Links · Destructive

Batch delete multiple LinklyHQ links by their IDs. This action is permanent and cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `ids` (`array`, required): Array of link IDs to delete

Example input: `{"ids":[]}`

### `linklymcp_delete_domain`

Delete Domain · Destructive

Remove a custom domain from the LinklyHQ workspace. This action is permanent.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `domain_id` (`integer`, required): The integer ID of the domain to permanently remove from the LinklyHQ workspace. Use list_domains to find the domain's ID before calling this.

Example input: `{"domain_id":1}`

### `linklymcp_delete_link`

DeleteLink · Destructive

Delete a LinklyHQ link by its ID. This action is permanent and cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `link_id` (`integer`, required): The ID of the link to delete

Example input: `{"link_id":1}`

### `linklymcp_unsubscribe_link_webhook`

Unsubscribe Link Webhook · Destructive

Unsubscribe a webhook URL from a specific LinklyHQ link's click events.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `link_id` (`integer`, required): The ID of the link
- `url` (`string`, required): The webhook URL to unsubscribe

Example input: `{"link_id":1,"url":"<url>"}`

### `linklymcp_unsubscribe_webhook`

Unsubscribe Webhook · Destructive

Unsubscribe a webhook URL from workspace-level click events.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): The webhook URL to unsubscribe

Example input: `{"url":"<url>"}`

## Workflows

### Check authentication status

Use `linklymcp_test_authentication` to verify the connection is active and your credentials are valid.

  **Node.js**

  ```typescript
  const result = await actions.executeTool({
    connector: 'linklymcp',
    identifier: 'user_123',
    toolName: 'linklymcp_test_authentication',
    toolInput: {},
  });
  console.log(result);
  ```

  **Python**

  ```python
  result = actions.execute_tool(
      connection_name="linklymcp",
      identifier="user_123",
      tool_name="linklymcp_test_authentication",
      tool_input={},
  )
  print(result)
  ```

### Create a short link with UTM tracking

Use `linklymcp_create_link` to shorten a URL and attach UTM parameters for campaign tracking.

  **Node.js**

  ```typescript
  const link = await actions.executeTool({
    connector: 'linklymcp',
    identifier: 'user_123',
    toolName: 'linklymcp_create_link',
    toolInput: {
      url: 'https://example.com/landing-page',
      name: 'Summer Campaign',
      utm_source: 'newsletter',
      utm_medium: 'email',
      utm_campaign: 'summer2024',
    },
  });
  console.log(link.full_url);
  ```

  **Python**

  ```python
  link = actions.execute_tool(
      connection_name="linklymcp",
      identifier="user_123",
      tool_name="linklymcp_create_link",
      tool_input={
          "url": "https://example.com/landing-page",
          "name": "Summer Campaign",
          "utm_source": "newsletter",
          "utm_medium": "email",
          "utm_campaign": "summer2024",
      },
  )
  print(link["full_url"])
  ```

### Get click analytics by dimension

Use `linklymcp_get_analytics_by` to break down click counts by country, browser, or platform over a date range.

  **Node.js**

  ```typescript
  const analytics = await actions.executeTool({
    connector: 'linklymcp',
    identifier: 'user_123',
    toolName: 'linklymcp_get_analytics_by',
    toolInput: {
      counter: 'country',
      start: '2024-01-01',
      end: '2024-01-31',
    },
  });
  console.log(analytics);
  ```

  **Python**

  ```python
  analytics = actions.execute_tool(
      connection_name="linklymcp",
      identifier="user_123",
      tool_name="linklymcp_get_analytics_by",
      tool_input={
          "counter": "country",
          "start": "2024-01-01",
          "end": "2024-01-31",
      },
  )
  print(analytics)
  ```

## Related

Other Marketing connectors ([all 97](/agentkit/connectors/?category=marketing)):

- [HubSpot](/agentkit/connectors/hubspot/): Scalekit connector, OAuth, 457 tools
- [Mailchimp](/agentkit/connectors/mailchimp/): Scalekit connector, OAuth, 73 tools
- [Twitter / X](/agentkit/connectors/twitteroauth/): Scalekit connector, OAuth, 92 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
