Picgo MCP
picgo mcp, 调用本地picgo,上传照片并返回url
Ask AI about Picgo MCP
Powered by Claude · Grounded in docs
I know everything about Picgo MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
PicGo MCP Server
A Model Context Protocol (MCP) server for PicGo image upload functionality. This MCP allows you to upload images through PicGo and get their URLs directly from your opencode environment.
Features
- 📤 Upload single images using PicGo
- 📦 Upload multiple images in batch
- ⚙️ View current PicGo configuration
- 🔧 Configurable PicGo executable path
Prerequisites
- Node.js (v16 or higher)
- PicGo installed and configured
- opencode with MCP support
Installation
- Clone or download this repository:
git clone <repository-url>
cd picgo-mcp
- Run the installation script:
./install.sh
Or manually:
npm install
npm run build
- Configure PicGo if you haven't already:
# Install an uploader (example: qiniu)
picgo install qiniu
# Configure your uploader
picgo config set uploader qiniu
Configuration
The MCP server will look for PicGo executable in this order:
~/.picgo-mcp.json(custom configuration)- Common locations (
/usr/local/bin/picgo,/usr/bin/picgo, etc.) - System PATH
Custom Configuration
Create or edit ~/.picgo-mcp.json:
{
"executablePath": "/path/to/your/picgo"
}
The installation script creates a default config file that you can modify.
Usage with opencode
Add this MCP to your opencode configuration:
{
"mcpServers": {
"picgo": {
"command": "/path/to/picgo-mcp/dist/index.js"
}
}
}
Available Tools
upload_image
Upload a single image file.
Parameters:
image_path(string, required): Path to the image file to upload
Returns:
success(boolean): Upload statusurl(string): Uploaded image URLimagePath(string): Absolute path of uploaded image
upload_images
Upload multiple image files.
Parameters:
image_paths(array of strings, required): Array of image file paths
Returns:
success(boolean): Overall operation statusresults(array): Results for each imagetotalUploaded(number): Count of successful uploadstotalFailed(number): Count of failed uploads
get_picgo_config
Get current PicGo configuration.
Returns:
success(boolean): Operation statusconfig(object): PicGo configurationpicGoPath(string): PicGo executable path being used
Example Usage
Once configured with opencode, you can use the tools like:
Upload image: /path/to/image.jpg
The MCP will handle the PicGo upload process and return the image URL.
Troubleshooting
PicGo not found
- Ensure PicGo is installed:
npm install -g picgo - Check the executable path in
~/.picgo-mcp.json - Make sure the path is correct and executable
Upload fails
- Verify PicGo configuration:
picgo config get - Check your uploader settings
- Ensure the image file exists and is readable
Permission errors
- Make sure the PicGo executable has execution permissions
- Check file permissions for the images you're uploading
Development
# Development mode with auto-rebuild
npm run dev
# Build once
npm run build
# Start the built server
npm start
License
MIT License
