短.在线
Short links + QR tracking URLs for agents. Prefer punycode host. Account required to create links.
我該用這個嗎
品質與安全性
發現項目(2)
- HIGH
- MEDIUM在 shorten_urls 中
根據工具定義與協定合規性的自動化分析。
上下文成本
這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。
安裝
一鍵安裝
將以下內容加入你的 `claude_desktop_config.json` 檔案:
{
"mcpServers": {
"duan-online": {
"url": "https://xn--s7y.xn--3ds443g/mcp"
}
}
}遠端端點
https://xn--s7y.xn--3ds443g/mcpstreamable-http它能做什麼
工具清單
工具(6)
🟡shorten_url(url, alias, title, locale, idempotency_key)
创建一个 HTTP 或 HTTPS 短链。需要已注册账户。返回状态;链接为 active 时返回 Unicode 显示地址和 ASCII 地址。两条及以上请用 shorten_urls。重试同一操作须复用同一个 idempotency_key。 Create one HTTP or HTTPS short link. A registered account is required. Returns the state, and when active, the Unicode display URL and the ASCII URL. For two or more, use shorten_urls. A retry of the same operation must reuse the same idempotency_key.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"description": "Destination HTTPS/HTTP URL to shorten. Required. Do not send longUrl."
},
"alias": {
"description": "Optional custom path segment (stored lowercase). Do not send customSlug.",
"type": "string",
"minLength": 1,
"maxLength": 32
},
"title": {
"description": "Optional link title, at most 256 characters.",
"type": "string",
"maxLength": 256
},
"locale": {
"description": "API language preference. Canonical values: en and zh-CN. Documented aliases normalized to the canonical value: zh-cn, zh-Hans, zh-hans, zh_Hans, zh_hans. Traditional Chinese is not supported. EN, ZH-CN, and bare zh are rejected. Omitted or blank defaults to en. This preference does not rewrite URL bytes, translate parameter names, or use the caller's location. Website routes stay /zh-cn.",
"type": "string"
},
"idempotency_key": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"description": "Client-generated unique key for this create. Required. Replays within 24h."
}
},
"required": [
"url",
"idempotency_key"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"examples": [
{
"url": "https://example.com/notes",
"alias": "notes",
"title": "Notes",
"locale": "en",
"idempotency_key": "example-create-1"
}
]
}輸出結構描述
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"id": {
"type": "string"
},
"state": {
"type": "string",
"const": "active"
},
"short_url": {
"type": "string"
},
"short_url_ascii": {
"type": "string"
},
"destination": {
"type": "string"
},
"qr_tracking_url": {
"type": "string"
},
"qr_url": {
"type": "string"
},
"created_at": {
"type": "string"
},
"status_url": {
"type": "string"
}
},
"required": [
"ok",
"request_id",
"id",
"state",
"short_url",
"short_url_ascii",
"destination",
"qr_tracking_url",
"qr_url",
"created_at",
"status_url"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"id": {
"type": "string"
},
"state": {
"type": "string",
"const": "quarantined"
},
"created_at": {
"type": "string"
},
"status_url": {
"type": "string"
},
"error": {
"type": "string",
"const": "LINK_QUARANTINED"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"request_id",
"id",
"state",
"created_at",
"status_url",
"error",
"message"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": false
},
"request_id": {
"type": "string"
},
"error": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"resend_path": {
"description": "Where to resend the verification email when verification would raise this account's limits.",
"type": "string"
}
},
"required": [
"ok",
"request_id",
"error",
"code",
"message",
"type",
"title",
"retryable"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"replay": {}
},
"required": [
"ok",
"request_id",
"replay"
],
"additionalProperties": false
}
]
}🟡shorten_urls(items, idempotency_key)
一次同步创建 1 到 100 条短链。按 client_ref 对应结果,允许部分成功。需要已注册账户。批量重试只有三种情况,不要混用。示例:key 为 batch-1,两项 client_ref 分别为 notes(https://example.com/notes)和 draft(https://example.com/draft)。notes 成功,draft 的 retryable 为 true。(1) 传输结果不确定(没有拿到已完成的响应、IDEMPOTENCY_IN_PROGRESS、幂等锁不可用,或因瞬时数据库错误且一条都未创建而返回 503):用同一个 key 原样重发整批。已完成的批次返回已保存的结果,notes 不会再次创建。key 已被释放时,同一批会重新执行。(2) 已完成且某项 retryable 为 true:重放 batch-1 只返回已保存的结果,不会重试 draft。只用新 key(例如 batch-1-draft)发送 draft,并保留 client_ref draft,不要带上 notes。去掉 notes 后仍用 batch-1 会返回 IDEMPOTENCY_CONFLICT。(3) 校验错误:改正请求,不要把同一份无效请求当作网络重试。key 尚未保存的 400(重复 client_ref、缺少 items、BATCH_TOO_LARGE)改正后可以继续用同一个 key。已完成且 retryable 为 false 的项已保存;改正文后用原 key 会返回 IDEMPOTENCY_CONFLICT,改正后的项必须用新 key。 Create 1 to 100 short links in one synchronous request. Match each result by client_ref. Partial success is allowed. A registered account is required. Batch retry has three cases; do not mix them. Worked example: key batch-1 with client_ref notes (https://example.com/notes) and draft (https://example.com/draft). notes succeeds and draft is retryable true. (1) Uncertain transport outcome — no completed body, IDEMPOTENCY_IN_PROGRESS, an unavailable idempotency lock, or 503 because a transient database error created nothing: resend the entire unchanged batch with the same key. A completed batch returns the stored result and notes is not created again. A released key runs that same batch again. (2) Completed batch with retryable true: replaying batch-1 returns the stored body and does not retry draft. Send only draft, keeping client_ref draft, under a new key such as batch-1-draft. Do not include notes. Dropping notes and reusing batch-1 returns IDEMPOTENCY_CONFLICT. (3) Validation error: fix the request. Do not resend the same invalid body as a network retry. A 400 before the key is stored (duplicate client_ref, missing items, BATCH_TOO_LARGE) may reuse the key after the body is corrected. A completed item with retryable false is stored; a changed body on that key returns IDEMPOTENCY_CONFLICT, so send the corrected item with a new key.
輸入結構描述
{
"type": "object",
"properties": {
"items": {
"minItems": 1,
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"client_ref": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Batch item correlation id (never use array index)."
},
"url": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"description": "Destination HTTPS/HTTP URL to shorten. Required. Do not send longUrl."
},
"alias": {
"description": "Optional custom path segment (stored lowercase). Do not send customSlug.",
"type": "string",
"minLength": 1,
"maxLength": 32
},
"title": {
"description": "Optional link title, at most 256 characters.",
"type": "string",
"maxLength": 256
},
"locale": {
"description": "API language preference. Canonical values: en and zh-CN. Documented aliases normalized to the canonical value: zh-cn, zh-Hans, zh-hans, zh_Hans, zh_hans. Traditional Chinese is not supported. EN, ZH-CN, and bare zh are rejected. Omitted or blank defaults to en. This preference does not rewrite URL bytes, translate parameter names, or use the caller's location. Website routes stay /zh-cn.",
"type": "string"
}
},
"required": [
"client_ref",
"url"
]
},
"description": "Synchronous batch items (1 to 100). Each item creates one short link."
},
"idempotency_key": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"description": "Client-generated unique key for this create. Required. Replays within 24h."
}
},
"required": [
"items",
"idempotency_key"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"examples": [
{
"items": [
{
"client_ref": "item-1",
"url": "https://example.com/notes",
"alias": "notes",
"title": "Notes",
"locale": "zh-cn"
}
],
"idempotency_key": "example-batch-1"
}
]
}輸出結構描述
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"batch_id": {
"type": "string"
},
"batch_mode": {
"type": "string",
"const": "sync"
},
"ok_count": {
"type": "number"
},
"fail_count": {
"type": "number"
},
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"client_ref": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"result": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"retryable": {
"type": "boolean"
},
"problem": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"client_ref",
"ok"
],
"additionalProperties": false
}
}
},
"required": [
"ok",
"request_id",
"batch_id",
"batch_mode",
"ok_count",
"fail_count",
"results"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": false
},
"request_id": {
"type": "string"
},
"error": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"resend_path": {
"description": "Where to resend the verification email when verification would raise this account's limits.",
"type": "string"
}
},
"required": [
"ok",
"request_id",
"error",
"code",
"message",
"type",
"title",
"retryable"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
}
},
"required": [
"ok",
"request_id"
],
"additionalProperties": false
}
]
}🟢get_link(id)
按 id 查询一条链接,仅限已登录账户自己的链接。需要已注册账户。公开状态请用 resolve_short_url。 Fetch one link by id, only a link owned by the signed-in account. A registered account is required. For a public status check, use resolve_short_url.
輸入結構描述
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Short code / link id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"examples": [
{
"id": "example"
}
]
}輸出結構描述
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"id": {
"type": "string"
},
"state": {
"type": "string",
"const": "active"
},
"created_at": {
"type": "string"
},
"status_url": {
"type": "string"
},
"short_url": {
"type": "string"
},
"short_url_ascii": {
"type": "string"
},
"destination": {
"type": "string"
}
},
"required": [
"ok",
"request_id",
"id",
"state",
"created_at",
"status_url",
"short_url",
"short_url_ascii",
"destination"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"id": {
"type": "string"
},
"state": {
"type": "string",
"enum": [
"quarantined",
"disabled",
"blocked",
"expired"
]
},
"created_at": {
"type": "string"
},
"status_url": {
"type": "string"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"code": {
"type": "string"
},
"expired_at": {
"type": "string"
}
},
"required": [
"ok",
"request_id",
"id",
"state",
"created_at",
"status_url",
"type",
"title",
"code"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": false
},
"request_id": {
"type": "string"
},
"error": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"retryable": {
"type": "boolean"
}
},
"required": [
"ok",
"request_id",
"error",
"code",
"message",
"type",
"title",
"retryable"
],
"additionalProperties": false
}
]
}🟢resolve_short_url(url, code)
查询本站短码或本站短链的已保存状态;仅 active 时返回目标地址。无需账户。不查询其他短链服务;查询结果不是安全检测结论。 Look up a 短.在线 code or short URL and return its saved state. The destination is returned only when active. No account required. Does not look up other shorteners. The result is not a security verdict.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"description": "Full short URL (Unicode or punycode). Mutually exclusive with code."
},
"code": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Short code. Mutually exclusive with url."
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": {},
"examples": [
{
"url": "https://xn--s7y.xn--3ds443g/example"
},
{
"code": "example"
}
]
}輸出結構描述
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"id": {
"type": "string"
},
"state": {
"type": "string",
"const": "active"
},
"created_at": {
"type": "string"
},
"status_url": {
"type": "string"
},
"short_url": {
"type": "string"
},
"short_url_ascii": {
"type": "string"
},
"destination": {
"type": "string"
}
},
"required": [
"ok",
"request_id",
"id",
"state",
"created_at",
"status_url",
"short_url",
"short_url_ascii",
"destination"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"id": {
"type": "string"
},
"state": {
"type": "string",
"enum": [
"quarantined",
"disabled",
"blocked",
"expired"
]
},
"created_at": {
"type": "string"
},
"status_url": {
"type": "string"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"code": {
"type": "string"
},
"expired_at": {
"type": "string"
}
},
"required": [
"ok",
"request_id",
"id",
"state",
"created_at",
"status_url",
"type",
"title",
"code"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": false
},
"request_id": {
"type": "string"
},
"error": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"retryable": {
"type": "boolean"
}
},
"required": [
"ok",
"request_id",
"error",
"code",
"message",
"type",
"title",
"retryable"
],
"additionalProperties": false
}
]
}🟡create_qr(id, short_url, format, size)
为已有短链返回可扫描的二维码图片,默认 PNG 512×512;需要时也可返回 SVG。矩阵编码带 ?s=qr 的追踪短链(ASCII 主机名),与 GET /v1/links/{id}/qr 相同。需要已注册账户,且必须是该链接的所有者。不新建短链,也不抓取目标地址。format 可为 png 或 svg;PNG 边长仅 256、512、1024,SVG 忽略边长。一并返回 qr_tracking_url、MIME 类型与像素边长。 Return a scannable QR image for an existing short link. Default is PNG 512×512; SVG when format is svg. The matrix encodes the tracking URL with ?s=qr (ASCII host), the same payload as GET /v1/links/{id}/qr. A registered account that owns the link is required. Does not create a link and does not fetch the destination. format is png or svg. PNG size is 256, 512, or 1024. SVG ignores size. Also returns qr_tracking_url, MIME type, and pixel size.
輸入結構描述
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Existing short code. Mutually exclusive with short_url."
},
"short_url": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"description": "Existing short URL to tag for QR. Mutually exclusive with id."
},
"format": {
"description": "Image format. Default png. svg only when requested. SVG ignores size.",
"type": "string",
"enum": [
"png",
"svg"
]
},
"size": {
"description": "PNG square pixels. Default 512. Allowed: 256, 512, or 1024. Ignored when format is svg.",
"anyOf": [
{
"type": "number",
"const": 256
},
{
"type": "number",
"const": 512
},
{
"type": "number",
"const": 1024
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"examples": [
{
"id": "example"
},
{
"short_url": "https://xn--s7y.xn--3ds443g/example"
},
{
"id": "example",
"format": "png",
"size": 512
}
]
}輸出結構描述
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"id": {
"type": "string"
},
"state": {
"type": "string",
"const": "active"
},
"short_url": {
"type": "string"
},
"short_url_ascii": {
"type": "string"
},
"qr_tracking_url": {
"type": "string",
"description": "ASCII tracking URL encoded in the image, including ?s=qr."
},
"status_url": {
"type": "string"
},
"mime_type": {
"type": "string",
"enum": [
"image/png",
"image/svg+xml"
],
"description": "image/png or image/svg+xml."
},
"pixel_size": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "PNG square pixels. Null for SVG."
},
"image_available": {
"type": "boolean",
"const": true
}
},
"required": [
"ok",
"request_id",
"id",
"state",
"short_url",
"short_url_ascii",
"qr_tracking_url",
"status_url",
"mime_type",
"pixel_size",
"image_available"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": false
},
"request_id": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"code": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"error": {
"type": "string"
},
"id": {
"type": "string"
},
"state": {
"type": "string",
"enum": [
"quarantined",
"disabled",
"blocked",
"expired"
]
},
"image_available": {
"type": "boolean",
"const": false
}
},
"required": [
"ok",
"request_id",
"message",
"type",
"title",
"code",
"retryable"
],
"additionalProperties": false
}
]
}🟡begin_registration(locale)
客户端无法启动 OAuth 时的后备入口。返回浏览器注册链接。本工具不创建账户,不接收密码,也不代用户同意条款。 Fallback when the client cannot start OAuth. Returns a browser registration link. This tool does not create an account, accept a password, or accept terms for the user.
輸入結構描述
{
"type": "object",
"properties": {
"locale": {
"description": "Browser signup page language. Does not accept email, password, or acceptance. API language preference. Canonical values: en and zh-CN. Documented aliases normalized to the canonical value: zh-cn, zh-Hans, zh-hans, zh_Hans, zh_hans. Traditional Chinese is not supported. EN, ZH-CN, and bare zh are rejected. Omitted or blank defaults to en. This preference does not rewrite URL bytes, translate parameter names, or use the caller's location. Website routes stay /zh-cn.",
"type": "string",
"enum": [
"en",
"zh-CN",
"zh-cn",
"zh-Hans",
"zh-hans",
"zh_Hans",
"zh_hans"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"examples": [
{
"locale": "en"
},
{
"locale": "zh-CN"
}
]
}輸出結構描述
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"request_id": {
"type": "string"
},
"signup_url": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"resume_token": {
"type": "string"
}
},
"required": [
"ok",
"request_id",
"signup_url",
"expires_at",
"resume_token"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": false
},
"request_id": {
"type": "string"
},
"error": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"retryable": {
"type": "boolean"
}
},
"required": [
"ok",
"request_id",
"error",
"code",
"message",
"type",
"title",
"retryable"
],
"additionalProperties": false
}
]
}建議的提示詞
get_linkget_link社群
證據