
Media Forge
io.github.PavelGuzenfeld由 GitHub 账号 PavelGuzenfeld 发布v0.2.0更新于 Nov 10, 2026
MCP server for generating diagrams, charts, presentations, and animations for Markdown documentation
概览
根据文本输入生成图表、图形、HTML 页面和幻灯片,并返回可嵌入 Markdown 文档的文件路径。
- 可以做什么
- Media Forge 提供渲染工具,接收文本 DSL 并返回生成资源的相对文件路径。图形工具在 Docker 容器内将 Mermaid、D2、Graphviz DOT 和 Vega-Lite 图表渲染为 SVG 或 PNG。HTML 工具无需 Docker 即可生成自包含的主题页面和 HTML 幻灯片。辅助工具提供各工具的使用指南并列出已生成的文件。
- 适用场景
- 适合需要将图形、图表、技术 HTML 页面或演示幻灯片生成为文件并用于文档的场景。适用于希望将生成资源提交到代码仓库并嵌入 Markdown,而不是以内联数据返回的工作流。
- 运行要求
- 作为本地 Node.js 进程运行,通常通过 npx mcp-media-forge 或构建后的 dist/index.js 启动。图形和图表工具需要从随附的 docker compose 文件启动 Docker 容器;HTML 页面和幻灯片工具无需 Docker。可选环境变量 PROJECT_ROOT、OUTPUT_DIR 和 MEDIA_FORGE_CONTAINER 用于控制输出路径和容器名称。未声明身份验证或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Media Forge,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
MCP Media Forge
[npm] [MCP Registry] [License: MIT]
MCP server that generates diagrams, charts, HTML pages, and slide decks from text DSLs -- designed for AI coding agents to embed into Markdown.
LLM agents call tools like render_mermaid, render_html_page, or render_slides with text input, and get back file paths to assets ready to embed in docs.
Output Gallery
Mermaid Flowchart
[Mermaid flowchart]Mermaid Sequence Diagram
[Mermaid sequence diagram]D2 Architecture Diagram
[D2 architecture diagram]Graphviz Dependency Graph
[Graphviz dependency graph]Vega-Lite Bar Chart
[Vega-Lite bar chart]Tools
Diagram & Chart Renderers (Docker)
HTML Generators (No Docker)
Utilities
Quick Start
1. Start the rendering container (for diagram tools)
HTML page and slide tools work without Docker.
2. Install the MCP server
Option A -- npx (no install)
Option B -- Clone and build
3. Register with your MCP client
Any MCP-compatible client (Claude Code, Cursor, VS Code + Copilot, Cline, etc.) can use this server. The standard config:
Where to add this depends on your client:
- Claude Code:
~/.claude/settings.json - Cursor: MCP settings panel
- VS Code (Copilot):
.vscode/mcp.json - Cline: MCP server configuration
4. Use it
Ask your AI assistant to generate diagrams, pages, or presentations:
"Create a sequence diagram showing the OAuth2 flow and embed it in the README"
"Generate an HTML page summarizing the API architecture with KPI cards"
"Make a slide deck with our Q1 metrics and architecture overview"
The agent calls the appropriate tool, gets back a file path, and embeds it in your markdown.
How It Works
Key design decisions:
- Text in, file path out -- returns relative paths, never base64 blobs
- Content-hash naming -- same input = same file = free caching + git-friendly
- SVG preferred -- vector format, small files, diffs cleanly in git
- Docker-contained -- diagram renderers run in a sandboxed container with
network_mode: none - Self-contained HTML -- pages and slides have zero external dependencies (inline CSS/JS)
- Input pre-validation -- catches common mistakes before Docker round-trips
- Structured errors -- error responses include
error_type,error_message, andsuggestionto enable LLM self-correction
Tool Reference
get_tool_guide
Get usage guide for any tool before rendering. Returns examples, anti-patterns to avoid, complexity limits, and tips.
Available guides: mermaid, d2, graphviz, vegalite, html_page, slides, or all for a summary.
render_mermaid
Pre-validation catches: missing diagram type, semicolons, HTML in labels, >25 nodes.
render_d2
Pre-validation catches: Mermaid/D2 syntax confusion, unbalanced braces, >3 nesting depth.
render_graphviz
Pre-validation catches: missing graph wrapper, -> in undirected graphs, unbalanced braces.
render_chart
Pre-validation catches: invalid JSON, missing $schema/data/mark, >500 inline data rows.
render_html_page
Generates a self-contained themed HTML page. No Docker required.
Design system CSS classes:
Themes:
render_slides
Generates a self-contained HTML slide deck with keyboard/touch navigation. No Docker required.
Slide types:
Navigation: Arrow keys, Space, PageUp/PageDown, Home/End. Touch: swipe left/right. Click dots to jump.
list_assets
Returns a JSON array of all generated files with name, path, size, and modification time.
Error Handling
All tools return structured errors that help LLMs self-correct:
Error types: syntax_error, rendering_error, dependency_missing.
Pre-validation catches common LLM mistakes before hitting the renderer:
- Mermaid: missing diagram type, semicolons, HTML tags, legacy
graphsyntax - D2: Mermaid syntax confusion (
-->,subgraph), unbalanced braces - Graphviz: missing
digraph/graphwrapper,->in undirected graphs - Vega-Lite: invalid JSON, missing required fields, oversized inline data
Environment Variables
Development
Running integration tests
HTML page and slide integration tests run without Docker.
Examples
See examples/ for sample input files:
See examples/README.md for MCP tool call examples and expected responses.
License
来源:README.md,提交 315951c
工具
0版本历史
1- v0.2.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分