resume-onepage-autofit-mcp
From markdown resume to formatted PDF, a MCP server that generates single-page PDF resumes with smart overflow detection and layered content reduction strategies
README
resume-onepage-autofit-mcp
An MCP server that lets AI agents deliver formatted, single-page PDF resumes — not just text answers.
🌐 中文 | English
🤖 Tired of copying between AI and Word, tweaking formats, and adjusting to fit one page? What if AI could handle that feedback loop for you? This MCP lets AI render PDFs and auto-adjust content to perfectly fit one page with clean formatting.
🎯 How It Works
User: Please generate a single-page resume from my experience
AI Agent:
1. 📝 Generate initial Markdown
2. 🔍 Call render_resume_pdf to validate
3. ⚠️ Detected 12% overflow
4. 🔧 Apply Level 2 reduction strategy
5. ✅ Success! PDF generated
🚀 Quick Start
1. Install MCP Server
# Enter MCP Server directory and install dependencies
cd mcp_server
pip install -r requirements.txt
# ⚡ Or using uv (recommended): uv pip install -r requirements.txt
# Install Chromium browser (first time only, ~150MB)
playwright install chromium
2. Configure Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"resume-onepage-autofit-mcp": {
"command": "python",
"args": ["<your-path>/myresumebuilder/mcp_server/mcp_server.py"]
}
}
}
Replace
<your-path>with your actual project path.⚡ If you prefer using uv:
"resume-onepage-autofit-mcp": { "command": "uv", "args": [ "run", "--directory", "<your-path>/myresumebuilder", "mcp_server/mcp_server.py" ] }
3. Prepare Your Resume Content
Write your resume content in myexperience.md (refer to example_resume.md for format).
4. Start Using
Restart Claude Desktop, then simply tell the AI: "Please generate a single-page resume from my experience"
Generated PDFs are saved to the generated_resume/ folder in the project directory by default.
💡 Custom Output Path:
- Copy
js/config.example.jstojs/config.jsand modify thepdfOutputsettings at the top- Or specify
output_pathparameter when calling to save to any location
✨ Core Features
- 🎯 Smart Fitting: Automatically adjusts content to fit resume perfectly on one A4 page
- 🔍 Precise Detection: Pixel-accurate page height detection based on Playwright
- 📊 Layered Reduction: Three-tier reduction strategy (format optimization → content simplification → deep reduction)
- 🔄 Feedback Loop: AI Agent intelligently iterates based on overflow metrics
- 🚀 MCP Integration: Supports direct calls from Claude Desktop and other AI clients
📸 Workflow
User provides experience → AI generates Markdown resume
↓
MCP Server renders & validates
↓
┌─────── Detect page height ───────┐
│ │
Success Failure
(within one page) (overflow X%)
│ │
Generate PDF Return overflow metrics + hints
│ ↓
│ AI applies reduction strategy
│ (Level 1/2/3)
│ │
└──────────── Re-render ←──────────┘
🎨 Reduction Strategy Overview
| Level | Overflow Range | Strategy | Information Loss |
|---|---|---|---|
| Level 1 | < 5% | Merge orphan lines, single-line lists | Low |
| Level 2 | 5-15% | Remove soft skills, simplify descriptions | Medium |
| Level 3 | > 15% | Delete irrelevant experiences | High |
See AI_AGENT_PROMPT.md for detailed strategies.
🔧 Visual Preview (Optional)
To manually adjust default style parameters, use the control panel (pure frontend, no Python needed):
# Use VS Code Live Server extension (recommended)
# Right-click control_panel.html -> "Open with Live Server"
# Or Python simple server
python -m http.server 8080
# Visit http://localhost:8080/control_panel.html
💡 The control panel is primarily for manually debugging style limits (e.g., font size ranges, line spacing). For daily use, rely on the AI Agent, which automatically adapts layout within optimal ranges based on content. For technical details, see DEVELOPMENT.md.
📚 Documentation
- AI_AGENT_PROMPT.md: AI Agent core reduction strategies (must read)
- DEVELOPMENT.md: Technical architecture & development guide
- mcp_server/README.md: MCP Server API documentation
🐛 Known Limitations
- Browser Dependency: Requires Chromium (~150MB first time)
- Content Length: Very long resumes (10+ pages) may need multiple reduction rounds
- Special Characters: Some emoji may affect layout
🔄 Development Roadmap
v0.2.0 (Planned)
- [ ] Custom templates
🤝 Contributing
Issues and Pull Requests welcome!
Development Setup
# Clone repository
git clone https://github.com/seriserendipia/resume-onepage-autofit-mcp.git
cd resume-onepage-autofit-mcp
# Create virtual environment
conda create -n agent_env python=3.10
conda activate agent_env
# Install dependencies
pip install -r mcp_server/requirements.txt
playwright install chromium
Commit Convention
feat:New featurefix:Bug fixdocs:Documentation updatetest:Test related
📄 License
MIT License - See LICENSE
🙏 Acknowledgments
- Playwright - Powerful browser automation
- MCP - Unified AI tool protocol
- Markdown-it - Reliable Markdown parser
- Paged.js - PDF pagination in the browser
📧 Contact
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
⭐ If this project helps you, please give it a Star!
⭐ 如果这个项目对你有帮助,请给一个 Star!
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。