### Install MCP OpenVision Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/QUICKSTART.md Installs the mcp-openvision package globally using pip, allowing the 'uvx' command to be used in mcp.json configurations. ```bash pip install mcp-openvision ``` -------------------------------- ### MCP OpenVision Configuration (mcp.json) Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/QUICKSTART.md Example configuration for MCP OpenVision within the mcp.json file. It specifies the command to run and environment variables, including the essential OpenRouter API key and an optional default model. ```json { "mcpServers": { "openvision": { "command": "uvx", "args": ["mcp-openvision"], "env": { "OPENROUTER_API_KEY": "your_openrouter_api_key_here", "OPENROUTER_DEFAULT_MODEL": "qwen/qwen2.5-vl-32b-instruct:free" } } } } ``` -------------------------------- ### Development Environment Setup Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Provides commands for cloning the repository, navigating into the project directory, and installing development dependencies. ```bash # Clone the repository git clone https://github.com/modelcontextprotocol/mcp-openvision.git cd mcp-openvision # Install development dependencies pip install -e ".[dev]" ``` -------------------------------- ### Local MCP OpenVision Server Configuration Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/MCP_CONFIG.md Provides an advanced configuration example for running the MCP OpenVision server from a local Python installation. This setup uses 'python' as the command and specifies the module path '-m mcp_openvision.server'. ```json { "mcpServers": { "openvision-local": { "command": "python", "args": ["-m", "mcp_openvision.server"], "env": { "OPENROUTER_API_KEY": "your_openrouter_api_key_here", "OPENROUTER_DEFAULT_MODEL": "qwen/qwen2.5-vl-32b-instruct:free" } } } } ``` -------------------------------- ### Run Basic Usage Example Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/examples/README.md Executes the `basic_usage.py` script, which demonstrates the fundamental functionalities of the MCP OpenVision server. Ensure all setup steps, including API key configuration, are completed before running. ```python python basic_usage.py ``` -------------------------------- ### Install MCP OpenVision Package Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/examples/README.md Installs the MCP OpenVision package in editable mode. This command is typically run from the project's root directory after cloning the repository. ```shell pip install -e .. ``` -------------------------------- ### Multiple MCP Servers Configuration Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/MCP_CONFIG.md Shows how to configure multiple MCP servers simultaneously within a single mcp.json file. This example includes configurations for 'openvision', 'git', and 'filesystem' servers, demonstrating concurrent setup. ```json { "mcpServers": { "openvision": { "command": "uvx", "args": ["mcp-openvision"], "env": { "OPENROUTER_API_KEY": "your_openrouter_api_key_here" } }, "git": { "command": "uvx", "args": ["mcp-server-git"] }, "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory" ] } } } ``` -------------------------------- ### Install MCP OpenVision via Smithery Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Installs the mcp-openvision package for Claude Desktop automatically using the Smithery CLI. ```bash npx -y @smithery/cli install @Nazruden/mcp-openvision --client claude ``` -------------------------------- ### MCP Configuration for Claude Desktop Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Example configuration for integrating MCP OpenVision with Claude Desktop by specifying server command, arguments, and environment variables like API keys. ```json { "mcpServers": { "openvision": { "command": "uvx", "args": ["mcp-openvision"], "env": { "OPENROUTER_API_KEY": "your_openrouter_api_key_here", "OPENROUTER_DEFAULT_MODEL": "anthropic/claude-3-sonnet" } } } } ``` -------------------------------- ### Install MCP OpenVision via UV Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Installs the mcp-openvision package using the UV package installer. ```bash uv pip install mcp-openvision ``` -------------------------------- ### Set OpenRouter API Key Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/examples/README.md Sets the OpenRouter API key as an environment variable. This is a prerequisite for running the example scripts that interact with the OpenVision server. ```shell export OPENROUTER_API_KEY="your_key_here" ``` -------------------------------- ### Install MCP OpenVision via pip Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Installs the mcp-openvision package using pip. ```python pip install mcp-openvision ``` -------------------------------- ### Basic MCP OpenVision Configuration Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/MCP_CONFIG.md Demonstrates the standard JSON format for configuring the 'openvision' MCP server using the 'uvx' command. It includes essential parameters like the command, arguments, and environment variables such as OPENROUTER_API_KEY and OPENROUTER_DEFAULT_MODEL. ```json { "mcpServers": { "openvision": { "command": "uvx", "args": ["mcp-openvision"], "env": { "OPENROUTER_API_KEY": "your_openrouter_api_key_here", "OPENROUTER_DEFAULT_MODEL": "qwen/qwen2.5-vl-32b-instruct:free" } } } } ``` -------------------------------- ### Enabling/Disabling MCP OpenVision Server Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/MCP_CONFIG.md Illustrates how to use the 'enabled' boolean flag within the mcp.json configuration to toggle the 'openvision' server's active status without removing its settings. Setting 'enabled' to false disables the server. ```json { "mcpServers": { "openvision": { "enabled": true, "command": "uvx", "args": ["mcp-openvision"], "env": { "OPENROUTER_API_KEY": "your_openrouter_api_key_here", "OPENROUTER_DEFAULT_MODEL": "qwen/qwen2.5-vl-32b-instruct:free" } } } } ``` -------------------------------- ### Image Analysis Tool Usage Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Demonstrates how to use the `image_analysis` tool with various inputs like URLs, local files, and base64 data. It also shows how to customize analysis with a system prompt. ```python # Analyze an image from a URL result = await image_analysis( image="https://example.com/image.jpg", query="Describe this image in detail" ) # Analyze an image from a local file with a focused query result = await image_analysis( image="path/to/local/image.jpg", query="Identify all traffic signs in this street scene and explain their meanings for a driver education course" ) # Analyze with a base64-encoded image and a specific analytical purpose result = await image_analysis( image="SGVsbG8gV29ybGQ=...", # base64 data query="Examine this product packaging design and highlight elements that could be improved for better visibility and brand recognition" ) # Customize the system prompt for specialized analysis result = await image_analysis( image="path/to/local/image.jpg", query="Analyze the composition and artistic techniques used in this painting, focusing on how they create emotional impact", system_prompt="You are an expert art historian with deep knowledge of painting techniques and art movements. Focus on formal analysis of composition, color, brushwork, and stylistic elements." ) ``` -------------------------------- ### Code Formatting with Black Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Shows how to use the Black code formatter locally to format Python code within specified directories. ```bash # Format all Python code in the src and tests directories black src tests ``` -------------------------------- ### Test MCP OpenVision with Inspector Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Tests the MCP OpenVision server using the MCP Inspector tool, launching it with the 'uvx' command. ```bash npx @modelcontextprotocol/inspector uvx mcp-openvision ``` -------------------------------- ### Image Analysis with Relative Paths Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Illustrates how to use relative file paths for image analysis, either relative to the current working directory or by specifying a `project_root`. ```python # Example with relative path and project_root result = await image_analysis( image="examples/image.jpg", project_root="/path/to/your/project", query="What is in this image?" ) ``` -------------------------------- ### Run MCP OpenVision Locally Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Sets the required OpenRouter API key environment variable and runs the mcp-openvision server module directly using Python. ```bash # Set the required API key export OPENROUTER_API_KEY="your_api_key" # Run the server module directly python -m mcp_openvision ``` -------------------------------- ### Running Tests Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Command to execute the project's tests using the pytest framework. ```bash pytest ``` -------------------------------- ### Bump Project Version Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md A Python script to update the project's version in `pyproject.toml` according to Semantic Versioning principles. It accepts 'major', 'minor', or 'patch' as arguments to specify the type of version increment. ```bash python scripts/bump_version.py [major|minor|patch] ``` -------------------------------- ### MCP OpenVision image_analysis Function Source: https://github.com/mikeysrecipes/mcp-openvision/blob/main/README.md Details the `image_analysis` function provided by MCP OpenVision for analyzing images using OpenRouter vision models. It supports various image input formats and analysis parameters. ```apidoc image_analysis(image: str | bytes, query: str, system_prompt: str = None, model: str = None, temperature: float = None, max_tokens: int = None) Analyze images with vision models. Parameters: image: The image data. Can be a Base64-encoded string, an HTTP/HTTPS URL, or a local file path. query: User instruction for the image analysis task. system_prompt: Optional. Instructions that define the model's role and behavior. model: Optional. The specific vision model to use. Defaults to OPENROUTER_DEFAULT_MODEL environment variable. temperature: Optional. Controls randomness in the model's response (range 0.0-1.0). max_tokens: Optional. Maximum length of the model's response. Returns: The analysis result from the vision model. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.