Imaginate
MCP server that expands rough ideas into detailed image prompts via LangChain and generates images using the Hugging Face Inference API.
README
Imaginate
Turn a rough idea into a generated image — a LangChain prompt-enhancement chain expands your casual description into a detailed image prompt, which is then sent to a text-to-image model. Also exposed as an MCP tool, so any MCP-compatible AI agent (e.g. Claude Desktop) can call it directly.
How it works
User idea ("a cat astronaut")
│
▼
LangChain LCEL chain (Gemini) → expands into a detailed, styled prompt
│
▼
Hugging Face Inference API → generates the actual image
│
▼
Streamlit UI / MCP tool call → shown to the user or returned to the agent
Project Structure
imaginate/
├── src/
│ ├── prompt_chain.py # LangChain LCEL: rough idea -> detailed prompt
│ ├── image_gen.py # Hugging Face Inference API call
│ └── mcp_server.py # Exposes generate_image_tool as an MCP tool
├── app/
│ └── streamlit_app.py # UI
├── outputs/ # generated images land here
├── .env.example
├── .gitignore
├── requirements.txt
└── README.md
Setup
-
Install dependencies:
pip install -r requirements.txt -
Copy
.env.exampleto.envand fill in your keys:GOOGLE_API_KEY=your_gemini_api_key HF_API_KEY=your_huggingface_token- Gemini key: https://aistudio.google.com/app/apikey
- Hugging Face token: https://huggingface.co/settings/tokens
Run the Streamlit app
streamlit run app/streamlit_app.py
Run as an MCP server
python src/mcp_server.py
To connect this to Claude Desktop, add this to your Claude Desktop MCP config
(claude_desktop_config.json):
{
"mcpServers": {
"imaginate": {
"command": "python",
"args": ["/absolute/path/to/imaginate/src/mcp_server.py"]
}
}
}
Restart Claude Desktop, and you'll be able to ask it to generate an image using
the imaginate tool directly.
Author
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.