Short links and QR codes from code, then from Claude via MCP
You can click through a dashboard to shorten a link, or you can do it from a script. This tutorial covers the script route with the Elido SDKs for TypeScript, Python and Go, then the assistant route: an MCP server that lets Claude Desktop or Cursor create links and read stats for you. We ran every snippet below against the live API on a fresh free account, using the published packages (…
To shorten a link, you can either use a dashboard or a script. The tutorial focuses on the script method, utilizing the Elido SDKs for TypeScript, Python, and Go. After running the snippets against the live API on a new free account, the real outputs are displayed. To get started, you'll need a free Elido account and an API key from the dashboard, which begins with "elido_".
Additionally, you'll need a workspace ID, domain ID, and slug for the link. The API base is "https://api.elido.app" and authentication is done via the Authorization header with your API key. The SDKs automatically set this for you. To begin, import the ElidoApi class from the @elido/sdk package and create an instance of the SDK using the baseUrl and token.
Next, list the workspaces using the workspaces.list() method and extract the workspace ID. Then, get the primary domain ID for the workspace using workspaceDomains.primary(). Finally, create a new link by calling the links.create() method with the workspace ID, domain ID, destination URL, optional slug, and tags. The SDK automatically sets an Idempotency-Key header for each POST request.
If you want to retry the request safely in a cron job, pass your own stable key as the idempotencyKey argument. You can also list links filtered by tag using links.list(), iterating through pages with links.iterate(), and retrieving click statistics using analytics.timeseries().
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.