MCP guide

lnk.ec offers a remote Model Context Protocol (MCP) server so an AI assistant can create and manage links for you.

  • URL: https://lnk.ec/api/v1/mcp
  • Transport: Streamable HTTP (JSON response, no sessions)
  • Authentication: the same API key (Authorization: Bearer)

Configuration

Client with remote-server support:

{
  "mcpServers": {
    "lnk": {
      "url": "https://lnk.ec/api/v1/mcp",
      "headers": { "Authorization": "Bearer lk_lnk_..." }
    }
  }
}

stdio-only client (zero-dependency bridge):

{
  "mcpServers": {
    "lnk": {
      "command": "npx",
      "args": ["-y", "@lnk-ec/mcp"],
      "env": { "LNK_API_KEY": "lk_lnk_..." }
    }
  }
}

Tools

ToolScopeDescription
lnk_whoami—account, scopes and limits of the key
lnk_create_linklinks:writecreates a short link
lnk_list_linkslinks:readlists links with pagination
lnk_get_linklinks:readgets one link
lnk_update_linklinks:writechanges title, destination or access
lnk_pause_link / lnk_resume_linklinks:writepauses or re-activates
lnk_delete_linklinks:writedeletes (destructive: ask for confirmation)
lnk_link_analyticsanalytics:readclicks by country, region, city or date
lnk_resolve_urllinks:readresolves the final destination of a URL

tools/list only shows the tools your key's scopes allow. For a read-only assistant, create a key with links:read and analytics:read.

Security

  • Give the agent a key with minimal permissions and a short expiry.
  • Destructive tools are flagged (destructiveHint) so the client asks for confirmation.
  • The key's limits and quota apply exactly as in the REST API.

Try it with curl

curl -s https://lnk.ec/api/v1/mcp \
  -H "Authorization: Bearer $LNK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'