Skip to content

Conversation

@twishabansal
Copy link
Contributor

@twishabansal twishabansal commented Dec 9, 2025

This PR adds full support for the Model Context Protocol (MCP) to the SDK and establishes it as the default protocol. It consolidates changes from multiple feature branches to implement the transport layer, authentication, and testing infrastructure.

Key Changes

  • MCP Transport Protocol: Implements the core MCP transport logic, including version negotiation, session management (via Mcp-session-id), and notification handling.
  • Authentication Support: Adds support for authentication parameters (authParams) and related error handling.
  • Default Protocol: Establishes MCP as the default protocol for the SDK, updating the client architecture and removing redundant legacy tests.
  • Testing: Introduces comprehensive unit and end-to-end (E2E) coverage for the new MCP implementation.

Included PRs

This PR aggregates the following changes:

* add basic code

* fixes

* test fix

* new unit tests

* rename ToolboxTransport

* add py3.9 support

* fix langchain tool tests

* test fix

* lint

* fix tests

* move manage session into transport

* move warning to diff file

* avoid code duplication

* fix tests

* lint

* remove redundant tests

* make invoke method return str

* lint

* fix return type

* small refactor

* refactor: remove transport logic from client tests

* try

* version negotiation

* small changes

* lint

* fix endpoint

* add some todos

* lint

* initialise in init

* lint

* add support for 'Mcp-session-id'

* lint

* add todo

* add mcp protocol version to the latest protocol

* add test coverage

* small fix

* small fix

* small fix

* thread fixes

* try

* add tests

* lint

* change small

* nit

* small debugging

* add todos

* small bug fixes

* add todo

* remove id field from notifications

* refactor

* preprocess tools with empty params

* fix types

* fix bugs

* better error log

* small cleanup

* handle notifications

* fix unit tests

* lint

* decouple client from transport

* lint

* use toolbox protocol for e2e tests

* add e2e tests for mcp

* lint

* remove mcp as default protocol

* remove auth tests from mcp

* remove redundant lines

* remove redundant lines

* lint

* revert some changes

* initialise session in a better way

* small fix

* added more test cov

* lint

* rename private method

* Made methods private

* lint

* rename base url

* resolve comment

* better readability

* fix tests

* lint

* fix tests

* lint

* refactor mcp versions

* lint

* added test coverage

* refactor mcp

* lint

* improve cov

* lint

* removed process id

* Update class name

* remove mcp latest

* rename mcp.py

* have a single method for session init

* lint

* better type checks for v20241105

* Revert "better type checks for v20241105"

This reverts commit bc6da15.

* update type checking

* lint

* clean file

* refactor files

* refactor all versions

* fix mypy errors

* refactor properly

* lint

* run mcp e2e tests on all versions
@twishabansal twishabansal requested a review from a team as a code owner December 9, 2025 19:04
* test fix

* lint

* make invoke method return str

* lint

* try

* version negotiation

* small changes

* lint

* fix endpoint

* add some todos

* lint

* initialise in init

* lint

* add support for 'Mcp-session-id'

* lint

* add todo

* add mcp protocol version to the latest protocol

* small fix

* small fix

* small fix

* thread fixes

* try

* add tests

* lint

* change small

* small debugging

* add todos

* small bug fixes

* add todo

* remove id field from notifications

* refactor

* preprocess tools with empty params

* fix types

* fix bugs

* better error log

* small cleanup

* handle notifications

* fix unit tests

* lint

* decouple client from transport

* lint

* use toolbox protocol for e2e tests

* lint

* remove mcp as default protocol

* remove redundant lines

* remove redundant lines

* lint

* revert some changes

* initialise session in a better way

* small fix

* Made methods private

* lint

* rename base url

* resolve comment

* better readability

* add auth tests

* lint

* fix test

* rename authParam to authParams

* refactor mcp versions

* fix tests

* lint

* add auth param support code

* lint

* add unit test

* lint

* test fix

* lint

* fix test

* better error handling

* fix test

* add debug statement

* add debug statement

* add debug statement

* remove debug

* remove not needed files

* refactor mcp

* lint

* improve cov

* lint

* add feat files

* small fix

* small fix

* Update test_e2e_mcp.py

* add new tests

* add more test cases

* remove files

* remove rebase changes

* fix rebase issues

* lint

* fix rebase issues

* add test case

* fix test

* fix convert schema logic

* lint
* add basic code

* fixes

* test fix

* new unit tests

* rename ToolboxTransport

* add py3.9 support

* fix langchain tool tests

* test fix

* lint

* fix tests

* move manage session into transport

* move warning to diff file

* avoid code duplication

* fix tests

* lint

* remove redundant tests

* make invoke method return str

* lint

* fix return type

* small refactor

* refactor: remove transport logic from client tests

* try

* version negotiation

* small changes

* lint

* fix endpoint

* add some todos

* lint

* initialise in init

* lint

* add support for 'Mcp-session-id'

* lint

* add todo

* add mcp protocol version to the latest protocol

* add test coverage

* small fix

* small fix

* small fix

* thread fixes

* try

* add tests

* lint

* change small

* nit

* small debugging

* add todos

* small bug fixes

* add todo

* remove id field from notifications

* refactor

* preprocess tools with empty params

* fix types

* fix bugs

* better error log

* small cleanup

* handle notifications

* fix unit tests

* lint

* decouple client from transport

* lint

* use toolbox protocol for e2e tests

* add e2e tests for mcp

* lint

* remove mcp as default protocol

* remove auth tests from mcp

* remove redundant lines

* remove redundant lines

* lint

* revert some changes

* initialise session in a better way

* small fix

* added more test cov

* lint

* rename private method

* Made methods private

* lint

* rename base url

* resolve comment

* better readability

* add auth tests

* lint

* fix test

* make mcp the default protocol

* lint

* rename authParam to authParams

* fix tests

* lint

* fix tests

* lint

* refactor mcp versions

* lint

* added test coverage

* add auth param support code

* lint

* add unit test

* lint

* lint

* test fix

* lint

* fix test

* better error handling

* fix test

* add debug statement

* add debug statement

* Update integration.cloudbuild.yaml

* add debug statement

* remove debug

* update server version

* Update test_sync_e2e.py

* Update test_e2e.py

* Update test_e2e.py

* refactor mcp

* lint

* improve cov

* lint

* removed process id

* remove not needed files

* add feat files

* small fix

* small fix

* Update test_e2e_mcp.py

* add new tests

* add more test cases

* fix tests

* remove unwanted files
Copy link
Contributor

@anubhav756 anubhav756 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Might be a good idea to add summary of the feature or links to PRs merged here for future reference.

@twishabansal twishabansal merged commit 65a13ad into main Dec 10, 2025
17 checks passed
@release-please release-please bot mentioned this pull request Dec 10, 2025
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