毕加索MCP
一个自托管的MCP服务器,通过Google AI Studio为AI编码助手生成图像。适用于 克劳德桌面, VS代码+GitHub副本,以及任何兼容MCP的客户端。
flowchart LR
A([AI Client]) --> B[MCP Server
your VM]
B --> C[Google AI Studio
Imagen · Gemini]
C --> D[(Image
saved to disk)]
D --> E([URL
returned to client])特性
- Imagen和Gemini模型支持——从模型名称自动检测
- VS代码/远程客户端的SSE传输
- Claude Desktop的stdio传输——无需代理
- 承载令牌身份验证
- 通过Docker Compose进行单命令部署
- 域+HTTPS的Nginx示例配置
快速开始
git clone https://github.com/codeadeel/picasso-mcp.git
cd picasso-mcp编辑 docker-compose.yml:
GOOGLE_API_KEY: "AIza..."
GOOGLE_MODEL: "gemini-2.0-flash-exp"
MCP_AUTH_TOKEN: "your-secret-token"
BASE_URL: "https://mcp.yourdomain.com"docker compose up -dVS代码+GitHub副本 --添加到 .vscode/mcp.json:
{
"servers": {
"picasso-mcp": {
"type": "sse",
"url": "http://YOUR_SERVER_IP:8000/sse",
"headers": { "Authorization": "Bearer your-secret-token" }
}
}
}切换至 代理模式 在Copilot Chat中,让它生成图像。
克劳德桌面(远程服务器) --要求 mcp-remote 就像一座桥。首选 设置→ 开发者→ 编辑配置 并添加:
{
"mcpServers": {
"picasso-mcp": {
"command": "mcp-remote",
"args": [
"https://mcp.yourdomain.com/sse",
"--header",
"Authorization: Bearer your-secret-token"
]
}
}
}安装 mcp-remote 第一: npm install -g mcp-remote.需要使用HTTPS的域--请参阅 Nginx+HTTPS.
克劳德桌面(本地stdio) --在您的计算机上将容器作为子进程运行。不需要服务器:
{
"mcpServers": {
"picasso-mcp": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "GOOGLE_API_KEY=your-api-key",
"-e", "GOOGLE_MODEL=gemini-2.0-flash-exp",
"-e", "MCP_TRANSPORT=stdio",
"-v", "/tmp/picasso-images:/images",
"picasso-mcp:latest"
]
}
}
}维基
- 配置 --模型、环境变量
- AI客户端 --VS代码,克劳德桌面设置
- 认证 --承载令牌设置和测试
- Nginx+HTTPS --生产域设置
- MCP工具 --刀具参考和参数
