|
1 | 1 | # ChangeLog |
2 | 2 |
|
| 3 | +## [v2.0.0] - 2026-04-13 |
| 4 | + |
| 5 | +Targets **MCP protocol `2025-11-25`** as the default negotiated surface (with **legacy `2024-11-05`** transport still selectable via Kconfig where applicable). This release aligns the SDK with **Streamable HTTP** (JSON-RPC over HTTP + SSE), optional **OAuth** discovery metadata, richer **auth** options, and the **Prompts / Resources / Completions / Tasks** capability set. |
| 6 | + |
| 7 | +### Added |
| 8 | + |
| 9 | +#### Engine, tools, and capability modules |
| 10 | + |
| 11 | +- **Prompts**: Register static or dynamic prompts; engine handles `prompts/list` and `prompts/get` with render callbacks (`esp_mcp_prompt.h`, `esp_mcp_prompt.c`). |
| 12 | +- **Resources**: Register resources with optional dynamic `read` callbacks; engine handles `resources/list`, `resources/templates/list`, and `resources/read` (`esp_mcp_resource.h`, `esp_mcp_resource.c`). |
| 13 | +- **Completions**: Optional completion provider wired to `completion/complete` (`esp_mcp_completion.h`, `esp_mcp_completion.c`). |
| 14 | +- **Tasks (experimental)**: Internal task store and lifecycle helpers (`esp_mcp_task.c` / `esp_mcp_task_priv.h`, not public API) supporting async `tools/call` flows and JSON-RPC **`tasks/list`**, **`tasks/get`**, **`tasks/result`**, **`tasks/cancel`** in the engine. |
| 15 | +- **Tools**: Expanded tool registration and execution paths to match updated MCP method behavior (including task-augmented `tools/call` where enabled). |
| 16 | + |
| 17 | +#### HTTP server transport (`esp_mcp_http_server.c`) |
| 18 | + |
| 19 | +- **Streamable HTTP**: MCP primary JSON-RPC on **`POST`**; **SSE** stream on **`GET`** with `Accept: text/event-stream` for server-initiated JSON-RPC notifications and downstream traffic. |
| 20 | +- **Sessions**: **`MCP-Session-Id`** header support, session registry, TTL / idle behavior (Kconfig), and session termination (**`DELETE`**) where configured. |
| 21 | +- **Protocol negotiation**: **`MCP-Protocol-Version`** response header and compatibility checks against client `Protocol-Version` / request headers. |
| 22 | +- **Authentication**: Transport-level **Bearer** token checks; optional **JWT** verification skeleton (claims, audience, issuer, time skew, optional **JWKS** / inline key material, optional **signature** path); **`WWW-Authenticate`** and scope-insufficient paths for OAuth-style clients. |
| 23 | +- **OAuth metadata**: HTTP handlers for **`.well-known/oauth-protected-resource`** and **`.well-known/oauth-authorization-server`** when enabled. |
| 24 | +- **CORS**: Optional staging of **`Access-Control-Allow-Origin`** and related headers for browser clients (with safe pointer lifetime handling vs `esp_http_server` header storage). |
| 25 | +- **Operational responses**: Structured HTTP status usage (e.g. **201/202** session creation, **406** unacceptable SSE, **503** overload), **`ping`** health, and clearer error bodies for JSON-RPC errors where applicable. |
| 26 | +- **SSE implementation**: Async client tasks, event IDs / sequencing, optional resume hints, queueing, and backpressure-related safeguards (see Kconfig for buffer sizes and task stack). |
| 27 | + |
| 28 | +#### HTTP client transport (`esp_mcp_http_client.c`) |
| 29 | + |
| 30 | +- **Streamable client**: Outbound **`POST`** for JSON-RPC; inbound **SSE** parsing for default `message` events and dispatch into the manager. |
| 31 | +- **Session & auth**: Track **`MCP-Session-Id`** from responses; apply **Authorization** headers; retry paths for **401/403** where implemented; align **`HTTP_EVENT_ON_FINISH`** handling so pending manager callbacks are not left unresolved on error statuses. |
| 32 | + |
| 33 | +#### Manager (`esp_mcp_mgr.c`) |
| 34 | + |
| 35 | +- **Request context**: Per-request session / routing context for tools, tasks, and notifications. |
| 36 | +- **Pending JSON-RPC**: Queue and completion of outbound/inbound requests so `tools/call`, `tasks/*`, and SSE-delivered messages resolve correctly. |
| 37 | +- **Integration**: Coordinates engine, transports, and task objects for **initialize**, **notifications**, **tools/***, **resources/***, **prompts/***, **completion/***, **tasks/***, and **logging** where exposed. |
| 38 | + |
| 39 | +#### Tests (`components/mcp-c-sdk/test_apps`) |
| 40 | + |
| 41 | +- **On-target**: Large expansion of `test_mcp_c_sdk.c` covering initialization, tools (list/call/pagination), resources, prompts, completions, tasks, auth gates, SSE behavior, and error codes. |
| 42 | +- **Host pytest**: `pytest_mcp.py` updates; new **`pytest_mcp_http_integration.py`** for HTTP-level checks against a running server. |
| 43 | +- **Runner**: **`run_test_apps.sh`** to drive builds and tests with multiple **`sdkconfig.ci.*`** profiles. |
| 44 | +- **CI profiles**: Dedicated **`sdkconfig.ci.*`** fragments for combinations such as **SSE on/off**, **auth on/off**, **JWT claims / signature**, **OAuth metadata on/off**, **protocol default 2024**, **session TTL**, **tool list/call limits**, missing HTTP client/server components, etc. |
| 45 | +- **Repository wiring**: Root **`pytest.ini`** and **`tools/ci/executable-list.txt`** updates so CI can discover and run the new scripts. |
| 46 | + |
| 47 | +#### Documentation (`docs/`) |
| 48 | + |
| 49 | +- **User guides (EN & ZH)**: New topic pages under `docs/en/mcp/` and `docs/zh_CN/mcp/`: |
| 50 | + - `core_and_manager.rst` — engine vs manager responsibilities |
| 51 | + - `tooling_and_data.rst` — tools and structured data |
| 52 | + - `prompt_resource_completion.rst` — prompts, resources, completions |
| 53 | +- **Overview**: `docs/en/ai/mcp.rst` and `docs/zh_CN/ai/mcp.rst` updated to link into the split structure. |
| 54 | +- **API reference**: `docs/Doxyfile` **INPUT** extended with **`esp_mcp_prompt.h`**, **`esp_mcp_resource.h`**, **`esp_mcp_completion.h`** (in addition to existing engine/mgr/tool/data/property headers). |
| 55 | + |
| 56 | +#### Examples (`examples/mcp/`) |
| 57 | + |
| 58 | +- **`mcp_client`**: Updated **`main/Kconfig`**, **`sdkconfig.defaults`**, **`partitions.csv`**, **`README.md`**, and **`mcp_client.c`** (initialize ordering, tools/list/call, optional resources/prompts demos, pagination); added **`README_CN.md`**. |
| 59 | +- **`mcp_server`**: Extended **`mcp_server.c`** and server **`Kconfig`**; **`sdkconfig.defaults`** and **`partitions.csv`**; expanded **`README.md`** and added **`README_CN.md`**. |
| 60 | +- **CI matrix**: **`examples/mcp/mcp_server/ci/sdkconfig.matrix/*.defaults`** — many named presets (baseline SSE/auth, JWT variants, JWKS valid/invalid, metadata off, TTL short, health endpoint unavailable, GET **405**, server-only mode, etc.). |
| 61 | +- **Scripts**: **`test_kconfig_matrix.sh`** (matrix validation), **`test_sse_e2e.sh`** (SSE end-to-end), **`gen_es256_test_materials.sh`** (JWT test key material for CI). |
| 62 | + |
| 63 | +### Changed |
| 64 | + |
| 65 | +- **HTTP server & client**: Major internal redesign of **`esp_mcp_http_server.c`** and **`esp_mcp_http_client.c`** for Streamable HTTP, session lifecycle, SSE, and auth—file size and behavior differ substantially from v1.0.x line-oriented server-only usage. |
| 66 | +- **Engine**: **`esp_mcp_engine.c`** grown to implement the full method surface (including tasks and streaming-related notifications) and stricter protocol checks. |
| 67 | +- **Manager**: **`esp_mcp_mgr.c`** expanded for session-aware routing, pending RPC bookkeeping, and transport callbacks; callers should re-validate threading and callback assumptions. |
| 68 | + |
| 69 | +### Upgrade / migration |
| 70 | + |
| 71 | +- Re-test any custom **HTTP** integration: **SSE**, **`MCP-Session-Id`**, and **auth** headers change observable wire behavior. |
| 72 | +- If you relied only on **simple POST JSON-RPC** without sessions or SSE, enable or mock the corresponding Kconfig options and verify server logs and client sequencing (**`initialize`** must complete before **`tools/list`** / **`tools/call`** in strict clients). |
| 73 | +- Run the updated **`test_apps`** and, where possible, **`pytest_mcp_http_integration`** against your deployment before production rollout. |
| 74 | + |
3 | 75 | ## [v1.0.0] |
4 | 76 |
|
5 | 77 | ### Added |
|
0 commit comments