Skip to main content

MCP server for image understanding using Alibaba Cloud's Qwen3-VL-Plus model

Project description

Image MCP Server

A Model Context Protocol (MCP) server for image understanding using Alibaba Cloud's Qwen3-VL-Plus model.

PyPI version Python versions License

🚀 Quick Start

Installation

Option 1: Using uvx (Recommended)

uvx image-mcp-server

Option 2: Using pip

pip install image-mcp-server

Option 3: Using uv

uv pip install image-mcp-server

🔧 MCP Configuration

Claude Desktop Configuration

  1. Locate your Claude Desktop config 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 the MCP server configuration:

{
  "mcpServers": {
    "image-mcp-server": {
      "command": "uvx",
      "args": ["image-mcp-server@latest"],
      "env": {
        "IMAGE_MCP_DASHSCOPE_API_KEY": "your-dashscope-api-key-here"
      }
    }
  }
}

Configuration Notes:

  • Replace your-dashscope-api-key-here with your actual DashScope API key
  • Using @latest ensures you always get the newest version
  • The server will automatically download and run when first used by Claude
  1. Restart Claude Desktop to load the new configuration.

API Key Setup

  1. Visit Alibaba Cloud DashScope Console
  2. Sign up or log in to your account
  3. Navigate to API Keys section
  4. Create a new API key
  5. Copy the key for use in your MCP configuration

🎯 Usage Examples

Once configured, you can use the image analysis capabilities directly in Claude:

Basic Image Analysis

Please analyze this image: [upload image]

Detailed Analysis Request

Describe this image in detail, including the main objects, colors, and overall scene. Also provide confidence scores for your observations.

Technical Analysis

What type of objects are visible in this image? Please provide a list with confidence scores.

URL-based Analysis

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

📋 Features

  • Multi-format Support: JPEG, PNG, GIF, WebP
  • Dual Input Methods: Direct upload or URL-based analysis
  • Confidence Scoring: Provides confidence levels and scores for detected objects
  • Structured Output: JSON-formatted analysis results
  • Environment Configuration: Secure API key management
  • Automatic Updates: Using @latest ensures latest features

🔧 Configuration Options

The server supports various configuration options via environment variables:

Environment Variable Default Description
IMAGE_MCP_DASHSCOPE_API_KEY Required Your DashScope API key
IMAGE_MCP_DASHSCOPE_BASE_URL https://dashscope.aliyuncs.com/compatible-mode/v1 API endpoint URL
IMAGE_MCP_MODEL_NAME qwen3-vl-plus Model to use for analysis
IMAGE_MCP_MAX_IMAGE_SIZE_MB 10 Maximum image size in MB
IMAGE_MCP_REQUEST_TIMEOUT 30 Request timeout in seconds
IMAGE_MCP_MAX_RETRIES 3 Maximum retry attempts
IMAGE_MCP_LOG_LEVEL INFO Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
IMAGE_MCP_ENABLE_DEBUG false Enable debug logging

🛠️ Development

Setup Development Environment

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

# Install in development mode
uv pip install -e .

# Run tests
pytest

# Run tests with coverage
pytest --cov=image_mcp

# Lint code
ruff check .

# Format code
black .
isort .

Build Package

# Build for distribution
python -m build

# Upload to PyPI (requires credentials)
twine upload dist/*

📚 API Documentation

MCP Tools

The server provides the following MCP tools:

analyze_image

Analyzes an image and returns detailed information about its contents.

Parameters:

  • image_data (optional): Base64-encoded image data
  • image_url (optional): URL to an image file
  • prompt (optional): Custom prompt for analysis

Example:

{
  "image_url": "https://example.com/image.jpg",
  "prompt": "Describe what you see in this image"
}

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

🔗 Related Links


Happy image analyzing! 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

image_mcp_server-0.1.3.tar.gz (105.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

image_mcp_server-0.1.3-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file image_mcp_server-0.1.3.tar.gz.

File metadata

  • Download URL: image_mcp_server-0.1.3.tar.gz
  • Upload date:
  • Size: 105.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for image_mcp_server-0.1.3.tar.gz
Algorithm Hash digest
SHA256 88ec86f3b3fd7461bbda8e5aff3aa99df6ca96d29e7ab5986c20838d23fd784e
MD5 0e650b8f0aeacf29c6485f891bc4fc11
BLAKE2b-256 3f0975454c9c307895119fc69f2c54992f85e6de6dd500b616325ab62004e35a

See more details on using hashes here.

File details

Details for the file image_mcp_server-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for image_mcp_server-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 29a6200a0103aa813cbbcf8f58be2af4c555d5b13e39639d57e7a53cd46e0c10
MD5 f0131d34894aecabcb0729262be25ec5
BLAKE2b-256 2924fa62ce56eaeb451d14a34911585bd7046241cac2990c94decc0f1e47f0d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page