WeKnora/internal/mcp
Perfecto 03e2c47aec
feat(mcp): support 2026-07-28 alongside legacy clients (#4095)
* feat(mcp): support modern and legacy protocol connections

* fix(mcp): preserve annotated headers on modern tool calls

* fix(mcp): load parameter header schemas before tool calls

* fix(mcp): keep a working legacy session when discovery retry fails

Modern method-level 404s stay connected, while an expired SSE session still disconnects. A transient discover failure retries once, and a failed retry keeps the handshake that already succeeded.

* fix(mcp): wrap protocol negotiation lines for the linter

golangci-lint rejects lines longer than 120 characters.

* fix(mcp): retry protocol discovery without dropping the live session

A second initialize on the same transport clears a stateful legacy session when discover returns 404. Probe on a separate connection, and drop cached parameter headers after another client refreshes the directory.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-10-10 15:15:06 +08:00
..
client.go feat(mcp): support 2026-07-28 alongside legacy clients (#4095) 2026-10-10 15:15:06 +08:00
client_param_headers_test.go feat(mcp): support 2026-07-28 alongside legacy clients (#4095) 2026-10-10 15:15:06 +08:00
client_protocol_test.go feat(mcp): support 2026-07-28 alongside legacy clients (#4095) 2026-10-10 15:15:06 +08:00
client_session_test.go feat(mcp): support 2026-07-28 alongside legacy clients (#4095) 2026-10-10 15:15:06 +08:00
client_test.go feat(mcp)!: persist tool catalogs and add guided configuration (#3118) 2026-09-09 13:34:56 +08:00
client_tools_test.go feat(mcp): support 2026-07-28 alongside legacy clients (#4095) 2026-10-10 15:15:06 +08:00
errors.go refactor: Clean up code by removing unnecessary blank lines and improving comments for better readability and maintainability 2025-11-28 16:10:37 +08:00
manager.go feat(mcp): support 2026-07-28 alongside legacy clients (#4095) 2026-10-10 15:15:06 +08:00
manager_closeall_test.go fix(mcp): close MCP connections on shutdown without blocking exit 2026-09-25 18:22:14 +08:00
manager_startup_test.go feat(mcp): support 2026-07-28 alongside legacy clients (#4095) 2026-10-10 15:15:06 +08:00
oauth_lifecycle.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
oauth_lifecycle_test.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
oauth_manager.go fix(mcp): keep the client secret from dynamic client registration (#3763) 2026-10-08 01:24:51 +08:00
oauth_manager_test.go fix(mcp): keep the client secret from dynamic client registration (#3763) 2026-10-08 01:24:51 +08:00
oauth_principal_test.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
oauth_redirect_security_test.go fix: align client sessions and integration request handling (#3305) 2026-09-16 16:20:57 +08:00
oauth_state.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
oauth_state_test.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
oauth_tokenstore.go fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
security.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
security_test.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
tool_content_test.go fix(mcp): pass embedded resources in tool results to the agent (#3766) 2026-10-08 01:25:04 +08:00
types.go fix(mcp): pass embedded resources in tool results to the agent (#3766) 2026-10-08 01:25:04 +08:00