Skip to content

fix: restrict set_skywalking_url tool to stdio transport only#30

Merged
wu-sheng merged 1 commit intomainfrom
fix/session-stdio-only
Mar 13, 2026
Merged

fix: restrict set_skywalking_url tool to stdio transport only#30
wu-sheng merged 1 commit intomainfrom
fix/session-stdio-only

Conversation

@wu-sheng
Copy link
Member

Summary

  • Restrict set_skywalking_url session tool to stdio transport only, reverting the session-in-all-transports behavior from PR feat: add session-based SkyWalking URL and basic auth support #29
  • SSE and HTTP transports no longer inject a shared Session{} into context, avoiding the issue where one client could override another's URL/credentials
  • SSE/HTTP transports continue to use per-request SW-URL headers and --sw-url CLI flag for URL configuration
  • Update docs (README, CLAUDE.md) to clarify transport-specific URL resolution

Context

PR #29 review feedback (from both Copilot and @Fine0830) identified that SSE and HTTP transports shared a single Session{} across all clients, which is a correctness and security issue. Since stdio has a single client with well-defined session semantics, set_skywalking_url is now stdio-only.

Test plan

  • Verify swmcp stdio registers set_skywalking_url tool and session works as before
  • Verify swmcp sse and swmcp streamable do NOT expose set_skywalking_url tool
  • Verify SSE/HTTP transports still resolve URL from SW-URL header > --sw-url flag > default
  • CI passes (license + lint + docker build)

🤖 Generated with Claude Code

Reverts the session-in-all-transports behavior from PR #29. The
set_skywalking_url tool is now only registered for stdio mode, where
single-client session semantics are well-defined. SSE and HTTP
transports rely on per-request SW-URL headers and CLI flags instead,
avoiding the shared-session issue where one client could override
another's credentials.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wu-sheng wu-sheng requested a review from Fine0830 March 13, 2026 12:50
@wu-sheng wu-sheng added this to the 0.1.0 milestone Mar 13, 2026
@wu-sheng wu-sheng added the enhancement New feature or request label Mar 13, 2026
@wu-sheng wu-sheng merged commit c02c84e into main Mar 13, 2026
3 checks passed
@wu-sheng wu-sheng deleted the fix/session-stdio-only branch March 13, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants