Sap Abap Sql

run.daslab由 daslab.run 發布v0.3.0更新於 Oct 24, 2026

Checks and fixes ABAP Open SQL for SAP's ADT data-preview console. Connects to nothing.

已驗證STDIO僅桌面資料庫開發者工具

概覽

AI 產生的概覽

檢查、解釋並可選擇執行供 SAP ADT 資料預覽主控台使用的 ABAP Open SQL,讓助理不必再猜測該方言的規則。

可以做什麼
  • 準備並驗證語句,回傳修正後的文字或指出違反的規則
  • 解釋主控台為何拒絕某個語句,且不改寫它
  • 列出此方言與標準 SQL 的差異
  • 對已設定的地端 SAP 系統執行準備好的語句並回傳資料列
適用情境
適用於助理為地端 ECC 或 S/4HANA 系統的 ADT 資料預覽主控台撰寫 ABAP Open SQL、且反覆遇到解析錯誤的情況。三個檢查工具無需任何設定,可單獨加入以確保產生的語句合法。
執行需求
透過 npx 在本機執行(需要 Node.js)。檢查類工具無需其他條件。查詢工具需要在伺服器環境中設定 SAP_URL、SAP_USER 與 SAP_PASSWORD,可選 SAP_HEADERS 用於代理或通道標頭,並需要能連線至 SAP 系統的網路。
安裝前請注意
查詢工具會將語句送到你設定的 SAP 系統,憑證存放於伺服器環境變數中(SAP_URL、SAP_USER、SAP_PASSWORD、SAP_HEADERS)。它被描述為唯讀,因為資料預覽主控台無法寫入,但結果上限為 5,000 列並會標示為截斷。僅支援資料預覽方言,不適用於 ABAP 程式內的 Open SQL。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Sap Abap Sql,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

SAP ABAP SQL (MCP server)

[tests] [npm]

Checks and fixes ABAP Open SQL before it reaches SAP's ADT data-preview console.

If you have pointed an LLM at an on-premise SAP system, you have seen these:

You sentSAP said
SELECT SUM(netwr) FROM vbap400 Unknown column name "SUM(NETWR)"
SELECT COUNT(DISTINCT kunnr) FROM vbak400 ")" is invalid here (due to grammar)
SELECT a FROM t WHERE (x = '1' OR y = '2')400 ") " was expected here.

Three errors, three apparent rules, one actual cause: the parser wants a space on the inside of every parenthesis. It even tells you in the third one. All three pass once spaced.

Nothing in those messages says "add spaces", so a model guesses. In one recorded session the same malformed statement went out ten times in a row, varying only a literal. Across two sessions, 57 of 211 tool calls failed, most of them on dialect.

This server knows the rules, so your agent does not have to rediscover them.

Which dialect this is

The ADT data-preview console (/sap/bc/adt/datapreview/freestyle), which is where agents and ADT clients read tables over HTTP. Open SQL written inside an ABAP program is a different dialect: it has INTO TABLE, UP TO n ROWS, @host variables, and no character ceiling. Do not point this at program source and expect it to be right.

On-premise systems (ECC, S/4HANA on-prem, private cloud). If you are on S/4HANA Cloud with proper OData APIs, you do not need any of this.

Does it touch my system?

Only if you tell it to, and only from your own machine.

Three of the four tools are pure functions over a statement you pass in: no connection, no credential, no network call. They are the default, and they work with no configuration at all.

The fourth, abap_sql_query, runs a statement against a system you configure and returns rows. Credentials live in this server's environment on your machine. Nothing is proxied through anyone else and nothing is stored.

json
{  "mcpServers": {    "sap-abap-sql": {      "command": "npx",      "args": ["-y", "sap-abap-sql-mcp"],      "env": {        "SAP_URL": "https://your-system:44300",        "SAP_USER": "...",        "SAP_PASSWORD": "...",        "SAP_HEADERS": "X-Your-Proxy-Token: ..."      }    }  }}

SAP_HEADERS is optional, one Name: value per line. On-premise systems are rarely reached directly: they sit behind a tunnel or proxy, and if that gates on a header of its own then every request is rejected before SAP ever sees it. The symptom is a 403 that reads exactly like "ADT is switched off", and is not.

Read-only by construction: the data-preview console cannot write, so there is no write path to misuse.

Install

json
{  "mcpServers": {    "sap-abap-sql": {      "command": "npx",      "args": ["-y", "sap-abap-sql-mcp"]    }  }}

Tools

ToolWhat it does
abap_sql_prepareReturns the statement to send, or refuses it and names the correction
abap_sql_explainDecodes a statement the console rejected, without rewriting it
abap_sql_queryRuns a prepared statement against your configured system and returns rows
abap_sql_rulesLists the ways this dialect differs from standard SQL

All read-only, no side effects.

abap_sql_prepare  SELECT COUNT(DISTINCT kunnr) FROM vbak→ { "ok": true, "statement": "SELECT COUNT( DISTINCT kunnr ) FROM vbak", "length": 40, "limit": 255 }
abap_sql_prepare  SELECT a FROM t LIMIT 10→ { "ok": false, "rule": "no-limit",    "fix": "ABAP Open SQL has no LIMIT. Cap the result with the reader's row limit instead." }

The five rules also arrive in the server's instructions on connect, so your client has them before it writes anything. abap_sql_rules is there for when you want them back explicitly.

What it knows

Parenthesis spacing, everywhere it is required at once: aggregates, DISTINCT, subqueries, boolean groups. COUNT(*) stays compact, since the parser takes it either way and every character counts against the limit below.

The 255-character ceiling. The console accepts 255 and rejects 256, measured with whitespace collapsed. Wrapping across lines buys nothing, and the check runs after rewriting, because spacing makes statements longer. This one shapes how you plan a query: anything real has to be split and joined on your side.

LIMIT, DESC/ASC, and dot-qualified fields, refused with the ABAP form named. p.vbeln is not a typo the parser forgives, it is three tokens.

Where the literals are. A parenthesis inside 'PUMP (SPARE)' is data, and so is a double space. Both ABAP string forms and the comment form are understood, so a rewrite never changes what a statement asks for. This is the part a regex gets wrong quietly rather than loudly.

What it will not do for you

Two limits are the console's, not ours, and they shape everything you can ask:

255 characters per statement, so anything real has to be split into several statements and joined on your side. No window functions, no CTEs, no running totals.

5,000 rows, hard. A result at the cap is reported as truncated rather than handed back as if complete, because a client-side total over a silently truncated result is confidently wrong. That failure mode is worse than an error.

If you find yourself stitching four statements together to answer one question, that is the console, and no client fixes it.

Scope

This prepares statements and optionally runs them. It does not browse objects, execute ABAP, write anything, or know what your tables mean.

The dialect logic lives in abap-sql if you would rather call a library than run a server. Tokenizing is abaplint's lexer, which is the one correct ABAP tokenizer in TypeScript.

Built by Daslab. We connect agents to on-premise ERP systems. Connecting one from outside the network is its own problem, and there is a free write-up of what actually works: connecting an on-premise S/4HANA over HTTP.

Releasing

git tag v0.3.0 && git push --tags. CI checks the tag against package.json, runs the tests, publishes to npm with provenance, builds the .mcpb bundle and attaches it to a GitHub release.

Publishing uses npm trusted publishing, so there is no token in this repo and nothing to rotate. npm trusts this repository and this workflow through OIDC.

Two steps stay manual because they need credentials CI does not hold: the MCP Registry (mcp-publisher publish) and Smithery (smithery mcp publish).

License

MIT

來源:README.md,提交 c1b1751

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分