MCP Local Image Reader
A simple Model Context Protocol (MCP) server that reads local images and returns them as ImageContent for LLM vision analysis.
Features
- 📷 Read local images and return as base64-encoded
ImageContent - 🔧 Single tool:
read_image- simple and focused - 🚀 One-click installation for VS Code
- 📦 Install via PyPI with
uvx- no environment setup needed
Supported Formats
PNG, JPEG, GIF, WebP, BMP, SVG
Installation
VS Code (Recommended)
Click the button above, or manually add to your VS Code settings:
For a specific version (recommended for security):
{
"mcp": {
"servers": {
"local-image-reader": {
"command": "uvx",
"args": ["mcp-local-image-reader==0.1.1"],
"env": {
"UV_LINK_MODE": "copy"
}
}
}
}
}
For the latest version:
{
"mcp": {
"servers": {
"local-image-reader": {
"command": "uvx",
"args": ["mcp-local-image-reader"],
"env": {
"UV_LINK_MODE": "copy"
}
}
}
}
}
Note: The
UV_LINK_MODE=copyenvironment variable is required on Windows when using OneDrive or other cloud-synced folders.
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"local-image-reader": {
"command": "uvx",
"args": ["mcp-local-image-reader==0.1.1"],
"env": {
"UV_LINK_MODE": "copy"
}
}
}
}
Usage
In your AI assistant, ask it to read an image:
Please read the image at C:\Users\me\Pictures\screenshot.png and describe what you see.
The assistant will use the read_image tool to load the image and analyze it.
Security
Version Pinning
For production use, always pin to a specific version:
"args": ["mcp-local-image-reader==0.1.1"]
This ensures you won't automatically pull potentially malicious updates.
Source Code
This project is intentionally minimal (~100 lines) for easy auditing. The entire implementation is in server.py.
Known Issues
⚠️ Gemini Does Not Recognize Images from MCP
When using VS Code Copilot with Gemini models, images returned via MCP ImageContent are not visually recognized. The tool execution succeeds, but Gemini cannot "see" the image content.
| Model | MCP Image Recognition |
|---|---|
| Claude | ✅ Works |
| GPT | ✅ Works |
| Gemini | ❌ Not working |
Root Cause: This is a known issue with how Gemini handles non-text content types in MCP responses.
Related Issue: gemini-cli #15851 - Only text content type supported
Workaround: Use Claude or GPT models for image analysis tasks until this issue is resolved.
Tool Reference
read_image
Reads an image from the filesystem and returns it as base64-encoded ImageContent.
Parameters:
file_path(string, required): Absolute path to the image file
Returns:
ImageContentwith base64-encoded image data and appropriate MIME type
Example:
{
"name": "read_image",
"arguments": {
"file_path": "/path/to/image.png"
}
}
Development
# Clone the repository
git clone https://github.com/masachika-kamada/mcp-local-image-reader.git
cd mcp-local-image-reader
# Install dependencies
uv sync
# Run locally
uv run python server.py
# Test with MCP Inspector
npx @modelcontextprotocol/inspector uv run python server.py
License
MIT License - see LICENSE for details.
Contributing
Issues and pull requests are welcome! Please feel free to contribute.
Related Projects
- moiri-gamboni/image-reader-mcp - TypeScript implementation with directory listing
- k2sebeom/image-reader-mcp - Python implementation with remote URL support and image resizing
Metadata
Release files for mcp-local-image-reader 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_local_image_reader-0.1.1.tar.gz | 5.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_local_image_reader-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / mcp_local_image_reader-0.1.1.tar.gz
| Download URL | mcp_local_image_reader-0.1.1.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af824b0545950fa35ecf1410fa88926f4db03ca3cccf90cedcbc2ab05ecbb0ba
|
|
BLAKE2b-256 checksum How to use checksums |
d049e3bde389a5b685ad759fb659cb6266621bff1b29bef3c1567073fba6cbdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|
Release files / mcp_local_image_reader-0.1.1-py3-none-any.whl
| Download URL | mcp_local_image_reader-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b6484404978c0b45b45c444fa55d3f793c4508f3c10fb3a10932bba37bb1ed4
|
|
BLAKE2b-256 checksum How to use checksums |
7057d5028b904048e817068e5c7201a59130727dbc50eb1b66cea379400655c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|
Security for mcp-local-image-reader 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.