Remove background from an image with Claude
Author
Tadas AntanaviciusClient
Use Stability AI's Stable Diffusion model to remove the background from an image.
Instructions
Make sure you are running Claude Desktop (not the web version of Claude.ai). And make sure you have npx working on your machine; we're going to be using the following MCP server:
Go to https://platform.stability.ai/ > click your account avatar in the upper right and you'll land on https://platform.stability.ai/account/keys > click “Create API Key”

- Open Claude Desktop and go to Claude > Settings > Developer > Edit Config
- This will open your claude_desktop_config.json file
- Replace the contents of the file with this configuration. Paste your Stability API key to replace the
YOUR_API_KEYtext. And update the values in/Users/YOUR_SYSTEM_USER_NAME/Downloads/SOME_FOLDERaccordingly to some empty folder in your file system (this is where you will need to put your image files):
claude_desktop_config.json
{
"mcpServers": {
"stability-ai": {
"command": "npx",
"args": [
"-y",
"mcp-server-stability-ai"
],
"env": {
"STABILITY_AI_API_KEY": "YOUR_API_KEY",
"IMAGE_STORAGE_DIRECTORY": "/Users/YOUR_SYSTEM_USER_NAME/Downloads/SOME_FOLDER"
}
}
}
}Save the file and restart Claude Desktop for the changes to take effect.
Open the folder you defined in IMAGE_STORAGE_DIRECTORY (or the default). This is where Claude will look for image files. Place the image with the background you want to remove in that folder."
Use this prompt template (or something similar) in Claude:
remove-background: from [Name of your image].
A copy of your image with the background removed will land in the folder from the configuration step (IMAGE_STORAGE_DIRECTORY).
Sign up for the weekly Pulse newsletter
Weekly digest of new & trending MCP apps, use cases, servers, resources and community developments.
Thanks for subscribing!
We've just sent you a confirmation email, please confirm your subscription (we want to make sure we never spam anyone)
Recaptcha failed
Please enter "Human" to proceed.
Please enter "Human" (case insensitive)