marpit-mcp
v0.1.1
Published
MCP server to convert Markdown slides (Marpit/Marp) into PPTX via a unified CLI or HTTP mode.
Maintainers
Readme
marpit-mcp
Model Context Protocol (MCP) server & CLI for converting Marp / Marpit flavored Markdown slides into PPTX.
Single codebase supports:
- Direct CLI conversion (file or stdin)
- HTTP server mode (
--http) for remote generation - Docker image for easy deployment
- MCP stdio server mode (
--stdio) exposing a convertToPPTX tool (alias:--mcpdeprecated)
Features
- Uses
@marp-team/marp-coreto render Markdown to PPTX - Zero extra config for basic slides (
---separates slides) - Binary output to file or stdout
- HTTP endpoint returns base64 or downloadable PPTX
- Simple health endpoint for container orchestration
Install
npm install -g marpit-mcp # (once published)Or run directly with npx (no global install):
npx marpit-mcp --help
npx marpit-mcp slides.md -o slides.pptxLocal dev clone:
git clone <repo>
cd marpit-mcp
npm installCLI Usage
marpit-mcp slides.md # writes slides.pptx next to markdown
marpit-mcp slides.md -o deck.pptx # specify output file
cat slides.md | marpit-mcp - # read from stdin, temp file created
marpit-mcp - --stdout > deck.pptx # pipe binary to stdout
\n# Using npx (no global install)
npx marpit-mcp slides.md -o deck.pptx
npx marpit-mcp - --stdout > deck.pptxHelp:
marpit-mcp --helpHTTP Server
Start server:
marpit-mcp --http --port 3000Endpoints:
GET /health->{ ok: true }POST /generateJSON body:
{ "markdown": "---\n# Title\n", "download": false }Response (default):
{ "pptxBase64": "UEsDB...", "size": 12345 }If download: true returns a PPTX file stream.
curl examples
curl -s http://localhost:3000/health
curl -X POST http://localhost:3000/generate \
-H 'Content-Type: application/json' \
-d '{"markdown":"---\n# Title\n"}' | jq -r .sizeDocker
Build:
docker build -t marpit-mcp .Run HTTP server:
docker run --rm -p 3000:3000 marpit-mcpOne-off conversion (override entrypoint args):
docker run --rm -v %cd%:/work -w /work marpit-mcp slides.md -o slides.pptxProgrammatic Usage
import { generatePptx } from 'marpit-mcp'
const buf = await generatePptx(markdown)
// write buf to fileMCP Server Usage
Start MCP stdio server (blocks, communicates over stdio):
marpit-mcp --stdio
# Legacy (still works): marpit-mcp --mcpUsing npx (good for quick integration tests):
npx marpit-mcp --stdioThe server registers a single tool:
Tool name: convertToPPTX
Input schema:
{
"type": "object",
"required": ["markdown"],
"properties": {
"markdown": { "type": "string" }
}
}Output schema:
{
"type": "object",
"required": ["pptxBase64", "size"],
"properties": {
"pptxBase64": { "type": "string" },
"size": { "type": "number" }
}
}Typical client flow (pseudo):
- Launch
marpit-mcp --stdioas a subprocess. - Use MCP SDK client to request tool invocation with markdown content.
- Receive base64 PPTX; decode and save.
No state is retained between calls; each invocation renders independently.
Tests
npm testRoadmap
- Theming support injection
- Additional export formats (PDF, images)
- MCP protocol integration endpoints (future)
License
MIT
Contributing
PRs welcome. Keep AGENTS.md updated when altering architecture or capabilities.
