rpt-mcp
Provides tools for reading and editing SAP Crystal Reports .rpt files, including inspecting report structure, modifying formulas, parameters, datasources, sections, objects, and exporting reports.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rpt-mcpRepoint the tables in Sales.rpt to PROD01 and export it as PDF."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
rpt-mcp
An MCP server for SAP Crystal Reports .rpt files.
An MCP server that lets AI assistants (Claude Code, Claude Desktop, Cursor, …) read and edit SAP Crystal Reports .rpt files.
.rpt is a binary format, so an AI cannot edit it as text. This server wraps the official Crystal Reports .NET runtime (Engine + in-process Report Application Server) and exposes safe, structured edit operations as MCP tools.
Tools
Tool | What it does |
| List |
| Page setup, tables / SQL commands / connections, links, parameters, formulas, selection formulas, groups, sorts, sections and every object (position, text, bound field, font), including conditional formulas hidden in formatting (suppress, color, number format…) |
| Run several edit operations with one load, one backup and one save; all-or-nothing |
| Structural diff between two reports (e.g. backup vs. edited) |
| Edit, create or delete formula fields |
| Record or group selection formula |
| Report parameters |
| Replace the SQL of an existing SQL Command table (experimental) |
| Repoint tables to another server/database, optionally switching OLE DB provider (persisted) |
| Remove a table / command (guarded: refuses while its fields are used unless |
| Change a text object's text |
| Position/size, font, color, alignment, suppress, can-grow; for lines/boxes also end point, line style/thickness/color and box fill |
| Horizontal/vertical lines and boxes (fill, rounded corners), optionally spanning into a later section |
| Insert an image, or swap a picture (e.g. a logo) keeping its name, position and size |
| Number/date/time/boolean format of a field: decimals, thousands & decimal symbols, negatives, currency, zero text, date order/separator, 12/24h… or a custom pattern ( |
| Set/clear conditional formulas (suppress, font color, display string, border, number format…) |
| Section height, suppress, page breaks, keep-together, background |
| Add or remove report objects |
| Run the report and export to PDF/Excel/Word/CSV/… (useful to visually verify edits). Rows can be passed inline ( |
Positions and sizes are in twips (1440 = 1 inch, 567 ≈ 1 cm), Crystal's native unit.
All tools accept subreport to work inside a subreport.
Safety
Every edit overwrites the file in place only after copying the original to
_rptmcp_backup/<name>_<timestamp>.rptnext to it. Passoutput_pathto write to a new file instead.delete_formula,delete_parameterandremove_tablerefuse while the field is still used (field objects, fields embedded in text objects, formulas, selection/conditional formulas, groups, sorts, SQL commands) and list where it is used.force: truedeletes the bound objects too. Without this guard, Crystal silently drops every object bound to a deleted formula.
Related MCP server: Excel MCP Server
Requirements
Windows
.NET Framework 4.8
SAP Crystal Reports runtime for .NET Framework (v13, 64-bit), or SAP Crystal Reports for Visual Studio (SP 20+ recommended). Download it free from SAP. The runtime is proprietary SAP software and is not included in this repository.
To build from source: .NET SDK 6+ (it builds
net48).
Install
Install the SAP Crystal Reports runtime (see Requirements).
Get rpt-mcp in one of these ways:
Zip: download
rpt-mcp-<version>-win-x64.zipfrom Releases, unzip it anywhere (e.g.C:\Tools\rpt-mcp), then registerrpt-mcp.exewith your MCP client (see below).MCP Bundle: open
rpt-mcp-<version>.mcpbfrom Releases in a client that supports MCP Bundles, such as Claude Desktop.MCP Registry: rpt-mcp is listed in the official MCP Registry as
io.github.ashafizullah/rpt-mcp.
Build from source
cd src
dotnet build -c Release
# -> src\bin\Release\rpt-mcp.exeThe project references the Crystal assemblies from the GAC (C:\Windows\assembly\GAC_MSIL). If yours are elsewhere, override with dotnet build -p:CrGacMsil=<folder>.
For a 32-bit Crystal runtime, build with -p:PlatformTarget=x86.
Run the tests with dotnet test RptMcp.sln -c Release. See CONTRIBUTING.md for the report tests.
Register with an MCP client
Claude Code:
claude mcp add rpt-mcp -- "C:\path\to\rpt-mcp.exe"Claude Desktop / other clients (mcpServers config):
{
"mcpServers": {
"rpt-mcp": { "command": "C:\\path\\to\\rpt-mcp.exe" }
}
}Database connections (optional)
Editing does not need a database. export_report, set_command_sql and set_datasource usually do.
Pass server / database / user / password / integrated directly, or create connections.json next to the exe (or point RPTMCP_CONNECTIONS at it) and pass connection: "<name>":
{
"dev": { "server": "localhost\\SQLEXPRESS", "database": "Northwind", "integrated": true }
}connections.json is git-ignored; never commit credentials.
Example prompts
"Inspect
C:\reports\Invoice.rptand change the title to Tax Invoice, bold 14pt.""Add a formula
{@FullName}= first + last name and put it in the detail section next to the customer code.""Point every table in all reports under
C:\reportsto serverSQL02, databaseSalesProd.""Export Invoice.rpt to PDF with
OrderNo = 1001so I can check the layout."
Tips
Old reports often use the legacy
SQLOLEDBprovider, which cannot connect to LocalDB or TLS 1.2-only servers. Useset_datasourcewithprovider: "MSOLEDBSQL"(Microsoft OLE DB Driver for SQL Server) to fix that.
Limitations
Creating a new SQL Command is not supported. The in-process Crystal runtime rejects it with "Failed to load database information", even though adding a plain table on the same connection works.
set_command_sqlcan only edit a command that already exists, and it has not yet been verified against a report containing one.Charts, cross-tabs and OLAP grids can be inspected and moved, but not structurally edited.
Line styles: the runtime rejects
double, and drawsdashed/dottedlines as hairlines. Pictures are stored as bitmaps (transparency is flattened to white).set_command_sqlandset_datasourcego through Crystal's table-location API, which connects to the database to validate the schema.Tested with Crystal Reports runtime 13.0.2000 (x64) on Windows 11 and SQL Server LocalDB.
Protocol
JSON-RPC 2.0 over stdio (newline-delimited). This is implemented by hand because the Crystal runtime only runs on .NET Framework. Logs go to stderr.
License and legal
rpt-mcp is released under the MIT License.
It is an independent project, not affiliated with, endorsed or sponsored by SAP SE. SAP and Crystal Reports are trademarks or registered trademarks of SAP SE in Germany and other countries. They are used here only to describe compatibility.
The SAP Crystal Reports runtime is not distributed with this project. Each user installs it from SAP and is bound by SAP's license terms. SAP describes the runtime as free for client (desktop) applications. rpt-mcp runs as a local, single-user process, which is that kind of deployment. If you run it as a shared server that several users reach, check SAP's licensing for server applications (e.g. the Crystal Reports Developer Advantage license).
Third-party components are listed in THIRD-PARTY-NOTICES.md.
This server cannot be deployed
Maintenance
Related MCP Connectors
Create and manage documents, spreadsheets, and presentations from your AI assistant.
Composable APIs for document extraction, image transformation, and document & sheet generation.
AI access to Quadratic spreadsheets: open files, run Python/SQL, query connected databases.
PDF, image, video, OCR, screenshot, SQL, QR and text tools for agents. No API key, no signup.
Related MCP Servers
- AlicenseBqualityNot gradedmaintenanceEnables AI assistants to create, read, and manipulate Microsoft Word documents with comprehensive formatting, table creation, content management, and document protection capabilities. Supports advanced operations like merging documents, PDF conversion, and rich text formatting through a standardized interface.32MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read, write, and manipulate Excel files through comprehensive spreadsheet operations. Supports file management, data querying, worksheet operations, formula calculations, and includes security features like path validation and automatic backups.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to extract and analyze text content from various document formats (PDF, DOCX, PPTX, XLSX) in local knowledge bases, and create new formatted Word and Excel documents with structured data and reports.5MIT
- AlicenseAqualityAmaintenance50 tools and 400 functions for working with Excel/.xlsx spreadsheets — read/write, recalculate formulas, diff, repair broken references, and audit. Built for AI agents.50279 npm6MIT