QR Code Skill
Generate and decode QR codes via the remote MCP service at https://qrcode.api4claw.com/mcp.
Capabilities
| Operation | MCP Tool | Description |
|---|
| Generate QR Code | INLINECODE1 | Convert text or URL into a QR code PNG image (base64-encoded) |
| Decode QR Code |
decode_qr_code | Extract text content from a QR code image |
MCP Server Configuration
This skill requires the following MCP server to be configured:
CODEBLOCK0
Procedure
Generate a QR Code
- 1. Confirm the text or URL to encode (max 1000 characters)
- Optionally confirm desired image size (128–1024 pixels, default 512)
- Call the
generate_qr_code MCP tool:
-
text (required): The content to encode
-
size (optional): Image size in pixels
- 4. The tool returns a base64-encoded PNG image
- Present the QR code image to the user using markdown: INLINECODE6
- If the user wants to save it, write the decoded base64 data to a
.png file
Decode a QR Code
- 1. Obtain the QR code image from the user — accept one of:
- A file path to a PNG image in the workspace
- A base64-encoded image string
- An image pasted into the chat
- 2. If a file path is provided, read it and convert to base64
- Call the
decode_qr_code MCP tool:
-
image_base64 (required): Base64-encoded PNG image data
- 4. Return the decoded text to the user
API Reference
See MCP API Reference for detailed tool schemas and examples.
Error Handling
- - If text exceeds 1000 characters, inform the user and ask them to shorten it
- If the image does not contain a recognizable QR code, report the decoding failure clearly
- If the MCP server is unreachable, inform the user to check network connectivity
Examples
Generate:
"Generate a QR code for https://github.com"
"Create a 256px QR code containing my WiFi config: WIFI:T:WPA;S:MyNetwork;P:password123;;"
Decode:
"Decode the QR code in ./assets/ticket.png"
"What does this QR code say?" (with image attached)
QR Code 技能
通过远程 MCP 服务 https://qrcode.api4claw.com/mcp 生成和解码二维码。
能力
| 操作 | MCP 工具 | 描述 |
|---|
| 生成二维码 | generateqrcode | 将文本或 URL 转换为二维码 PNG 图片(base64 编码) |
| 解码二维码 |
decode
qrcode | 从二维码图片中提取文本内容 |
MCP 服务器配置
本技能需要配置以下 MCP 服务器:
json
{
mcpServers: {
qrcode: {
type: http,
url: https://qrcode.api4claw.com/mcp
}
}
}
操作流程
生成二维码
- 1. 确认要编码的文本或 URL(最多 1000 个字符)
- 可选确认所需图片尺寸(128–1024 像素,默认 512)
- 调用 generateqrcode MCP 工具:
- text(必填):要编码的内容
- size(可选):图片尺寸(像素)
- 4. 工具返回 base64 编码的 PNG 图片
- 使用 markdown 向用户展示二维码图片:

- 如果用户想要保存,将解码后的 base64 数据写入 .png 文件
解码二维码
- 1. 从用户处获取二维码图片——接受以下任一方式:
- 工作区中 PNG 图片的文件路径
- base64 编码的图片字符串
- 粘贴到聊天中的图片
- 2. 如果提供了文件路径,读取文件并转换为 base64
- 调用 decodeqrcode MCP 工具:
- image_base64(必填):Base64 编码的 PNG 图片数据
- 4. 将解码后的文本返回给用户
API 参考
详细工具架构和示例请参见 MCP API 参考。
错误处理
- - 如果文本超过 1000 个字符,告知用户并要求缩短内容
- 如果图片不包含可识别的二维码,明确报告解码失败
- 如果 MCP 服务器无法访问,告知用户检查网络连接
示例
生成:
为 https://github.com 生成二维码
创建一个 256px 的二维码,包含我的 WiFi 配置:WIFI:T:WPA;S:MyNetwork;P:password123;;
解码:
解码 ./assets/ticket.png 中的二维码
这个二维码说了什么?(附带图片)