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
Copy file name to clipboardExpand all lines: docs/mcp-server.md
+88-3Lines changed: 88 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The `sap-devs` CLI includes a built-in [Model Context Protocol](https://modelcon
19
19
└───────────────────┘
20
20
```
21
21
22
-
The server loads the same content layer used by `sap-devs inject` — packs, profiles, tutorials, learning journeys — and serves it through twenty-six tools. Content is loaded once at startup from the local cache.
22
+
The server loads the same content layer used by `sap-devs inject` — packs, profiles, tutorials, learning journeys — and serves it through thirty tools. Content is loaded once at startup from the local cache.
The server registers twenty-six tools, grouped by domain. All list/search tools return a structured envelope:
79
+
The server registers thirty tools, grouped by domain. All list/search tools return a structured envelope:
80
80
81
81
```json
82
82
{
@@ -160,6 +160,26 @@ News is fetched live from YouTube RSS and SAP Community RSS on the first call, t
160
160
|`search_videos`| Search SAP developer videos from the SAP Developers YouTube channel |`query` (optional), `source` (optional — source ID), `limit` (optional, default 10, max 50) |
161
161
|`search_discovery`| Search SAP Discovery Center missions and BTP services |`query` (required), `type` (optional — `missions` or `services`), `limit` (optional, default 10, max 50) |
162
162
163
+
### Tutorial guided execution tools
164
+
165
+
| Tool | Description | Parameters |
166
+
|------|-------------|------------|
167
+
|`get_tutorial_step`| Get a single step from an SAP tutorial with content and heuristic annotations (executable commands, file creates, verifications) |`slug` (required), `step` (optional, default 1), `track` (optional, default true — creates/updates progress) |
168
+
|`update_tutorial_progress`| Record step completion for a tutorial |`slug` (required), `completed_steps` (required — array of 1-indexed step numbers), `current_step` (optional — inferred if omitted) |
169
+
|`get_tutorial_progress`| Check progress on a specific tutorial or all tutorials with saved progress |`slug` (optional — omit for all) |
170
+
|`list_active_tutorials`| List tutorials with in-progress state (not yet completed) |`limit` (optional, default 10, max 50) |
171
+
172
+
These tools enable AI agents to guide users through SAP tutorials step-by-step. The MCP server is stateless — the agent drives the tutorial flow by calling tools sequentially. Progress is stored in `tutorial-progress.json` in the XDG data directory and is shared between MCP tools and the CLI's interactive TUI (`sap-devs tutorial show -i`).
173
+
174
+
The **annotation engine** (`internal/tutorials/annotate.go`) heuristically classifies fenced code blocks in tutorial step markdown:
175
+
176
+
-**Commands** — shell/bash blocks or untagged blocks preceded by action-oriented text (e.g., "Run the following command")
177
+
-**File creates** — code-language blocks (`.cds`, `.json`, `.js`, etc.) preceded by text with file-action verbs and backtick-quoted filenames (e.g., "Create a file called \`schema.cds\`")
178
+
-**Verifications** — blocks preceded by output-signaling text (e.g., "You should see the following output")
179
+
-**Ignored** — comment-only blocks, blocks with no executable content
180
+
181
+
The engine is intentionally conservative: false negatives (missed annotations) are preferred over false positives (incorrectly classified blocks). This lets the AI agent make final judgment calls rather than blindly trusting heuristics.
182
+
163
183
## Server Instructions
164
184
165
185
The server sends prescriptive instructions to the agent at connection time:
@@ -187,6 +207,9 @@ An AI agent wired to the sap-devs MCP server will call its tools automatically b
187
207
| Exploring BTP capabilities |`search_discovery`| Finds Discovery Center missions and BTP service catalog entries |
188
208
| Asks about Cloud Foundry apps or services |`cf_target`, `cf_apps`, `cf_services`| Inspects live CF deployment state via CLI |
189
209
| Asks about BTP subaccounts or services |`btp_target`, `btp_subaccounts`, `btp_service_instances`| Inspects live BTP account state via CLI |
210
+
| Wants to follow an SAP tutorial |`search_tutorials`, `get_tutorial_step`| Searches for tutorials, then fetches steps with annotations for guided execution |
211
+
| Resuming tutorial work |`list_active_tutorials`, `get_tutorial_step`| Finds in-progress tutorials and continues from the last step |
212
+
| Completed a tutorial step |`update_tutorial_progress`| Records step completion with deduplication and auto-completion detection |
190
213
191
214
### Non-triggers — when the agent does NOT use it
192
215
@@ -246,6 +269,7 @@ The server implementation lives in `internal/mcpserver/`:
The server is built on [mcp-go](https://github.com/mark3labs/mcp-go) (`server.ServeStdio`). Dependencies (`Deps` struct) are assembled in `cmd/mcp_serve.go` from the content loader, tutorial index, learning index, active profile, cache/config directories, and current working directory.
251
275
@@ -261,7 +285,7 @@ Multiple independent MCP servers cover the SAP developer toolchain:
261
285
262
286
| Server | Package | Tools | Domain |
263
287
| -------- | ------- | ----- | ------ |
264
-
|**sap-devs**|`sap-devs mcp serve`|26| SAP knowledge, CF/BTP inspection, learning, news |
@@ -340,3 +364,64 @@ Populate pack `mcp.yaml` files with downstream SAP server definitions:
340
364
```
341
365
342
366
This enables `sap-devs mcp install --all` to wire up the full SAP tool suite in one command, without any proxy complexity.
367
+
368
+
## Tutorial Guided Execution — Phase 3 Analysis
369
+
370
+
*Analyzed April 2026. Conclusion: a custom Claude Code skill + targeted MCP tool enhancements achieves 90% of Phase 3's value at 10% of the complexity. A standalone embedded agent is not warranted at this time.*
371
+
372
+
### Background
373
+
374
+
Phase 2 (shipped April 2026) added four MCP tools and a heuristic annotation engine for AI-agent-driven tutorial walkthroughs. Phase 3 was originally envisioned as an embedded AI instructor agent inside the CLI — a standalone `sap-devs tutorial run <id> --instructor` that uses the Claude API directly.
375
+
376
+
### What Phase 2 already delivers
377
+
378
+
When an AI agent (Claude Code, Cursor, etc.) is connected to the sap-devs MCP server, it already acts as a tutorial instructor:
379
+
380
+
- Fetches steps via `get_tutorial_step` and interprets annotations (commands, file creates, verifications)
381
+
- Runs commands on the user's behalf via its native shell integration
382
+
- Explains *why* steps work using pack context from `get_context`
383
+
- Adapts explanations based on user profile and experience level
384
+
- Tracks progress via `update_tutorial_progress` with completion detection
385
+
- Resumes where the user left off via `list_active_tutorials`
| **Works with any AI provider** | Yes (MCP is agnostic) | **No — locked to Anthropic** |
400
+
401
+
The only truly unique capability Phase 3 adds is **standalone operation** — a user without Claude Code could run the instructor directly. But this comes at significant cost:
402
+
403
+
1. **Claude API dependency** — adds a hard runtime dependency on Anthropic, with token cost and API key management
404
+
2. **Duplicated agent runtime** — Claude Code already handles command execution, output observation, conversation state, and streaming UI
405
+
3. **Provider lock-in** — contradicts the MCP server's agent-agnostic design
0 commit comments