Skip to content

feat: support user-defined fallback protocols array#707

Open
anubhav756 wants to merge 5 commits into
anubhav-mcp-draftfrom
anubhav-custom-protocols
Open

feat: support user-defined fallback protocols array#707
anubhav756 wants to merge 5 commits into
anubhav-mcp-draftfrom
anubhav-custom-protocols

Conversation

@anubhav756

Copy link
Copy Markdown
Contributor

Description

This PR introduces the ability for devs to provide a custom array of preferred protocol versions when initializing the client, rather than being forced to rely on the default SDK fallback order.

Note

This PR is stacked on top of #703.

Changes:

  • Custom Protocols Array:
    • Adds an optional supported_protocols list parameter to the ToolboxClient.
  • Intersection & Sorting Logic:
    • When the user provides a custom protocol array, the client computes the intersection between the user's requested versions and the SDK's natively supported versions.
    • The resulting list is strictly sorted in descending chronological order (newest to oldest).
  • Unit Testing (test_client.py):
    • Added dedicated unit tests to verify the custom array initialization.
    • Added assertions to verify that arrays passed in scrambled or reversed chronological order are correctly sanitized and sorted before the transport layer attempts negotiation.

Comment thread packages/toolbox-core/README.md Outdated
@anubhav756 anubhav756 force-pushed the anubhav-custom-protocols branch 2 times, most recently from 4ba1f82 to da892a4 Compare July 2, 2026 06:26
Comment thread packages/toolbox-core/README.md Outdated
@anubhav756 anubhav756 requested a review from twishabansal July 2, 2026 06:49
Comment thread packages/toolbox-core/tests/test_client.py Outdated
Comment thread packages/toolbox-core/src/toolbox_core/client.py Outdated
Comment thread packages/toolbox-core/src/toolbox_core/client.py
Comment thread packages/toolbox-core/src/toolbox_core/client.py Outdated
@anubhav756 anubhav756 changed the title feat(core): support user-defined fallback protocols array feat: support user-defined fallback protocols array Jul 2, 2026
@anubhav756 anubhav756 force-pushed the anubhav-custom-protocols branch 2 times, most recently from a4a946f to b85056d Compare July 3, 2026 21:37
@anubhav756 anubhav756 force-pushed the anubhav-mcp-draft branch from a8a71db to 264348c Compare July 3, 2026 21:41
@anubhav756 anubhav756 force-pushed the anubhav-custom-protocols branch 2 times, most recently from 0df32ae to a4a946f Compare July 3, 2026 21:42
@anubhav756 anubhav756 force-pushed the anubhav-mcp-draft branch from 264348c to 874e2c4 Compare July 3, 2026 21:58
@anubhav756 anubhav756 force-pushed the anubhav-custom-protocols branch from a4a946f to a36f4af Compare July 3, 2026 21:58
@anubhav756 anubhav756 force-pushed the anubhav-mcp-draft branch from 874e2c4 to 7030fc0 Compare July 3, 2026 21:59
@anubhav756 anubhav756 force-pushed the anubhav-custom-protocols branch from a36f4af to 414286f Compare July 3, 2026 21:59
@anubhav756 anubhav756 force-pushed the anubhav-mcp-draft branch from 7030fc0 to ed2ca21 Compare July 3, 2026 22:15
@anubhav756 anubhav756 force-pushed the anubhav-custom-protocols branch 3 times, most recently from a7e91d2 to a079713 Compare July 3, 2026 22:24
@anubhav756 anubhav756 force-pushed the anubhav-custom-protocols branch from a079713 to fba4c64 Compare July 3, 2026 22:25
@anubhav756 anubhav756 force-pushed the anubhav-custom-protocols branch from fba4c64 to 832ca4e Compare July 3, 2026 22:25
@anubhav756 anubhav756 requested a review from twishabansal July 4, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants