You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
23 extend schema builder add validation based on builder schema (#24)
Extended Schema Builder with min/max, etc.
Added Schema Validator to simplify validation based on the Schema Builder Schema
Added a report to cleanup MCP sessions
Added demo configuration as tabu entries
Removed tests and moved them into their own repo mcp_tests
Changed the origins table to avoid the key length warning - table conversion might be required
Moved DDIC content into it's own package
Copy file name to clipboardExpand all lines: docs/Overview.md
+54-12Lines changed: 54 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,10 @@ To install the MCP Server SDK, follow these steps:
42
42
Create a new node e.g. zmcp with handler class zcl_mcp_http_handler
43
43
3. Setup server configuration, e.g. create an entry for the stateless demo server zcl_mcp_demo_server_stateless
44
44
45
+
## Maintenance
46
+
47
+
You can use the report `zmcp_clear_mcp_sessions` to get rid of outdated MCP sessions. Ideally run it regularly as a background job if you use MCP sessions.
48
+
45
49
### Prerequisites
46
50
47
51
- SAP NetWeaver 7.52 or higher for the main branch
@@ -60,9 +64,8 @@ Configure your MCP servers in the `ZMCP_SERVERS` table:
60
64
| AREA | Logical grouping for servers |
61
65
| SERVER | Server identifier |
62
66
| CLASS | Implementation class (must implement `ZIF_MCP_SERVER` or extend `ZCL_MCP_SERVER_BASE`) |
Use the area to group your servers based on a well known structure in your company. This can e.g. be modules or end to end processes. For the session mode No Session is recommended except you really require session management.
68
+
Use the area to group your servers based on a well known structure in your company. This can e.g. be modules or end to end processes.
66
69
67
70
### CORS Configuration
68
71
@@ -114,7 +117,7 @@ ENDCLASS.
114
117
115
118
### Minimal Implementation
116
119
117
-
At minimum, you must implement the `HANDLE_INITIALIZE` method to define your server's capabilities:
120
+
At minimum, you must implement the `HANDLE_INITIALIZE` method to define your server's capabilities and `GET_SESSION_MODE`:
118
121
119
122
```abap
120
123
METHOD handle_initialize.
@@ -131,6 +134,10 @@ METHOD handle_initialize.
131
134
`Instructions for the AI model on when to use this server...`
132
135
).
133
136
ENDMETHOD.
137
+
138
+
METHOD get_session_mode.
139
+
result = zcl_mcp_session=>session_mode_stateless.
140
+
ENDMETHOD.
134
141
```
135
142
136
143
## Session Management
@@ -139,11 +146,11 @@ The MCP Server SDK offers three session management modes:
| MCP Session | Uses the custom MCP session handling mechanism via database |
144
151
| ICF Session | Uses the standard ICF session management |
145
152
146
-
Note that ICF session management leads to potentially high number of sessions if the clients do not properly close them. Also your MCP client must support handling the session cookies. MCP Sessions are an alternative lightweight mode allowing you to store certain values in the DB between calls. In general use No Session --> Stateless where feasible.
153
+
Note that ICF session management leads to potentially high number of sessions if the clients do not properly close them. Also your MCP client must support handling the session cookies. MCP Sessions are an alternative lightweight mode allowing you to store certain values in the DB between calls. In general use Stateless where feasible.
147
154
148
155
## Core Components
149
156
@@ -166,22 +173,55 @@ Interface defining all required MCP server methods. The main methods include:
166
173
-`resources_read` - Read resource content
167
174
-`tools_list` - List available tools
168
175
-`tools_call` - Execute tool function
176
+
-`get_session_mode` - Define session logic
169
177
170
-
### ZCL_MCP_SCHEMA_BUILDER
178
+
### Schema Builder
171
179
172
-
Helper class to build JSON schemas for tool input validation. You can call it multiple times like below or fully chain it.
180
+
`ZCL_MCP_SCHEMA_BUILDER` creates JSON Schema definitions for tool input validation with a fluent, chainable API:
173
181
174
182
```abap
175
183
DATA(schema) = NEW zcl_mcp_schema_builder( ).
176
-
schema->add_string( name = 'parameter' required = abap_true ).
177
-
schema->add_integer( name = 'count' ).
178
-
schema->begin_object( name = 'options' ).
179
-
schema->add_boolean( name = 'flag' ).
180
-
schema->end_object( ).
184
+
schema->add_string( name = 'parameter' required = abap_true )
0 commit comments