sd-api-mcp
sd-api-mcp
Stable Diffusion REST API를 AI 에이전트에 노출하는 MCP(Model Context Protocol) 서버입니다. SD1.5, SDXL 및 Illustrious XL 파이프라인을 지원하여 텍스트-이미지 생성, 인페인팅, 모델 관리 및 모델 병합을 수행합니다.
SD API Backend 프로젝트 위에서 동작합니다.
MCP Python SDK로 구축되었으며 uv로 관리됩니다.
요구 사항
Python >= 3.11
uv 패키지 매니저
실행 중인 Stable Diffusion API 인스턴스 (기본값:
http://localhost:8000)
Related MCP server: Segmind MCP Server
설치
git clone <repo-url>
cd sd-api-mcp
uv sync사용 방법
stdio (기본값)
서버 프로세스를 관리하는 MCP 클라이언트(예: Claude Code, Claude Desktop)와 함께 사용합니다:
uv run sd-api-mcpSSE
uv run sd-api-mcp --transport sse --host 0.0.0.0 --port 8080Streamable HTTP (네트워크 배포에 권장)
uv run sd-api-mcp --transport streamable-http --host 0.0.0.0 --port 8080MCP 엔드포인트는 http://<host>:<port>/mcp에서 사용할 수 있습니다.
Claude Desktop 구성
claude_desktop_config.json에 추가하세요:
{
"mcpServers": {
"stable-diffusion": {
"command": "uv",
"args": ["run", "--project", "/path/to/sd-api-mcp", "sd-api-mcp"],
"env": {
"SD_API_URL": "http://localhost:8000"
}
}
}
}Claude Code 구성
claude mcp add stable-diffusion -- uv run --project /path/to/sd-api-mcp sd-api-mcpOpenCode 구성
opencode.json에 추가하세요:
{
"mcp": {
"stable-diffusion": {
"type": "stdio",
"command": "uv",
"args": ["run", "--project", "/path/to/sd-api-mcp", "sd-api-mcp"],
"env": {
"SD_API_URL": "http://localhost:8000"
}
}
}
}SSE 또는 Streamable HTTP 전송의 경우 서버를 별도로 시작하고 대신 원격 URL을 사용하세요:
{
"mcp": {
"stable-diffusion": {
"type": "sse",
"url": "http://localhost:8080/sse"
}
}
}환경 변수
변수 | 기본값 | 설명 |
|
| Stable Diffusion API의 기본 URL |
|
| 작업 상태 폴링 사이의 간격(초) |
|
| 작업 완료를 기다리는 최대 시간(초) |
|
| 전송 프로토콜 ( |
|
| SSE/HTTP 전송용 바인드 주소 |
|
| SSE/HTTP 전송용 포트 |
사용 가능한 도구
이미지 생성
도구 | 설명 |
| 이미지를 생성하고 결과를 기다립니다. |
| 마스크 영역을 인페인트하고 결과를 기다립니다. |
| 생성 작업을 제출하고 작업 ID를 즉시 반환합니다. |
| 인페인팅 작업을 제출하고 작업 ID를 즉시 반환합니다. |
| 한 번에 최대 10개의 생성 요청을 제출합니다. |
| 동일한 프롬프트로 2-6개 모델을 생성해 비교합니다. |
모든 생성 도구는 pipeline 매개변수("sd15", "sdxl" 또는 "illustrious")를 허용합니다.
모델 관리
도구 | 설명 |
| 사용 가능한 체크포인트, LoRA 또는 VAE를 나열합니다. |
| 모델의 safetensors 헤더에서 메타데이터를 읽습니다. |
작업 관리
도구 | 설명 |
| 상태 및 진행률과 함께 모든 작업을 나열합니다. |
| 특정 작업의 상태와 결과를 가져옵니다. |
| 대기 중이거나 실행 중인 작업을 취소합니다. |
시스템
도구 | 설명 |
| SD API에 연결할 수 있는지 확인합니다. |
| GPU, 캐시 및 대기열 통계를 가져옵니다. |
| 사용 가능한 노이즈 스케줄러를 나열합니다. |
| 현재 구성 매개변수를 가져옵니다. |
모델 병합
도구 | 설명 |
| 두 체크포인트를 병합합니다 (linear, slerp, additive, subtract). |
| 기본 모델을 여러 대상과 병합합니다. |
| 다단계 병합 레시피를 실행합니다. |
예제
이미지 생성 (에이전트 관점)
AI 에이전트는 다음으로 generate_image 도구를 호출합니다:
{
"pipeline": "sdxl",
"positive_prompt": "a cat sitting on a windowsill, golden hour lighting, photorealistic",
"negative_prompt": "blurry, low quality",
"model_checkpoint": "dreamshaperXL_v2.safetensors",
"width": 1024,
"height": 1024,
"steps": 30,
"cfg_scale": 7.0,
"seed": -1,
"scheduler": "DPM++ 2M"
}이 도구는 SD API에 작업을 제출하고 완료될 때까지 폴링한 후 생성된 이미지를 포함한 전체 결과를 반환합니다.
사용 가능한 모델 나열
{
"model_type": "sdxl",
"resource_type": "checkpoints"
}두 모델 병합
{
"model_type": "sd15",
"base_model": "v1-5-pruned.safetensors",
"target_model": "dreamshaper_8.safetensors",
"output_name": "merged_model.safetensors",
"method": "slerp",
"alpha": 0.5
}프로젝트 구조
src/sd_api_mcp/
__init__.py # CLI entry point with transport selection
server.py # MCPServer instance and tool definitions
client.py # Async HTTP client for the SD API라이선스
이 프로젝트는 GNU General Public License v3.0에 따라 라이선스가 부여됩니다. 자세한 내용은 LICENSE를 참조하세요.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceGive AI agents full control over your local ComfyUI by exposing 77 tools for workflow management, image generation, model handling, and real-time canvas control.3AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI image and video generation using Segmind's API with 30+ models including FLUX, Stable Diffusion XL, and more, accessible through any MCP-compatible AI assistant.50MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to generate images using ComfyUI by exposing tools for image generation, batch processing, and status checking through the Model Context Protocol.MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLM clients to generate, edit, and evaluate images through the Replicate API.
Related MCP Connectors
Generate images, GIFs, and PDFs from HTML, URLs, or templates — from your AI agent.
Create and manage cinematic AI video renders through the Future Video Studio Agent API.
LLM chat, text summarization and AI image generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcaimi/sd-api-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server