Image Analysis (GPT-4 Vision)

by champierre

6 stars
265 downloads
Not rated
GitHub

About

Enables image analysis using GPT-4-turbo's vision capabilities for extracting information, generating descriptions, and answering questions about visual content

Details

Author
champierre
Repository
champierre/image-mcp-server
GitHub stars
6
Downloads
265
License
MIT License
Categories
Cloud Service, AI, Other, Productivity, Developer Tools, Design, Media, API, Frontend, Project Management, Knowledge Base

- Receives image URLs or local file paths as input and provides detailed analysis of the image content
- High-precision image recognition and description using the GPT-4o-mini model
- Image URL validity checking
- Image loading from local files and Base64 encoding

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 Image Analysis (GPT-4 Vision)
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 /path/to/image-mcp-server/dist/index.js
    Environment
    • OPENAI_API_KEY your_openai_api_key

    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

Once the MCP server is configured, the following tools become available:

- analyze_image: Receives an image URL and analyzes its content.
- analyze_image_from_path: Receives a local file path and analyzes its content.

To install Image Analysis Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @champierre/image-mcp-server --client claude

npm install

To use with tools like Cline, add the following settings to your MCP server configuration file:

Analyzing from URL:


Please analyze this image URL: https://example.com/image.jpg

Analyzing from local file path:


Please analyze this image: /path/to/your/image.jpg
```

analyze_image

Receives an image URL and analyzes its content.

analyze_image_from_path

Receives a local file path and analyzes its content.

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "image analysis (gpt-4 vision)": {
            "env": {
                "OPENAI_API_KEY": "your_openai_api_key"
            },
            "args": [
                "/path/to/image-mcp-server/dist/index.js"
            ],
            "command": "node"
        }
    }
}

Linux

{
    "env": {
        "OPENAI_API_KEY": "your_openai_api_key"
    },
    "args": [
        "/path/to/image-mcp-server/dist/index.js"
    ],
    "command": "node"
}

Macos

{
    "env": {
        "OPENAI_API_KEY": "your_openai_api_key"
    },
    "args": [
        "/path/to/image-mcp-server/dist/index.js"
    ],
    "command": "node"
}

Windows

{
    "env": {
        "OPENAI_API_KEY": "your_openai_api_key"
    },
    "args": [
        "/path/to/image-mcp-server/dist/index.js"
    ],
    "command": "node"
}

image-mcp-server

日本語の README

<a href="https://glama.ai/mcp/servers/@champierre/image-mcp-server">
Image Analysis MCP Server
</a>

smithery badge
An MCP server that receives image URLs or local file paths and analyzes image content using the GPT-4o-mini model.

Features

- Receives image URLs or local file paths as input and provides detailed analysis of the image content
- High-precision image recognition and description using the GPT-4o-mini model
- Image URL validity checking
- Image loading from local files and Base64 encoding

Installation

Installing via Smithery

To install Image Analysis Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @champierre/image-mcp-server --client claude

Manual Installation

# Clone the repository
git clone https://github.com/champierre/image-mcp-server.git # or your forked repository
cd image-mcp-server

Install dependencies

npm install

Compile TypeScript

npm run build

Configuration

To use this server, you need an OpenAI API key. Set the following environment variable:

OPENAI_API_KEY=your_openai_api_key

MCP Server Configuration

To use with tools like Cline, add the following settings to your MCP server configuration file:

For Cline

Add the following to cline_mcp_settings.json:

{
  "mcpServers": {
    "image-analysis": {
      "command": "node",
      "args": ["/path/to/image-mcp-server/dist/index.js"],
      "env": {
        "OPENAI_API_KEY": "your_openai_api_key"
      }
    }
  }
}

For Claude Desktop App

Add the following to claude_desktop_config.json:

{
  "mcpServers": {
    "image-analysis": {
      "command": "node",
      "args": ["/path/to/image-mcp-server/dist/index.js"],
      "env": {
        "OPENAI_API_KEY": "your_openai_api_key"
      }
    }
  }
}

Usage

Once the MCP server is configured, the following tools become available:

- analyze_image: Receives an image URL and analyzes its content.
- analyze_image_from_path: Receives a local file path and analyzes its content.

Usage Examples

Analyzing from URL:

Please analyze this image URL: https://example.com/image.jpg

Analyzing from local file path:

Please analyze this image: /path/to/your/image.jpg

Note: Specifying Local File Paths

When using the analyze_image_from_path tool, the AI assistant (client) must specify a valid file path in the environment where this server is running.

- If the server is running on WSL:
- If the AI assistant has a Windows path (e.g., C:\...), it needs to convert it to a WSL path (e.g., /mnt/c/...) before passing it to the tool.
- If the AI assistant has a WSL path, it can pass it as is.
- If the server is running on Windows:
- If the AI assistant has a WSL path (e.g., /home/user/...), it needs to convert it to a UNC path (e.g., \\wsl$\Distro\...) before passing it to the tool.
- If the AI assistant has a Windows path, it can pass it as is.

Path conversion is the responsibility of the AI assistant (or its execution environment). The server will try to interpret the received path as is.

Note: Type Errors During Build

When running npm run build, you may see an error (TS7016) about missing TypeScript type definitions for the mime-types module.

src/index.ts:16:23 - error TS7016: Could not find a declaration file for module 'mime-types'. ...

This is a type checking error, and since the JavaScript compilation itself succeeds, it does not affect the server's execution. If you want to resolve this error, install the type definition file as a development dependency.

npm install --save-dev @types/mime-types

or

yarn add --dev @types/mime-types

Development

# Run in development mode
npm run dev

License

MIT

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.