document-creation-mcp

document-creation-mcp

MCP server for AI-driven document creation, enabling generation of PowerPoint decks with consistent design themes and auto-generated images via ComfyUI.

Category
访问服务器

README

document-creation-mcp

MCP server for AI-driven document creation, starting with PowerPoint decks.

The server is the execution layer: it builds .pptx files from a structured slide plan, applies consistent design themes, and auto-generates images via your existing ComfyUI MCP server. The orchestrating model (e.g. in Open WebUI) does any web research and composes the slide plan, then calls these tools.

Tools

Tool Purpose
list_themes() List available design theme names.
get_theme(name) Return a theme's colors/fonts/image-style.
generate_image(prompt, theme, size, ...) Generate one image via ComfyUI MCP; returns local path.
create_presentation(plan_json) Build a deck from a PresentationPlan JSON; returns file path.
list_comfy_models() List checkpoints/samplers/schedulers available on the ComfyUI HTTP API.

create_presentation will auto-generate any image that has an image.prompt (using ComfyUI), and embed existing files/URLs when image.source is set.

Install

python -m venv .venv && source .venv/bin/activate
pip install -e .

Configure (environment variables)

Variable Default Meaning
DOC_MCP_OUTPUT_DIR output Where .pptx files are written.
DOC_MCP_IMAGE_DIR output/images Where generated images are cached.
DOC_MCP_TRANSPORT stdio Transport for the server itself: stdio, sse, or streamable-http.
DOC_MCP_HOST 127.0.0.1 Bind address when serving over HTTP/SSE. Defaults to localhost for security; set 0.0.0.0 to expose on the network (e.g. from Docker).
DOC_MCP_PORT 8000 Port the server listens on for sse / streamable-http.
DOC_MCP_STREAMABLE_HTTP_PATH /mcp Endpoint path for streamable-http. Set to / if your client POSTs to the server root (e.g. some MetaMCP configurations).
DOC_MCP_THEME_DIR (bundled) Directory of *.yaml theme files, merged on top of the bundled themes. Set this (e.g. a mounted volume) to add or override themes.
IMAGE_BACKEND mcp Image source: mcp (remote ComfyUI MCP server) or comfy_api (ComfyUI HTTP API directly).
MCP backend (IMAGE_BACKEND=mcp)
COMFY_MCP_URL (none) Address of your running ComfyUI MCP server, e.g. http://comfyui-mcp:8000/mcp or .../sse.
COMFY_MCP_API_KEY (none) Bearer token sent as Authorization: Bearer <key> (if the server requires auth).
COMFY_MCP_TRANSPORT auto auto (detect from URL), streamable-http, or sse.
COMFY_MCP_TOOL generate_image Name of the image tool in that server.
COMFY_MCP_COMMAND (fallback) Only used if COMFY_MCP_URL is unset, to spawn a stdio subprocess.
Direct API backend (IMAGE_BACKEND=comfy_api)
COMFY_API_URL (none) Base URL of the ComfyUI instance, e.g. http://comfyui:8188.
COMFY_API_KEY (none) Optional bearer token for the ComfyUI endpoint.
COMFY_API_WORKFLOW (built-in) Path to a JSON workflow template using {{prompt}}, {{negative_prompt}}, {{width}}, {{height}}, {{seed}}, {{checkpoint}}, {{steps}}, {{cfg}}, {{sampler}}, {{scheduler}}.
COMFY_API_CHECKPOINT sd_xl_base_1.0.safetensors Checkpoint loaded by the default workflow.
COMFY_API_STEPS / COMFY_API_CFG 25 / 7.0 KSampler steps / CFG scale.
COMFY_API_SAMPLER / COMFY_API_SCHEDULER euler / normal KSampler sampler / scheduler.
COMFY_API_SEED 0 Seed (0 = random per request).
COMFY_API_AUTODISCOVER true When enabled, the comfy_api backend queries /object_info and auto-selects an installed checkpoint (preferring SDXL-style names) plus a valid sampler/scheduler, so no manual model config is needed.
COMFY_MCP_TIMEOUT 300 Seconds to wait for image generation (both backends).
DOC_MCP_DISABLE_IMAGES false Skip all image generation.

Run

document-creation-mcp            # stdio transport (recommended for Open WebUI)
# or: python -m document_creation_mcp.server

Docker

Build and run the server inside a container.

# Build the image
docker build -t document-creation-mcp .

# Run with streamable-http transport (default in the Dockerfile)
docker run -p 8000:8000 \
  -e COMFY_MCP_COMMAND='["python","-m","comfy_mcp_server"]' \
  -v "$(pwd)/output:/app/output" \
  document-creation-mcp

Or use the provided Compose file:

docker compose up --build

The container serves on port 8000 using streamable-http by default. Generated .pptx files are written to /app/output (mount ./output to retrieve them). Override DOC_MCP_TRANSPORT=stdio if you instead want the container spawned as a stdio MCP server by its parent.

Open WebUI setup

  1. Start your ComfyUI MCP server separately (the command above must reach it).
  2. In Open WebUI → Admin → Tools → Add MCP server, point at this server (stdio command: document-creation-mcp, or an SSE URL if you wrap it).
  3. The model can now call create_presentation (after doing web search and drafting the plan) and generate_image for bespoke visuals.

When running this server in Docker, register it as an HTTP/SSE MCP server pointing at http://<host>:8000/mcp (streamable-http) or /sse instead of the stdio command.

Connecting over HTTP (Open WebUI / MetaMCP)

  • The server only listens for sse / streamable-http when DOC_MCP_TRANSPORT is set to one of those (the Docker image defaults to streamable-http).
  • It must be reachable from the client: set DOC_MCP_HOST=0.0.0.0 and publish the port (e.g. ports: ["3335:3335"] in Compose with DOC_MCP_PORT=3335). A Connection refused means the container isn't up, isn't on that port, or is bound to 127.0.0.1.
  • The client URL must include the endpoint path:
    • default → http://<host>:<port>/mcp
    • if your client POSTs to the server root (some MetaMCP setups do), set DOC_MCP_STREAMABLE_HTTP_PATH=/ and use http://<host>:<port>/.
    • A 404 Not Found on a POST means the path didn't match — adjust DOC_MCP_STREAMABLE_HTTP_PATH or add /mcp to the URL.

Themes

Factory themes ship inside the package at src/document_creation_mcp/themes/*.yaml (dark_tech, corporate, minimal, academic), so they are always available after install, including in Docker.

name: dark_tech
colors:
  background: "#0B0E14"
  primary: "#4F8CFF"
  accent: "#00E0C6"
  text: "#E6EAF2"
  muted: "#8A93A6"
fonts:
  heading: "Montserrat"
  body: "Inter"
image_style: "cinematic, neon accents, dark moody background, 8k, highly detailed"
layout_default: title_and_content
logo: null

image_style is appended to every generated image prompt for visual consistency.

Add or override themes: set DOC_MCP_THEME_DIR to a directory of *.yaml files (e.g. a mounted volume in Docker). Its themes are merged on top of the bundled ones, so a file with the same name overrides a factory theme.

Note: style_reference_image / controlnet.reference_image paths are resolved at runtime — in Docker, mount those assets and use absolute paths (or paths relative to the container working directory). The optional advanced workflow COMFY_API_WORKFLOW similarly needs to be mounted into the container.

To refresh after editing theme files, the server reloads them on startup; there is also a list_themes() tool to confirm what is loaded.

Recommended ComfyUI model stack for consistent decks

To get cohesive, on-brand imagery across an entire deck (not just one-off pictures), run an SDXL base with IP-Adapter for style/subject consistency and ControlNet for composition control, then upscale for projector-grade output. The pipeline below is what IMAGE_BACKEND=comfy_api is designed to drive (see comfy_workflows/presentation_sdxl.json for a ready-to-adapt template).

What to install

Purpose Suggested model(s) Notes
Base checkpoint juggernautXL_v9Rundiffusion.safetensors (general), or RealVisXL (photoreal/corporate), or DreamShaper XL (stylised) Pick one per deck; set it as COMFY_API_CHECKPOINT.
VAE sdxl_vae.safetensors Usually bundled with the checkpoint.
CLIP Vision (IP-Adapter dependency) CLIP-ViT-H-14-laion2b-s32B-b79K.safetensors Required by IP-Adapter.
IP-Adapter ip-adapter-plus_sdxl_vit-h.safetensors (style+composition) and/or ip-adapter-plus-face_sdxl_vit-h.safetensors (face/character lock) Drives consistency from a single style reference image.
ControlNet controlnet-union-sdxl-1.0.safetensors (all-in-one: depth/canny/pose/tile) One file covers every composition mode.
Upscaler 4x-UltraSharp.pth (or 4x_NMKD-Siax_200k.pth) ESRGAN; sharpens the final 16:9 output.
(Optional) Style LoRA any brand/style LoRA Extra brand lock on top of IP-Adapter.
Custom nodes ComfyUI_IPAdapter_plus, ComfyUI_ControlNet_Union (or ComfyUI-Advanced-ControlNet) Provide the IPAdapter / ControlNetApplyAdvanced nodes used by the template.

The exact node class names/inputs vary slightly between custom-node versions. Treat comfy_workflows/presentation_sdxl.json as a reference to adapt to your installed node pack, then point COMFY_API_WORKFLOW at it.

How consistency is enforced (the strategy)

  1. One style reference image per theme. Store a reference image in the theme (e.g. style_reference_image) and feed it to IP-Adapter at a moderate weight (~0.6–0.8). Every slide image in that deck inherits the same look/colour mood — this is the single biggest lever for cohesion.
  2. Shared negative prompt + colour palette. Bake a deck-wide negative (watermark, text, blurry, low quality, jpeg artifacts) and append the theme's image_style to every prompt (already done by generate_image).
  3. Composition control with ControlNet. Use a "subject-off-centre" control image (or Union type: depth/canny) so subjects sit left/right, leaving negative space for titles and bullet text — especially for image_full backgrounds.
  4. Fixed resolutions per role. Backgrounds: 16:9 → 1344×768 (or 1536×864). Content/side images: 1:1 → 1024×1024 or 4:3 → 1152×896. All divisible by 8 for SDXL.
  5. Upscale once at the end for crisp projection.
  6. (Optional) per-deck seed base. Generate with a fixed base seed + per-slide offset for reproducible backgrounds while keeping variety.

Planned integration (not yet wired)

Once the models above are installed locally, the call path will be extended to use them automatically via theme options, e.g.:

name: dark_tech
# ...existing colors/fonts...
image_style: "cinematic, neon accents, dark moody background, 8k, highly detailed"
style_reference_image: "themes/refs/dark_tech_style.png"  # fed to IP-Adapter
ip_adapter_weight: 0.7
controlnet:
  enabled: true
  type: depth          # depth | canny | openpose | tile
  strength: 0.6
  reference_image: "themes/refs/dark_tech_comp.png"
upscale_model: "4x-UltraSharp.pth"
negative_prompt: "watermark, text, blurry, low quality, jpeg artifacts"
background_post: "dim"   # light blur + dark overlay so text stays readable

The comfy_api backend will then load COMFY_API_WORKFLOW (the IP-Adapter + ControlNet + upscale graph) and substitute {{style_image}}, {{ip_weight}}, {{control_image}}, {{control_strength}}, {{upscale_model}} from the theme, alongside the existing {{prompt}} / {{width}} / {{height}} / {{seed}} placeholders. Background images will also get a subtle dim/blur post-process so titles read clearly. See comfy_workflows/presentation_sdxl.json.

Slide plan schema

{
  "title": "Deck title",
  "theme": "dark_tech",
  "output_filename": "my_deck",
  "slides": [
    {"title": "Intro", "layout": "title", "subtitle": "An AI deck"},
    {"title": "Topic", "bullets": ["Point 1"], "image": {"prompt": "futuristic city"}},
    {"title": "Deep dive", "layout": "image_full", "image": {"prompt": "data flow"}}
  ]
}

Layouts: title, title_and_content, two_column, image_full, section.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选