
rpt-mcp (SAP Crystal Reports)
io.github.ashafizullah由 GitHub 帳號 ashafizullah 發布v0.1.6更新於 Oct 30, 2026
Inspect and edit SAP Crystal Reports .rpt files (Windows; needs the Crystal runtime).
概覽
本機 Windows MCP 伺服器,透過 Crystal Reports .NET 執行階段讓助理讀取、編輯並匯出 SAP Crystal Reports .rpt 檔案。
- 可以做什麼
- 列出並檢視報表:找出資料夾中的 .rpt 檔案,輸出頁面設定、資料表、連結、參數、公式、群組、排序、區段以及每個物件與其格式。
- 編輯公式、參數、群組、排序、執行總計與記錄選擇公式,並可把多項編輯合併為一次全有或全無的儲存。
- 編輯版面:文字與內嵌欄位、物件位置與大小、字型、顏色、線條、方框、圖片、欄位格式、條件公式、區段與頁面設定。
- 管理資料來源:新增或移除資料表、把資料表改指向其他伺服器或提供者、替換 SQL Command 文字,並對照資料庫驗證報表。
- 以結構化方式比對兩份報表、插入並連結子報表,以及匯出為 PDF、Excel、Word、CSV 或逐頁 PNG/JPG 圖片。
- 適用情境
- 適合在 Windows 上維護 SAP Crystal Reports 範本時使用,讓助理檢視報表結構、進行結構化修改,或轉成 PDF 或圖片以核對版面。編輯本身不需要資料庫;匯出與變更資料來源通常需要。
- 執行需求
- 僅限 Windows,需安裝 .NET Framework 4.8 以及 64 位元 SAP Crystal Reports for .NET Framework 執行階段(v13)或 Crystal Reports for Visual Studio;該執行階段為 SAP 專有軟體,不隨本工具提供。以 zip 或 MCP Bundle 形式散布,作為本機執行檔透過 stdio 註冊。資料庫相關操作需在呼叫時傳入連線資訊,或使用 connections.json(可用 RPTMCP_CONNECTIONS 指定位置)。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 rpt-mcp (SAP Crystal Reports),將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
rpt-mcp
English | 中文
[CI] [Release] [License: MIT] [MCP] [Platform]
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
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_parameter,delete_running_totalandremove_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.
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.
- Zip: download
Build from source
The 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 Desktop / other clients (mcpServers config):
Database connections (optional)
Editing does not need a database. export_report, set_command_sql and set_datasource usually do, and add_table always does (Crystal reads the column list from the server).
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>":
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." - "Add table
dbo.Ordersfrom(localdb)\MSSQLLocalDB, databaseSales, to the blankOrders.rptand putOrderNoandTotalin the details section." - "Group the production report by shift, show Shift : n in the group header and Qty/Good/Reject subtotals in the group footer."
- "Add a per-product summary as a subreport in the report footer, linked to the report's date and shift parameters."
- "Make the report A4 landscape and number the rows with RecordNumber."
- "Export Invoice.rpt to PDF with
OrderNo = 1001so I can check the layout." - "Export page 1 of Invoice.rpt to PNG, look at it, and fix any overlapping columns."
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. add_tableadds tables without links; when a report has several tables, Crystal cross-joins them. Adding table links is not supported yet.- 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). - Field objects bound directly to a running total cannot be saved by the runtime (
SaveAsfails with "No error"), soadd_field_objectshows{#Name}through a formula{@Name}whose text is{#Name}.delete_running_totalremoves that formula too. - The runtime cannot create an empty report, so a new subreport is built as its own
.rptfirst (e.g. copy a report and trim it with these tools) and inserted withadd_subreport. Subreport objects cannot be moved to another section; insert them where they belong. - Default parameter values are the choices offered in the prompt;
export_reportstill needs the values passed inparameters. 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.
來源:README.md,提交 362035a
工具
0版本歷史
3- v0.1.6最新Oct 1, 2026
- v0.1.3Oct 1, 2026
- v0.1.2Sep 29, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分