Gemini OCR MCP

by WindoC

460 downloads
Not rated
GitHub

About

This project provides a simple yet powerful OCR (Optical Character Recognition) service through a FastMCP server, leveraging the capabilities of the Google Gemini API. It allows you to extract text from images either by providing a file path or a base64 encoded string.

Details

Author
WindoC
Downloads
460
Categories
Cloud Service, AI, Other

- File-based OCR from local images
- Base64 OCR from encoded image strings
- Powered by Google Gemini models for high accuracy
- Simple tool-based interface via FastMCP

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Gemini OCR MCP
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install dependencies with uv sync, and configure the server in your MCP client’s config.json using the provided Windows/macOS/Linux examples. Set the environment variables GEMINI_API_KEY and optionally GEMINI_MODEL, then invoke the tools ocr_image_file (with an image file path) or ocr_image_base64 (with a base64 image string).

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "gemini ocr mcp": {
            "gemini-ocr-mcp": {
                "command": "uv",
                "args": [
                    "--directory",
                    "/path/to/your/project/gemini-ocr-mcp",
                    "run",
                    "gemini-ocr-mcp.py"
                ],
                "env": {
                    "GEMINI_MODEL": "gemini-2.5-flash-preview-05-20",
                    "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY"
                }
            }
        }
    }
}

McpServers

{
    "gemini-ocr-mcp": {
        "command": "uv",
        "args": [
            "--directory",
            "/path/to/your/project/gemini-ocr-mcp",
            "run",
            "gemini-ocr-mcp.py"
        ],
        "env": {
            "GEMINI_MODEL": "gemini-2.5-flash-preview-05-20",
            "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY"
        }
    }
}

This project provides a simple yet powerful OCR (Optical Character Recognition) service through a FastMCP server, leveraging the capabilities of the Google Gemini API. It allows you to extract text from images either by providing a file path or a base64 encoded string.

Extract the text from the following image:

and convert it to plain text, e.g., fbVk

- File-based OCR:Extract text directly from an image file on your local system.
- Base64 OCR:Extract text from a base64 encoded image string.
- Easy to Use:Exposes OCR functionality as simple tools in an MCP server.
- Powered by Gemini:Utilizes Google's advanced Gemini models for high-accuracy text recognition.

- Python 3.8 or higher
- A Google Gemini API Key. You can obtain one fromGoogle AI Studio.

git clone https://github.com/WindoC/gemini-ocr-mcp cd gemini-ocr-mcp

Create and activate a virtual environment:

# Install uv standalone if needed ## On macOS and Linux. curl -LsSf https://astral.sh/uv/install.sh | sh ## On Windows. powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

If you are running this as a server for a parent MCP application, you can configure it in your main MCPconfig.json.

{ "mcpServers": { "gemini-ocr-mcp": { "command": "uv", "args": [ "--directory", "x:\\path\\to\\your\\project\\gemini-ocr-mcp", "run", "gemini-ocr-mcp.py" ], "env": { "GEMINI_MODEL": "gemini-2.5-flash-preview-05-20", "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY" } } } }
{ "mcpServers": { "gemini-ocr-mcp": { "command": "uv", "args": [ "--directory", "/path/to/your/project/gemini-ocr-mcp", "run", "gemini-ocr-mcp.py" ], "env": { "GEMINI_MODEL": "gemini-2.5-flash-preview-05-20", "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY" } } } }

Note:Remember to replace the placeholder paths with the absolute path to your project directory.

- Parameter:image_file(string): The absolute or relative path to the image file.
- Returns:(string) The extracted text from the image.

- Parameter:base64_image(string): The base64 encoded string of the image.
- Returns:(string) The extracted text from the image.

Query ChatGPT, Gemini, Perplexity, Copilot, Grok, Google AI Mode, and Google Search/News from any country as MCP tools.

The DataFast MCP server lets MCP-compatible clients such as Codex, Claude Code, and Cursor query your analytics and manage your account through natural language.

Competitive intelligence platform with 24 tools — monitor competitor pricing, content, positioning, tech stacks, and how ChatGPT, Claude, and Gemini rank your brand.

MCP Server for Gemini Image and Audio generation

Security-hardened NotebookLM MCP with post-quantum encryption, GDPR/SOC2 compliance, and 14 security layers. Query Google's Gemini-grounded research from any MCP-compatible AI assistant.

Connect AI agents to 300+ LLM providers through a single MCP endpoint with built in routing, caching, and observability.

Interact with Google Cloud's Vertex AI Gemini models for coding assistance and general query answering.

Interact with YouTube videos using the Google Gemini Vision API.

Access multiple AI models like Claude, Gemini, and OpenAI through a single server using your own API keys.

Secure audio transcription meets AI. Connect Alice recordings to Claude, ChatGPT, Gemini, and more.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.