---
url: /agents.md
---
# MCP & agents

`dynm.link mcp` runs a Model Context Protocol server on stdio, so an agent (Claude Desktop,
Cursor, Antigravity, …) can manage your links.

## Configuration

Install the [CLI](/cli), then add the server to your agent's MCP config (e.g.
`claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "dynm-link": {
      "command": "dynm.link",
      "args": ["mcp"],
      "env": {
        "DYNM_API_KEY": "dynm_..."
      }
    }
  }
}
```

Without `DYNM_API_KEY` the server uses the key `dynm.link login` stored.

## Tools

| Tool | What it does |
| --- | --- |
| `list_links` | Your links across all folders, newest first (`limit`, default 1000). |
| `get_link` | One link by folder `host` + `slug`. |
| `check_slug` | Whether a slug is free in a folder (`host` + `slug`), and why not. |
| `create_link` | A link of any `type`, with that type's `content`; `host` picks the folder, as the CLI's `--domain` does. |
| `update_link` | Change a link by `id`: only the fields given, `null` clears one. New `content` is the link's own type's, whole. |
| `delete_link` | Delete a link by `id`, with its file and card image. |

`update_link` and `delete_link` take the `id` from `list_links` or `get_link`.

Parameters are the API's own schemas (the shapes are in [Link types](/quickstart#link-types)), so a
wrong shape is refused naming the field. A failed call returns the same `code: message` line the
CLI prints, e.g. `SlugTakenError: alice.dynm.link/launch is taken.`

## Files

The MCP server doesn't upload. A `file` link's `content` takes the `r2Key` of a file already
uploaded with [`POST /v1/uploads`](/quickstart#upload-a-file); to upload a local file and link it in
one step, use `dynm.link link create file`.
