> ## Documentation Index
> Fetch the complete documentation index at: https://docs.davazmysel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Tools

> Let Claude and other MCP-compatible AI assistants create and look up Dáva links directly.

The Dáva MCP server exposes `create_link` and `find_link` as tools an AI assistant can call —
so an assistant helping you plan a campaign can mint the tracked link itself, instead of you
copying values back and forth from the dashboard.

<Note>
  This wraps the same [Machine Create API](/api/create-links) covered elsewhere — every link an
  MCP tool creates follows the identical interview and governance rules as the dashboard UI and the
  HTTP API. There is no separate MCP-only taxonomy.
</Note>

## What it does

* **`create_link`** — mints a link with the same inputs the dashboard's Add Mapping dialog
  accepts. Always attaches an `external_id`, generating one automatically if you don't supply it,
  so a retry never creates a duplicate.
* **`find_link`** — retrieves a link you created earlier by its `external_id`. Returns
  `found: false` rather than throwing when nothing matches.

## Prerequisites

* Node.js 18 or later
* A Dáva account with at least one connected domain
* A Dáva API key with the **Links** scope — see [Create Links via API → Authentication](/api/create-links#authentication) for how to create one

## Claude Desktop setup

Add the server to your Claude Desktop configuration file
(`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS,
`%APPDATA%\Claude\claude_desktop_config.json` on Windows):

```json theme={null}
{
  "mcpServers": {
    "dava-links": {
      "command": "npx",
      "args": ["@davazmysel/mcp"],
      "env": {
        "DAVA_API_URL": "https://api-v2.davazmysel.com",
        "DAVA_API_KEY": "dava_sk_live_<your-key-here>"
      }
    }
  }
}
```

Restart Claude Desktop after saving. `create_link` and `find_link` appear automatically the next
time you start a conversation.

<Warning>
  If `DAVA_API_KEY` is missing, the server exits immediately with an error rather than starting in
  a half-configured state — check your config's `env` block if the tools don't appear.
</Warning>

## Workflow: Dáva first, then Meta

Create the link in Dáva **before** setting up the destination in your ad platform, not after —
the assistant can hand you the finished tracked URL to paste into Meta (or Google, or wherever
the campaign is running), rather than you tracking down the mapping after the fact.

1. Ask the assistant to create the link (it calls `create_link`).
2. Take the `issued_url` it returns.
3. Paste that URL as the destination in your ad platform's campaign setup.

## Example exchange

**You:** "Create a Dáva link for our spring sale campaign, pointing to
`https://yourcompany.com/products`, sourced from Meta paid social."

**Assistant** calls `create_link` with:

```json theme={null}
{
  "link_type_id": "58d8461a-4655-419d-9e2f-634a4fb2a667",
  "campaign": "spring-sale",
  "destination": "https://yourcompany.com/products",
  "source": "meta",
  "medium": "paid-social"
}
```

**Assistant:** "Created it — here's your tracked link: `https://yourdomain.com/ref/spring-sale`.
Use that as the destination URL in your Meta ad."

## Retries are idempotent

If a tool call times out or the assistant retries, it's safe — `create_link` reuses the same
`external_id` mechanism as the HTTP API, so a retry returns the existing link instead of minting a
second one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.