mcp-scan-qr
An MCP server that provides tools for scanning and extracting data from QR codes using single or multiple image URLs. It supports both individual and batch processing to retrieve encoded information from images hosted online.
README
mcp-scan-qr
这是一个基于 FastMCP 框架构建的 MCP (Model Context Protocol) 工具包,用于从图像中扫描二维码。
功能
当前实现了以下二维码扫描工具:
scanQRCode: 从单个图片URL扫描二维码scanQRCodeBatch: 从多个图片URL批量扫描二维码
安装依赖
bun install
运行项目
bun run dev
调试项目
bun run inspect
构建项目
bun run build
部署 MCP
{
"mcpServers": {
"mcp-scan-qr": {
"args": ["-y","@pidanmoe/mcp-scan-qr"],
"command": "npx",
"env": {
// 环境变量
}
}
}
}
项目结构
- [src/index.ts](file:///Volumes/SSD/_work/mcp-template/mcp-scan-qr/src/index.ts): 主入口文件,初始化并启动 FastMCP 服务器
- [src/tools/scanQRCode.ts](file:///Volumes/SSD/_work/mcp-template/mcp-scan-qr/src/tools/scanQRCode.ts): 实现了
scanQRCode工具,支持从单个图片URL扫描二维码 - [src/tools/scanQRCodeBatch.ts](file:///Volumes/SSD/_work/mcp-template/mcp-scan-qr/src/tools/scanQRCodeBatch.ts): 实现了
scanQRCodeBatch工具,支持从多个图片URL批量扫描二维码 - [src/utils/logger.ts](file:///Volumes/SSD/_work/mcp-template/mcp-scan-qr/src/utils/logger.ts): 日志工具模块
使用说明
该工具包提供了两个MCP工具:
scanQRCode
从单个HTTPS图片URL扫描二维码:
{
"name": "scanQRCode",
"arguments": {
"imageUrl": "https://example.com/qrcode.png"
}
}
scanQRCodeBatch
从多个HTTPS图片URL批量扫描二维码(最多10个):
{
"name": "scanQRCodeBatch",
"arguments": {
"imageUrls": [
"https://example.com/qrcode1.png",
"https://example.com/qrcode2.png"
]
}
}
两个工具都会返回包含扫描结果的JSON字符串。成功时返回二维码内容,失败时返回错误信息。
技术栈
- Bun - JavaScript/TypeScript 运行时
- FastMCP - MCP 框架
- Zod - TypeScript-first schema declaration and validation library
- jsQR - JavaScript QR code reader
- Sharp - High performance Node.js image processing
- Axios - Promise based HTTP client
此项目使用 bun v1.2.19 创建。Bun 是一个快速的一体化 JavaScript 运行时。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.