
一个MCP(Model Context Protocol)服务器(使用FastMCP)来提供列出本地图像文件并读取其内容的工具. 为LLM代理集成而设计.
概览
使用 FastMCP 创建的简单 MCP 服务器,提供工具用于: - 在指定的目录中列出图像文件。 - 读取特定图像文件并返回其内容。 此服务器提供以下工具: * 在指定的目录中列出图像文件。 * *目录Path (字符串):目录扫描图像的绝对路径. * 在目录中找到的图像文件名列表或显示未找到图像的信件。 *.jpg;.jpeg;.png;.gif;.bmp;.webp;.svg. *读取特定图像文件并返回其内容为base64. *文件Path (字符串):要读取的图像文件的绝对路径. * 联合国 包含适合显示的图像内容的对象( 使用 fastmcp 的图像 Content 帮助器) 。 *.jpg;.jpeg;.png;.gif;.bmp;.webp;.svg. 要配置 MCP 客户端,请在 mcpServers 对象上添加图像读取器条目 .
概述(AI 翻译)
使用 FastMCP 创建的简单 MCP 服务器,提供工具用于:
- 在指定的目录中列出图像文件。
- 读取特定图像文件并返回其内容。
□ 工具
此服务器提供以下工具:
list_images
- ** 说明:** 在指定的目录中列出图像文件 。
- ** 参数:**
- [[T1] (字符串): 扫描图像目录的绝对路径 。
- ** 返回:** 在目录中找到的图像文件名列表或显示没有图像的信件被找到 。
- ** 支持的延期:** [[T2]、[T3]、[T4]、[T5]、[T6]、[T7]、[T8]
read_image
- ** 说明:** 读取特定图像文件并返回其内容为 Base64.
- ** 参数:**
- [[T10] (字符串): 要读取的图像文件的绝对路径 。
- ** 返回:** 含有适合显示的图像内容的对象(使用
imageContent从 [[T12] 起的帮助) 。 - ** 支持的扩展:** [[T13] [T14] [T15] [T16] [T17] [T18] [T19]]
QQ 设置
要配置 MCP 客户端,请在 [[T21] 对象上添加imageReader项。 应该是这样的
本页由 AI 翻译,技术细节请以原文为准。
README
Image Reader MCP Server
A simple MCP server built with FastMCP that provides tools to:
- List image files in a specified directory.
- Read a specific image file and return its content.
Tools
This server provides the following tools:
list_images
- Description: List image files in a specified directory.
- Parameters:
directoryPath(string): The absolute path to the directory to scan for images.
- Returns: A list of image filenames found in the directory or a message indicating no images were found.
- Supported Extensions:
.jpg,.jpeg,.png,.gif,.bmp,.webp,.svg
read_image
- Description: Reads a specific image file and returns its content as base64.
- Parameters:
filePath(string): The absolute path to the image file to read.
- Returns: An object containing the image content suitable for display (using
imageContenthelper fromfastmcp). - Supported Extensions:
.jpg,.jpeg,.png,.gif,.bmp,.webp,.svg
Setup
To configure an MCP client, add the imageReader entry to the mcpServers object. It should look something like this:
{
"mcpServers": {
// ... other servers might be here ...
"imageReader": {
"command": "npx",
"args": ["image-reader-mcp"],
"env": {}
}
}
}
Important Note: When using this server with Cursor, it currently seems to function only when Claude Sonnet is selected (other models don’t seem to have vision enabled).
安装
npx image-reader-mcp配置
{
"mcpServers": {
// ... other servers might be here ...
"imageReader": {
"command": "npx",
"args": ["image-reader-mcp"],
"env": {}
}
}
}