An MCP (Model Context Protocol) server that allows Claude Code to upload images and get public URLs for use in GitHub PRs, documentation, and more.
git clone https://github.com/hesscbjr/mcp-image-upload.git
cd mcp-image-upload
npm install
- Go to https://api.imgur.com/oauth2/addclient
- Register your application (no account required)
- Copy the Client ID
- Create
.env
file:
echo "IMGUR_CLIENT_ID=your_client_id_here" > .env
# Build the project
npm run build
# Add to Claude Code (user-scoped)
claude mcp add image-upload -- /path/to/mcp-image-upload/build/index.js
# Or project-scoped
cd /your/project
claude mcp add image-upload -s project -- /path/to/mcp-image-upload/build/index.js
Ask Claude to upload images:
"Upload the screenshot at /path/to/screenshot.png"
Claude will use the upload_image
tool and return a URL like:
https://i.imgur.com/abc123.png
This MCP server provides a single tool called upload_image
that:
- Takes a file path as input
- Reads the image file
- Uploads it to Imgur using their API
- Returns a public URL
The server uses:
- MCP SDK for Claude Code integration
- Imgur API for free, anonymous image hosting
- TypeScript for type safety
mcp-image-upload/
├── src/
│ ├── index.ts # MCP server implementation
│ └── uploaders/
│ └── imgur.ts # Imgur upload logic
├── build/ # Compiled JavaScript
├── .env # Your API credentials (git ignored)
└── package.json
The codebase is designed to support multiple providers. Check the src/uploaders/
directory for examples of implementing:
- UploadThing
- GitHub repository storage
- AWS S3 (coming soon)
IMGUR_CLIENT_ID
- Required for Imgur uploadsDEBUG=true
- Enable debug logging
# Test the upload functionality
node test/test-upload.js
- Imgur: 1,250 uploads/day (free tier)
- No authentication required
- Images are stored permanently
.env
file is git-ignored- Only image files should be uploaded
- Validate file paths before uploading
Feel free to add more upload providers or features! The codebase is modular and easy to extend.
ISC