card-ocr-fastmcp
v1.0.0
Published
A FastMCP tool for OCR recognition of ID cards and vehicle licenses using DashScope API
Maintainers
Readme
card-ocr-fastmcp
A FastMCP tool for OCR recognition of ID cards and vehicle licenses using DashScope API.
Features
- Supports OCR recognition for multiple document types:
- ID Card (id_card)
- Vehicle License Front (vehicle_license_front)
- Vehicle License Back (vehicle_license_back)
- Electronic Vehicle License (vehicle_license_electron)
- Uses DashScope Qwen-VL model for accurate OCR
- Flexible API key configuration (parameter or environment variable)
Installation
npm install card-ocr-fastmcpUsage
Direct Usage
npx card-ocr-fastmcpAs a Module
import { server } from 'card-ocr-fastmcp';
// Use the server in your own FastMCP application
server.start({
transportType: "stdio",
});Configuration
The package includes an mcpServers.config.js file that can be used to integrate this tool into other agent applications.
Tool Parameters
image_url(string, required): URL of the document image to analyzecard_type(string, required): Type of document to recognize. Supported values:id_card: ID cardvehicle_license_front: Vehicle license frontvehicle_license_back: Vehicle license backvehicle_license_electron: Electronic vehicle license
api_key(string, optional): DashScope API key. If not provided, the tool will use theDASHSCOPE_API_KEYenvironment variable.
Environment Variables
DASHSCOPE_API_KEY: Your DashScope API key (alternative to passing it as a parameter)
Example Usage
{
"image_url": "https://example.com/id_card.jpg",
"card_type": "id_card",
"api_key": "your-dashscope-api-key"
}Or using environment variable:
export DASHSCOPE_API_KEY=your-dashscope-api-key{
"image_url": "https://example.com/id_card.jpg",
"card_type": "id_card"
}License
MIT
