Skip to main content

MCP OCR Server

A Model Context Protocol (MCP) server that provides OCR (Optical Character Recognition) capabilities for images and videos using GLM-4.1V-Thinking-Flash.

Features

  • Image OCR: Extract text from images using GLM-4.1V-Thinking-Flash
  • Video OCR: Extract text from video frames (planned feature)
  • Custom Prompts: Support for custom OCR prompts
  • MCP Integration: Full MCP protocol support for seamless integration

Requirements

  • Python 3.10+
  • GLM-4.1V-Thinking-Flash API key from ZhipuAI

Quick Start with uvx

The fastest way to get started is using uvx:

# Install and run directly
uvx mcp-server-ocr

# Or install for development
uvx --python 3.10 --with-editable . mcp-server-ocr

Installation

Using uv (recommended)

# Clone the repository
git clone <repository-url>
cd ocr

# Install dependencies
uv sync

# Run the server
uv run mcp-server-ocr

Using pip

# Clone the repository
git clone <repository-url>
cd ocr

# Install dependencies
pip install -e .

# Run the server
mcp-server-ocr

Configuration

Set your GLM-4.1V-Thinking-Flash API key as an environment variable:

export ZHIPU_API_KEY="your-api-key-here"

Usage

Available Tools

  1. ocr_image: Perform OCR on image files

    • image_path: Path to the image file
    • prompt: Custom prompt for OCR processing (optional)
  2. ocr_video: Perform OCR on video frames (coming soon)

    • video_path: Path to the video file
    • prompt: Custom prompt for video OCR processing (optional)
    • frame_interval: Extract frames every N seconds (optional)

Available Prompts

  1. ocr_image: Extract text from an image
  2. ocr_video: Extract text from video frames

Build and Publish

Build the package

# Using uv
uv build

# Using pip
python -m build

Publish to PyPI

# Using uv
uv publish

# Using twine
twine upload dist/*

Development

Setup development environment

# Clone and setup
git checkout -b feature/your-feature
uv sync --dev

# Run linting and type checking
uv run ruff check .
uv run pyright .

Testing

# Run tests (when available)
uv run pytest

# Test the server manually
uv run python -m mcp_server_ocr

API Documentation

MCP Protocol

This server implements the Model Context Protocol (MCP) specification:

License

MIT License

Metadata

Release files for mcp-server-ocr 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-server-ocr 0.1.0
File Size Uploaded Provenance
mcp_server_ocr-0.1.0.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-server-ocr 0.1.0
File Interpreter ABI Platform
mcp_server_ocr-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / mcp_server_ocr-0.1.0.tar.gz

Download URL mcp_server_ocr-0.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
22fc18d4dbbf4a627c27a709a5c2c77ba34dd5a9b02671e773b92c9ca71b4f34
BLAKE2b-256 checksum
How to use checksums
976cee8e02ed64f620fcfeaae2e63818aa76ab48aab7e8f7f5099087096d2ef3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Release files / mcp_server_ocr-0.1.0-py3-none-any.whl

Download URL mcp_server_ocr-0.1.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f75416dfdca3ae7fb9d1bef017d3e9eb91c9e979cf356f32237f7450ce5e6be
BLAKE2b-256 checksum
How to use checksums
c6fb0e0660fc469254cc6f8a28ca1ae691339711167a0241a74e02479f7c2f71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Security for mcp-server-ocr 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page