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
| Tool | Scope | Description |
|---|---|---|
lnk_whoami | — | account, scopes and limits of the key |
lnk_create_link | links:write | creates a short link |
lnk_list_links | links:read | lists links with pagination |
lnk_get_link | links:read | gets one link |
lnk_update_link | links:write | changes title, destination or access |
lnk_pause_link / lnk_resume_link | links:write | pauses or re-activates |
lnk_delete_link | links:write | deletes (destructive: ask for confirmation) |
lnk_link_analytics | analytics:read | clicks by country, region, city or date |
lnk_resolve_url | links:read | resolves 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"}'