Google OCR MCP server

Extracts text from images using Google Cloud Vision API, enabling automated processing of documents, screenshots, and photographs without manual transcription.
Back to servers
Setup instructions
Provider
Hyogeun Oh
Release date
Apr 10, 2025
Language
Python
Stats
1 star

The Google OCR MCP server provides a seamless integration between Google's Optical Character Recognition capabilities and Claude via the Model Context Protocol. It allows you to extract text from images and manage the resulting content through a simple note storage system.

Installation

Installing with Smithery

The easiest way to install the Google OCR MCP server for Claude Desktop is using Smithery:

npx -y @smithery/cli install @Zerohertz/google-ocr-mcp-server --client claude

Manual Installation

If you prefer to install the server manually:

  1. Install the package using pip:
pip install google-ocr-mcp-server
  1. Configure Claude Desktop to use the server by editing the configuration file:

On MacOS:

~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows:

%APPDATA%/Claude/claude_desktop_config.json
  1. Add the server configuration to the mcpServers section:
{
  "mcpServers": {
    "google-ocr-mcp-server": {
      "command": "uvx",
      "args": ["google-ocr-mcp-server"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/google-application-credentials.json",
        "SAVE_RESULTS": false
      }
    }
  }
}

Note: Replace /path/to/google-application-credentials.json with the actual path to your Google Cloud credentials file.

Setting Up Google Cloud Credentials

Before using the OCR functionality, you need to set up Google Cloud credentials:

  1. Create a Google Cloud project
  2. Enable the Vision API
  3. Create a service account and download the credentials JSON file
  4. Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to this file

Usage

Available Resources

The server implements a note storage system with:

  • Custom note:// URI scheme for accessing individual notes
  • Each note has a name, description, and text/plain mimetype

Working with Prompts

The server provides a single prompt:

  • summarize-notes: Creates summaries of all stored notes
    • Optional "style" argument controls detail level (brief/detailed)
    • Combines all current notes with the style preference

Using Tools

The server implements one tool:

  • add-note: Adds a new note to the server
    • Required arguments:
      • "name": The title for your note
      • "content": The text content of the note
    • The server will update its state and notify clients of resource changes

Example Workflow

  1. Upload an image to Claude
  2. The Google OCR server will process the image
  3. Use the add-note tool to save the extracted text
  4. Access the stored notes using the note:// URI scheme
  5. Generate summaries with the summarize-notes prompt

Troubleshooting

If you encounter issues with the OCR server, consider these common solutions:

  • Verify your Google Cloud credentials are correctly configured
  • Ensure the server is properly registered in Claude Desktop's configuration
  • Check that the Vision API is enabled in your Google Cloud project
  • For better image recognition, use clear images with good contrast

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "google-ocr-mcp-server" '{"command":"uvx","args":["google-ocr-mcp-server"],"env":{"GOOGLE_APPLICATION_CREDENTIALS":"/path/to/google-application-credentials.json","SAVE_RESULTS":false}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "google-ocr-mcp-server": {
            "command": "uvx",
            "args": [
                "google-ocr-mcp-server"
            ],
            "env": {
                "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/google-application-credentials.json",
                "SAVE_RESULTS": false
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "google-ocr-mcp-server": {
            "command": "uvx",
            "args": [
                "google-ocr-mcp-server"
            ],
            "env": {
                "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/google-application-credentials.json",
                "SAVE_RESULTS": false
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later