Server data from the Official MCP Registry
Generate Word, PDF, PowerPoint, Excel, and HTML reports from JSON or Markdown
About
Generate Word, PDF, PowerPoint, Excel, and HTML reports from JSON or Markdown
Security Report
patrakit is a report-generation library exposed via an MCP server that renders Word, PDF, PowerPoint, Excel, and HTML files from JSON or Markdown input. The visible code shows no exfiltration, shell execution, or hardcoded secrets, and permissions broadly match its purpose. The main concerns are that the render tool accepts an arbitrary output_dir and filename without path restriction, and that the MCP tools perform no authentication, which is typical for local stdio servers but worth noting; the truncated sections (ai.py, markdown parser, renderers) were not fully reviewed. Supply chain analysis found 3 known vulnerabilities in dependencies (0 critical, 1 high severity). Package verification found 1 issue.
6 files analyzed · 8 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"patrakit": {
"command": "uvx",
"args": [
"patrakit==0.2.1"
]
}
}
}Some servers take additional arguments. See the repository for details.
Documentation
View on GitHubFrom the project's GitHub README.
patrakit
Describe a report once in Python, JSON, or Markdown. Save it as Word, PDF, PowerPoint, Excel, or HTML.
Install
Python 3.11 or later.
pip install patrakit
For pandas DataFrames:
pip install "patrakit[pandas]"
PDF output uses Typst through its Python package. You do not need Microsoft Office, LibreOffice or a web browser to create files.
Quickstart
Save this as quickstart.py and run python quickstart.py.
from patrakit import Report, Heading, Text, KPIRow, Table, Chart
sales = [
{"region": "North", "revenue": 1250000, "growth": 0.12},
{"region": "South", "revenue": 980000, "growth": 0.07},
{"region": "East", "revenue": 1120000, "growth": 0.09},
{"region": "West", "revenue": 850000, "growth": -0.03},
]
report = Report(
title="Quarterly Sales Review",
subtitle="Synthetic demo data",
theme="modern",
blocks=[
Heading("Summary"),
Text("Revenue grew in three of four regions."),
KPIRow({"Revenue": "$4.2M", "New accounts": 128}),
Heading("Revenue by region", level=2),
Chart.bar(
sales,
x="region",
y="revenue",
title="Revenue by region",
alt_text="Bar chart comparing revenue in four regions",
),
Table(sales, formats={"revenue": "currency:USD", "growth": "percent:1"}),
],
)
for extension in ("docx", "pdf", "pptx", "xlsx", "html"):
result = report.save(f"review.{extension}")
print(result.path)
for warning in result.warnings:
print(f" {warning.code}: {warning.message}")
You get five files from one report definition. Each format follows its own layout rules, so the files share content and style but do not look identical.
Gallery
Each image must come from the code beside it. scripts/build_gallery.py runs the files in
gallery/snippets/ and creates the images. All data is synthetic.
Word, PowerPoint and Excel pages are rendered for these images with LibreOffice. They can look slightly different in Microsoft Office.
from patrakit import Report, KPIRow, Chart
sales = [
{"region": "North", "revenue": 1250000},
{"region": "South", "revenue": 980000},
]
Report(
title="Sales Review",
blocks=[
KPIRow({"Revenue": "$2.23M"}),
Chart.bar(sales, x="region",
y="revenue"),
],
).save("sales.pdf")
Word
from patrakit import (
Report, Heading, BulletList)
Report(
title="Weekly Status",
blocks=[
Heading("Done this week"),
BulletList([
"Login flow shipped",
"12 bugs closed",
]),
],
).save("status.docx")
PowerPoint
from patrakit import Report, Heading, Chart
mrr = [
{"month": "Sep", "mrr": 41000},
{"month": "Oct", "mrr": 44500},
{"month": "Nov", "mrr": 47200},
]
Report(
title="SaaS Monthly Review",
blocks=[
Heading("MRR trend"),
Chart.line(mrr, x="month", y="mrr"),
],
).save("saas.pptx")
Excel
from patrakit import Report, Heading, Table
runs = [
{"model": "model-a", "pass_rate": 0.91},
{"model": "model-b", "pass_rate": 0.87},
]
Report(
title="Evaluation Results",
blocks=[
Heading("Pass rate"),
Table(runs, formats={
"pass_rate": "percent:1"}),
],
).save("evals.xlsx")
Template gallery
Ready-to-use templates you can download and run. Each generates real output files from synthetic data.
patrakit templates list
patrakit templates download sales-report ./demo
python ./demo/annual_sales_report.py
| Template | Category | Formats | Download |
|---|---|---|---|
| Academic Performance Report | Education | PDF, Word | patrakit templates download academic-performance |
| Weekly Project Status Report | Business | PDF, Word | patrakit templates download project-status-report |
| Six Years Financial Report | Finance | PDF, Excel | patrakit templates download financial-report |
| Commercial Invoice | Business | PDF, Excel | patrakit templates download commercial-invoice |
| Annual Sales Report | Business | PDF, PowerPoint | patrakit templates download sales-report |
You can also search templates by keyword:
patrakit templates search invoice
patrakit templates list --category finance
All templates use made-up data and need no API key.
Five runnable examples
The examples are included in the package, so you do not need to clone the repository.
patrakit examples list
patrakit examples copy invoice ./demo
python ./demo/invoice.py
| Name | Script | Creates | Needs | Guide |
|---|---|---|---|---|
saas-monthly-review | saas_monthly_review.py | PowerPoint, PDF | patrakit | Create a SaaS monthly review in PowerPoint and PDF with Python |
invoice | invoice.py | PDF, Excel | patrakit | Generate an invoice PDF and Excel file in Python |
project-status | project_status.py | Word, PDF | patrakit | Automate a weekly project status report in Word with Python |
analytics | analytics_report.py | Word, PDF | patrakit[pandas] | Pandas DataFrame to a Word and PDF report |
ai-evaluation | ai_evaluation_report.py | PDF, Excel | patrakit | Turn LLM evaluation results into a PDF and Excel report in Python |
All examples use made-up data and need no API key. The invoice is a layout example. It does not claim to meet the tax or legal invoice rules of any country.
What is free
Every feature in this section is in the free package. There are no watermarks, page limits, accounts or licence keys.
Content blocks
| Block | Example |
|---|---|
| Heading, levels 1 to 3 | Heading("Summary", level=1) |
| Text; a blank line starts a new paragraph | Text("Revenue grew.") |
| Bullet list | BulletList(["One", "Two"]) |
| KPI row | KPIRow({"Revenue": "$4.2M"}) |
| Table | Table(rows, formats={"amount": "currency:INR"}) |
| Bar, line and pie charts | Chart.bar(rows, x="month", y="sales") |
| Image | Image("logo.png", alt_text="Company logo", width=0.4) |
| Page or slide break | Break() |
Tables and charts accept a list of dictionaries. With the pandas extra, they also accept
a DataFrame. Image width is a share of the content width, from 0 to 1.
Value formats
| Format | Input | Shown as |
|---|---|---|
text | North | North |
integer | 1250000 | 1,250,000 |
number:2 | 3.14159 | 3.14 |
percent:1 | 0.12 | 12.0% |
currency:USD | 1250000 | $1,250,000.00 |
currency:INR | 1250000 | ₹12,50,000.00 |
date | datetime.date(2026, 11, 29) | 29 Nov 2026 |
patrakit formats values. It does not convert currencies or calculate totals.
Themes
Three themes are built in: classic, modern and minimal. You can also load your own
theme file.
# acme.yaml
base: modern
fonts:
heading: Montserrat
body: Source Sans 3
table: Source Sans 3
code: JetBrains Mono
fallback: [Noto Sans]
font_dirs: [./fonts]
colors:
primary: "#1F4E79"
accent: "#C55A11"
text: "#1F2328"
logo: assets/logo.png
header: "Acme Pvt Ltd"
footer: "Confidential"
from patrakit import Report, Text, Theme
report = Report(
title="Board Update",
theme=Theme.load("acme.yaml"),
blocks=[Text("All milestones are on track.")],
)
report.save("update.pdf")
Paths in a theme file are relative to that file. The code font role is reserved because
version 1 has no code block.
Custom fonts
Set one font family for everything, or set each role:
from patrakit import Report, Text, Theme, Fonts
theme = Theme(base="classic", fonts=Fonts(family="Noto Sans", font_dirs=["./fonts"]))
report = Report(title="Notes", theme=theme, blocks=[Text("Hello")])
report.save("notes.pdf", strict_fonts=True)
- Fonts come from your computer or your
font_dirs. patrakit does not download fonts. - A missing font produces a warning and uses a fallback. With
strict_fonts=True, saving fails instead. - Word, PowerPoint and Excel files store font names, not the fonts. The reader's
computer needs the same fonts. Use
Fonts.office_safe()when you share these files. PDF creation may need those fonts on your own computer too. - Built-in themes use Office-safe names in Office files and bundled open fonts in PDF. A font that you choose applies to all four formats.
- Support for a writing system is claimed only after it is tested. Check your output.
- You are responsible for the licences of fonts you add.
Run patrakit fonts to list the font families that patrakit can find.
JSON input and command line
You can describe the same report in JSON. This is useful for other programming languages and AI agents.
{
"schema_version": "1.0",
"title": "Quarterly Sales Review",
"theme": "modern",
"blocks": [
{"type": "heading", "level": 1, "text": "Summary"},
{"type": "text", "text": "Revenue grew in three of four regions."},
{"type": "kpi_row", "items": [{"label": "Revenue", "value": "$4.2M"}]},
{"type": "bullet_list", "items": ["North grew 12%", "West fell 3%"]},
{
"type": "chart",
"chart_type": "bar",
"title": "Revenue by region",
"alt_text": "Bar chart comparing revenue in four regions",
"categories": ["North", "South", "East", "West"],
"series": [{"name": "Revenue", "values": [1250000, 980000, 1120000, 850000]}]
},
{
"type": "table",
"columns": [
{"key": "region", "label": "Region", "format": "text"},
{"key": "revenue", "label": "Revenue", "format": "currency:USD"}
],
"rows": [
{"region": "North", "revenue": 1250000},
{"region": "South", "revenue": 980000}
]
}
]
}
patrakit validate report.json
patrakit render report.json -o report.pdf
patrakit render report.json -o report.pptx --theme acme.yaml --strict-fonts
patrakit schema -o report.schema.json
From Python, use Report.from_file("report.json") for a file, or Report.from_json(data)
for a JSON string or dictionary.
Image paths must stay inside the report's asset folder. For a JSON file, that is the folder that contains it. patrakit does not load images from web addresses.
HTML output
patrakit also renders to self-contained HTML files — useful for email, web previews, chatbot responses, and Streamlit/Gradio apps.
report.save("review.html")
The HTML file is a single file with inline CSS, embedded chart SVGs, and base64 images. It is responsive, prints cleanly, and needs no external resources.
Markdown input
LLMs generate Markdown naturally. patrakit accepts it directly:
from patrakit import Report
md = """
# Monthly Report
Revenue grew 9% year over year.
| Region | Revenue | Growth |
|--------|---------|--------|
| North | $1.25M | 12% |
| South | $980K | 7% |
- Launched mobile app
- Closed 128 accounts
"""
report = Report.from_markdown(md)
report.save("report.pdf")
report.save("report.docx")
Headings, paragraphs, bullet lists, tables, images, and horizontal rules are all
converted to patrakit blocks. Markdown files (.md) are also accepted by
Report.from_file() and the CLI.
Natural-language report generation
Generate a report from a plain-English description using your own LLM account:
from patrakit import Report
report = Report.from_prompt(
"Create a quarterly sales report with revenue $4.2M across 4 regions, "
"include a bar chart and summary table",
provider="openai", # or "anthropic", "google"
)
report.save("sales.pdf")
Set your API key via environment variable (OPENAI_API_KEY, ANTHROPIC_API_KEY,
or GOOGLE_API_KEY) or pass api_key= explicitly. The LLM generates valid patrakit
JSON; patrakit validates and auto-retries once if the output is invalid.
pip install "patrakit[ai-openai]" # for OpenAI
pip install "patrakit[ai-anthropic]" # for Anthropic
pip install "patrakit[ai-google]" # for Google
pip install "patrakit[ai]" # all three
patrakit sends your prompt to the LLM provider you choose. It never sends your report data to any service.
ReportBuilder — incremental construction
Build reports block by block, useful for streaming LLM output or step-by-step construction:
from patrakit import ReportBuilder, Heading, Text, KPIRow
builder = ReportBuilder(title="Q4 Review", theme="modern")
builder.add(Heading("Summary"))
builder.add(Text("Revenue grew 9% year over year."))
builder.add(KPIRow({"Revenue": "$4.2M"}))
# Validate at any point
errors = builder.validate()
# Save when done
builder.save("report.pdf")
MCP server (Model Context Protocol)
patrakit includes an MCP server so any MCP-compatible AI agent (Claude, Cursor, Windsurf, Cline, etc.) can generate documents as a tool call — no code generation needed.
pip install "patrakit[mcp]"
patrakit mcp-server
Add to your MCP client configuration:
{
"mcpServers": {
"patrakit": {
"command": "patrakit",
"args": ["mcp-server"]
}
}
}
The server exposes five tools:
| Tool | What it does |
|---|---|
patrakit_render | Render a JSON report to PDF, Word, PowerPoint, Excel, or HTML |
patrakit_validate | Validate a report definition without rendering |
patrakit_list_templates | List available templates |
patrakit_schema | Return the JSON Schema for report definitions |
patrakit_from_markdown | Convert Markdown to a rendered report |
AI framework integrations
patrakit ships tool wrappers for the major AI/agent frameworks. Each integration is an optional extra — install only what you need.
LangChain
pip install "patrakit[langchain]"
from patrakit.integrations.langchain import PatrakitReportTool, PatrakitMarkdownTool
tools = [PatrakitReportTool(), PatrakitMarkdownTool()]
agent = initialize_agent(tools=tools, llm=llm)
agent.run("Create a PDF sales report for Q4")
LangGraph
pip install "patrakit[langchain]"
from patrakit.integrations.langgraph import get_tools
from langgraph.prebuilt import ToolNode
tool_node = ToolNode(get_tools())
LlamaIndex
pip install "patrakit[llamaindex]"
from patrakit.integrations.llamaindex import PatrakitReportTool
from llama_index.core.agent import ReActAgent
tool = PatrakitReportTool()
agent = ReActAgent.from_tools([tool], llm=llm)
CrewAI
pip install "patrakit[crewai]"
from patrakit.integrations.crewai import PatrakitTool
report_writer = Agent(
role="Report Writer",
tools=[PatrakitTool()],
)
Google ADK
pip install "patrakit[google-adk]"
from patrakit.integrations.google_adk import PatrakitReportTool
from google.adk.agents import Agent
agent = Agent(
name="report_writer",
tools=[PatrakitReportTool()],
)
Install all integrations
pip install "patrakit[all-integrations]"
For AI agents
- JSON Schema:
schema/report.schema.json - Agent guide:
llms.txt - MCP server:
patrakit mcp-server
A good agent workflow is: read the schema, create the JSON, run patrakit validate,
then run patrakit render and read the warnings.
How each format behaves
| Format | Behaviour | Version 1 limits |
|---|---|---|
| Word | Flowing document with real heading, list and table styles | Charts are images, so you cannot edit their data in Word |
| Fixed pages | Accessibility and archival standards are not claimed | |
| PowerPoint | Each level 1 heading starts a slide; long content continues on new slides; charts are editable | Check slides for fit before you present them |
| Excel | A summary sheet, plus sheets for tables and editable charts | Values only; no generated formulas |
| HTML | Self-contained file with inline CSS, SVG charts, and base64 images | Responsive; designed for web and email |
patrakit creates new documents. It does not edit existing ones or offer a visual designer.
Privacy
The free package makes no network calls, calls no AI service and collects no usage data.
Your report stays on the machine that runs the code. Installing packages with pip uses
the network as usual.
Free and Pro
patrakit Pro is planned and not on sale yet.
| Feature | Free | Pro (planned) |
|---|---|---|
| All content blocks and JSON Schema | ✓ | ✓ |
| Word, PDF, PowerPoint, Excel and HTML output | ✓ | ✓ |
| Three built-in themes and your own theme file | ✓ | ✓ |
| Choose fonts for each role | ✓ | ✓ |
Markdown input (Report.from_markdown()) | ✓ | ✓ |
Natural-language generation (Report.from_prompt()) | ✓ | ✓ |
| ReportBuilder (incremental construction) | ✓ | ✓ |
| MCP server for AI agents | ✓ | ✓ |
| LangChain / LangGraph / LlamaIndex / CrewAI / Google ADK tools | ✓ | ✓ |
| Premium report designs | ✓ | |
| Your own PDF and slide templates | ✓ | |
| Advanced PDF layouts: multi-column, dashboard, cover page | ✓ | |
| AI layout planner that uses your own LLM account | ✓ | |
| Your own Excel templates (after the first Pro release) | ✓ | |
| Bulk rendering (later) | ✓ |
Features in the free column will stay free.
In Pro, you choose your LLM provider in one configuration file,
patrakit.llm.yaml: Gemini, OpenAI, or an endpoint compatible with the OpenAI Chat
Completions API, including a local one. The AI suggests a layout. It does not draw the
document or rewrite your values. In the free package, layout="ai" and template= raise
FeatureNotAvailableError.
See the Pro page for sample files, proposed prices and draft terms.
Help and contributing
- Report a bug or ask for a feature with a GitHub issue. Include a small example with made-up data. Never post API keys or private business data.
- Support for the free package is on a best-effort basis.
- Read
CONTRIBUTING.mdbefore you open a pull request. Report security problems as described inSECURITY.md.
Licence
The free package uses the Apache License 2.0. See LICENSE. Libraries and bundled fonts
keep their own licences. See THIRD_PARTY_NOTICES.md. patrakit Pro will have a separate
commercial licence.
Reviews
No reviews yet
Be the first to review this server!
More Design MCP Servers
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
mcp-creator-python
Freeby mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Lharries · Communication
Read, search, and send WhatsApp messages through your AI assistant
FinAgent
Freeby mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.
Memory
Freeby Modelcontextprotocol · Productivity
Knowledge graph-based persistent memory across sessions
