@mcp-abap-adt/http 19.2.0 → 20.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +48 -18
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -75,40 +75,70 @@ As before 19.0.0, under the same names: `--host` / `--http-host` / `MCP_HTTP_HOS
75
75
  new in 19.0.0, `--shutdown-timeout` / `MCP_SHUTDOWN_TIMEOUT` (see [Shutdown](#shutdown)).
76
76
  `mcp-abap-adt-http --help` lists them.
77
77
 
78
- ## Held state (the debugger)
79
-
80
- Every request is an MCP session of its own. A tool that holds state (a debug session, a batch)
81
- answers a `state_handle`; a request carrying it is routed to the instance that holds the state,
82
- one request at a time, and its own headers give its credential. The handle travels in the
83
- optional `x-mcp-state-handle` request header; without the header the pool reads a `tools/call`'s
84
- `state_handle` argument, as the debugger tools send it. A tool call whose handle the pool does
78
+ ## Held state, and the long session
79
+
80
+ Every request is an MCP session of its own, served by a new instance unless it names an instance
81
+ that holds state. A tool that holds state — a long session, a lock, a batch, a debug session —
82
+ answers a `state_handle`. **Send it as the `state_handle` argument** of every call that must reach
83
+ that state: every tool of this binary declares that optional argument (the debugger tools keep
84
+ their own declaration, required where it is required). A client that sets request headers may
85
+ send it in the `x-mcp-state-handle` header instead; when both are sent, the header wins. Such a
86
+ call is routed to the instance that holds the state, one request at a time, and its own headers
87
+ give its credential. A tool call whose handle the pool does
85
88
  not know — one that never existed, or whose state ended — is answered `state is not available`
86
89
  by the pool itself, the same answer whatever the handle was, and no instance is made and nothing
87
90
  logs on for it — a JSON-RPC array holding a tool call too, one such answer per request in it with
88
91
  an `id` (an array whose tool call carries a `state_handle` argument is answered `400`); another request carrying such a handle (an `initialize`, a list) gets a new
89
- instance, as a request without a handle does. The handle is a bearer secret: whoever holds it reaches the state. Held state ends
90
- by its stop tool, the idle bound (`--state-idle-minutes`, 30–35 791, default 30), or the server's
92
+ instance, as a request without a handle does. The handle is a bearer secret: whoever holds it
93
+ reaches the state, and the server does not identify the caller. Held state ends
94
+ by its stop tool (a long session's: `SessionClose`), the idle bound (`--state-idle-minutes`, 30–35 791, default 30), or the server's
91
95
  stop. See
92
96
  [the debugger guide](https://github.com/fr0ster/mcp-abap-adt/blob/main/docs/user-guide/DEBUGGER.md).
93
97
 
98
+ **The long session.** `SessionOpen` keeps an instance and its SAP connection for a run of calls
99
+ and answers `{ "state_handle": "…" }`. Every call carrying that `state_handle` runs on that
100
+ instance, on its held SAP session: no new connection, no `systeminformation` lookup, no logoff
101
+ between the calls. A call without it runs on a new instance, as before. Called with the handle of
102
+ an instance that already holds state (a lock, a batch, a debug session), or of an open session,
103
+ `SessionOpen` answers that same handle and keeps what the instance holds; called without a handle
104
+ it opens a new instance with a handle of its own — each long session is its own instance.
105
+ `SessionClose` with the handle answers `{ "closed": true, "held": { "locks": …, "batch": …,
106
+ "debug_session": … } }` — what the instance held — and once that answer is written the instance
107
+ leaves the pool and is closed: every SAP session it owns gets its logoff, which releases the locks
108
+ taken in it; an open batch and its recorded calls are dropped unsent; nothing is undone (the
109
+ logoff ends in SAP what the state held); the MCP server closes. From then on the handle answers
110
+ `state is not available` at once, whether or not SAP has answered the logoffs yet; the close
111
+ awaits each logoff's write and its answer with no timer of the server's, and the server's
112
+ shutdown awaits a close still running. `SessionClose` without a handle, or with an unknown one,
113
+ answers `state is not available`. A session never closed ends at the idle bound — no call on it for
114
+ `--state-idle-minutes`: its state ends, every SAP session of the instance is logged off, and the instance leaves the pool.
115
+ There is no list tool: the model keeps the handles it opened, and the handle is its only way back
116
+ to its session. Both tools change nothing in the system, so `mcp-abap-adt-http-ro` serves them too;
117
+ in batch mode they run at once and are never recorded — open leaves the batch open, close drops
118
+ it. No stdio or SSE binary serves them: there the instance lives as long as the connection.
119
+
94
120
  **Locks (compact).** compact `HandlerLock` holds the lock as the pooled instance's state and answers its `state_handle`;
95
- `HandlerUpdate`, `HandlerDelete` of a class include and `HandlerUnlock` under that lock send it in the `x-mcp-state-handle` header
96
- and reach the SAP session that holds the lock — without it they reach another instance and are
97
- refused, sending nothing. A request with the same credential headers works on the held
98
- connection; another credential retires it, and its logoff releases the lock. The hold ends at the
99
- `UNLOCK`.
121
+ `HandlerUpdate`, `HandlerDelete` of a class include and `HandlerUnlock` under that lock send it as
122
+ the `state_handle` argument (or in the `x-mcp-state-handle` header) and reach the SAP session that
123
+ holds the lock — without it they reach another instance and are refused, sending nothing. A
124
+ request with another credential (a renewed token, a new user and password) works on the held
125
+ connection too: the instance keeps its SAP session and the lock, and the new credential is put in
126
+ force for its next sends; what SAP answers to that credential reaches the caller as it came. The
127
+ hold ends at the `UNLOCK`, or with the instance (`SessionClose` of a long session, the idle bound,
128
+ the server's stop), whose logoff releases the lock.
100
129
 
101
130
  **Batch mode.** `BatchBegin` (compact: `HandlerBatch` with `action: 'begin'`) holds state and
102
- answers the instance's `state_handle`: send it in `x-mcp-state-handle` on every call of the batch,
103
- `BatchEnd` and `BatchAnswers` included. A call without it reaches an instance where no batch is
104
- open. See
131
+ answers the instance's `state_handle`: send it as the `state_handle` argument (or in
132
+ `x-mcp-state-handle`) on every call of the batch, `BatchEnd` and `BatchAnswers` included. A call
133
+ without it reaches an instance where no batch is open. See
105
134
  [Batch Mode](https://github.com/fr0ster/mcp-abap-adt/blob/main/docs/user-guide/BATCH_MODE.md#over-streamable-http).
106
135
 
107
136
  ## Every ADT session ends with a logoff
108
137
 
109
138
  An instance logs off every ADT session it opened when it leaves the pool: a request's instance
110
139
  after its request, when it holds nothing; a pooled instance when its state ends (its stop tool,
111
- the idle bound). An instance whose state undo fails is kept for a retry — it has not left, and its
140
+ the idle bound); a long session's instance at its `SessionClose`, with no undo — the logoff ends
141
+ what it held. An instance whose state undo fails is kept for a retry — it has not left, and its
112
142
  sessions stay open — until a later undo succeeds or the server shuts down, where its sessions are
113
143
  logged off at once. (After the idle bound's stop a pooled instance's sessions are logged off even
114
144
  when the undo failed.) The logoff is what releases a lock a tool left. A client that drops its
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/http",
3
3
  "mcpName": "io.github.fr0ster/mcp-abap-adt-http",
4
- "version": "19.2.0",
4
+ "version": "20.1.0",
5
5
  "description": "The Streamable HTTP transport of the MCP ABAP ADT server: an Express app serving the ADT tools of @mcp-abap-adt/lib over MCP Streamable HTTP, with DNS rebinding protection and TLS.",
6
6
  "license": "AGPL-3.0-only",
7
7
  "publishConfig": {
@@ -57,17 +57,17 @@
57
57
  ],
58
58
  "scripts": {
59
59
  "prebuild": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
60
- "build": "npx tsc -p tsconfig.json",
60
+ "build": "tsc -p tsconfig.json",
61
61
  "test": "npm --prefix .. test -- --roots http/src",
62
- "test:check": "npx tsc --noEmit -p tsconfig.test.json",
63
- "lint:check": "npx biome check src",
62
+ "test:check": "tsc --noEmit -p tsconfig.test.json",
63
+ "lint:check": "biome check src",
64
64
  "prepublishOnly": "npm run build"
65
65
  },
66
66
  "dependencies": {
67
- "@mcp-abap-adt/background-runs-memory": "^19.2.0",
68
- "@mcp-abap-adt/lib": "^19.2.0",
69
- "@mcp-abap-adt/responsible-rules": "^19.2.0",
70
- "@mcp-abap-adt/server-runtime": "^19.2.0"
67
+ "@mcp-abap-adt/background-runs-memory": "^20.1.0",
68
+ "@mcp-abap-adt/lib": "^20.1.0",
69
+ "@mcp-abap-adt/responsible-rules": "^20.1.0",
70
+ "@mcp-abap-adt/server-runtime": "^20.1.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/express": "*",