A FastMCP tool for OCR recognition of ID cards and vehicle licenses using DashScope API
npm install card-ocr-fastmcpbash
npm install card-ocr-fastmcp
`
Usage
$3
`bash
npx card-ocr-fastmcp
`
$3
`javascript
import { server } from 'card-ocr-fastmcp';
// Use the server in your own FastMCP application
server.start({
transportType: "stdio",
});
`
$3
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 analyze
- card_type (string, required): Type of document to recognize. Supported values:
- id_card: ID card
- vehicle_license_front: Vehicle license front
- vehicle_license_back: Vehicle license back
- vehicle_license_electron: Electronic vehicle license
- api_key (string, optional): DashScope API key. If not provided, the tool will use the DASHSCOPE_API_KEY environment variable.
Environment Variables
- DASHSCOPE_API_KEY: Your DashScope API key (alternative to passing it as a parameter)
Example Usage
`json
{
"image_url": "https://example.com/id_card.jpg",
"card_type": "id_card",
"api_key": "your-dashscope-api-key"
}
`
Or using environment variable:
`bash
export DASHSCOPE_API_KEY=your-dashscope-api-key
`
`json
{
"image_url": "https://example.com/id_card.jpg",
"card_type": "id_card"
}
``