Skip to content

Revert "MGMT-21086: support different protocols"#43

Merged
openshift-merge-bot[bot] merged 1 commit intomasterfrom
revert-38-MGMT-21086-support-streamable-http
Jul 26, 2025
Merged

Revert "MGMT-21086: support different protocols"#43
openshift-merge-bot[bot] merged 1 commit intomasterfrom
revert-38-MGMT-21086-support-streamable-http

Conversation

@carbonin
Copy link
Copy Markdown
Collaborator

@carbonin carbonin commented Jul 25, 2025

Reverts #38

In the integration environment we're seeing logs like this when tools are called:

2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Handling POST message - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:202)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Parsed session ID: c9705754-ea22-41bf-8ce2-cd20818007bc - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:218)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Received JSON: b'{"method":"tools/call","params":{"name":"list_versions","arguments":{"session_id":"1baad35c-3f97-4bb3-8d34-906a0eb0a76f"}},"jsonrpc":"2.0","id":1}' - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:231)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Validated client message: root=JSONRPCRequest(method='tools/call', params={'name': 'list_versions', 'arguments': {'session_id': '1baad35c-3f97-4bb3-8d34-906a0eb0a76f'}}, jsonrpc='2.0', id=1) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:235)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Sending session message to writer: SessionMessage(message=JSONRPCMessage(root=JSONRPCRequest(method='tools/call', params={'name': 'list_versions', 'arguments': {'session_id': '1baad35c-3f97-4bb3-8d34-906a0eb0a76f'}}, jsonrpc='2.0', id=1)), metadata=ServerMessageMetadata(related_request_id=None, request_context=<starlette.requests.Request object at 0x7f06b546d0d0>)) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:246)->handle_post_message
INFO:     10.129.8.12:38048 - "POST /messages/?session_id=c9705754ea2241bf8ce2cd20818007bc HTTP/1.1" 202 Accepted
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Received message: <mcp.shared.session.RequestResponder object at 0x7f06b52e8550> - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:588)->run
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - INFO     - 139666845583168:10 - Processing request of type CallToolRequest - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:625)->_handle_request
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Dispatching request of type CallToolRequest - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:627)->_handle_request
[07/25/25 19:39:55] ERROR    Error calling tool              tool_manager.py:193
                             'list_versions'                                    
                             ╭─ Traceback (most recent cal─╮                    
                             │ /opt/app-root/src/.venv/lib │                    
                             │ /python3.13/site-packages/f │                    
                             │ astmcp/tools/tool_manager.p │                    
                             │ y:184 in call_tool          │                    
                             │                             │                    
                             │   181 │   │   │   │   raise │                    
                             │   182 │   │   │             │                    
                             │   183 │   │   │   try:      │                    
                             │ ❱ 184 │   │   │   │   retur │                    
                             │   185 │   │   │             │                    
                             │   186 │   │   │   # raise T │                    
                             │   187 │   │   │   except To │                    
                             │                             │                    
                             │ /opt/app-root/src/.venv/lib │                    
                             │ /python3.13/site-packages/f │                    
                             │ astmcp/tools/tool.py:275 in │                    
                             │ run                         │                    
                             │                             │                    
                             │   272 │   │   │   arguments │                    
                             │   273 │   │                 │                    
                             │   274 │   │   type_adapter  │                    
                             │ ❱ 275 │   │   result = type │                    
                             │   276 │   │                 │                    
                             │   277 │   │   if inspect.is │                    
                             │   278 │   │   │   result =  │                    
                             │                             │                    
                             │ /opt/app-root/src/.venv/lib │                    
                             │ /python3.13/site-packages/p │                    
                             │ ydantic/type_adapter.py:421 │                    
                             │  in validate_python         │                    
                             │                             │                    
                             │   418 │   │   │   │   code= │                    
                             │   419 │   │   │   )         │                    
                             │   420 │   │                 │                    
                             │ ❱ 421 │   │   return self.v │                    
                             │   422 │   │   │   object,   │                    
                             │   423 │   │   │   strict=st │                    
                             │   424 │   │   │   from_attr │                    
                             ╰─────────────────────────────╯                    
                             ValidationError: 1 validation                      
                             error for call[list_versions]                      
                             session_id                                         
                               Unexpected keyword argument                      
                             [type=unexpected_keyword_argume                    
                             nt,                                                
                             input_value='1baad35c-3f97-4bb3                    
                             -8d34-906a0eb0a76f',                               
                             input_type=str]                                    
                                 For further information                        
                             visit                                              
                             https://errors.pydantic.dev/2.1                    
                             1/v/unexpected_keyword_argument                    
2025-07-25 19:39:56,230 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Response sent - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:668)->_handle_request
2025-07-25 19:39:56,231 - mcp.server.sse - DEBUG    - 139666845583168:10 - Sending message via SSE: SessionMessage(message=JSONRPCMessage(root=JSONRPCResponse(jsonrpc='2.0', id=1, result={'content': [{'type': 'text', 'text': "Error calling tool 'list_versions': 1 validation error for call[list_versions]\nsession_id\n  Unexpected keyword argument [type=unexpected_keyword_argument, input_value='1baad35c-3f97-4bb3-8d34-906a0eb0a76f', input_type=str]\n    For further information visit https://errors.pydantic.dev/2.11/v/unexpected_keyword_argument"}], 'isError': True})), metadata=None) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:172)->sse_writer

Summary by CodeRabbit

  • Refactor

    • Unified and simplified server implementation, including changes to server instance usage, token header access, tool listing, and server startup process.
    • Removed transport parameter configuration from deployment template.
    • Updated and streamlined tests to use direct server function calls and improved mocking of request context.
  • Chores

    • Lowered the minimum required version of a core dependency.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 25, 2025
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jul 25, 2025

@carbonin: This pull request references MGMT-21086 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

Reverts #38

In the integration environment we're seeing logs like this when tools are called:

2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Handling POST message - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:202)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Parsed session ID: c9705754-ea22-41bf-8ce2-cd20818007bc - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:218)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Received JSON: b'{"method":"tools/call","params":{"name":"list_versions","arguments":{"session_id":"1baad35c-3f97-4bb3-8d34-906a0eb0a76f"}},"jsonrpc":"2.0","id":1}' - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:231)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Validated client message: root=JSONRPCRequest(method='tools/call', params={'name': 'list_versions', 'arguments': {'session_id': '1baad35c-3f97-4bb3-8d34-906a0eb0a76f'}}, jsonrpc='2.0', id=1) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:235)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Sending session message to writer: SessionMessage(message=JSONRPCMessage(root=JSONRPCRequest(method='tools/call', params={'name': 'list_versions', 'arguments': {'session_id': '1baad35c-3f97-4bb3-8d34-906a0eb0a76f'}}, jsonrpc='2.0', id=1)), metadata=ServerMessageMetadata(related_request_id=None, request_context=<starlette.requests.Request object at 0x7f06b546d0d0>)) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:246)->handle_post_message
INFO:     10.129.8.12:38048 - "POST /messages/?session_id=c9705754ea2241bf8ce2cd20818007bc HTTP/1.1" 202 Accepted
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Received message: <mcp.shared.session.RequestResponder object at 0x7f06b52e8550> - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:588)->run
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - INFO     - 139666845583168:10 - Processing request of type CallToolRequest - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:625)->_handle_request
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Dispatching request of type CallToolRequest - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:627)->_handle_request
[07/25/25 19:39:55] ERROR    Error calling tool              tool_manager.py:193
                            'list_versions'                                    
                            ╭─ Traceback (most recent cal─╮                    
                            │ /opt/app-root/src/.venv/lib │                    
                            │ /python3.13/site-packages/f │                    
                            │ astmcp/tools/tool_manager.p │                    
                            │ y:184 in call_tool          │                    
                            │                             │                    
                            │   181 │   │   │   │   raise │                    
                            │   182 │   │   │             │                    
                            │   183 │   │   │   try:      │                    
                            │ ❱ 184 │   │   │   │   retur │                    
                            │   185 │   │   │             │                    
                            │   186 │   │   │   # raise T │                    
                            │   187 │   │   │   except To │                    
                            │                             │                    
                            │ /opt/app-root/src/.venv/lib │                    
                            │ /python3.13/site-packages/f │                    
                            │ astmcp/tools/tool.py:275 in │                    
                            │ run                         │                    
                            │                             │                    
                            │   272 │   │   │   arguments │                    
                            │   273 │   │                 │                    
                            │   274 │   │   type_adapter  │                    
                            │ ❱ 275 │   │   result = type │                    
                            │   276 │   │                 │                    
                            │   277 │   │   if inspect.is │                    
                            │   278 │   │   │   result =  │                    
                            │                             │                    
                            │ /opt/app-root/src/.venv/lib │                    
                            │ /python3.13/site-packages/p │                    
                            │ ydantic/type_adapter.py:421 │                    
                            │  in validate_python         │                    
                            │                             │                    
                            │   418 │   │   │   │   code= │                    
                            │   419 │   │   │   )         │                    
                            │   420 │   │                 │                    
                            │ ❱ 421 │   │   return self.v │                    
                            │   422 │   │   │   object,   │                    
                            │   423 │   │   │   strict=st │                    
                            │   424 │   │   │   from_attr │                    
                            ╰─────────────────────────────╯                    
                            ValidationError: 1 validation                      
                            error for call[list_versions]                      
                            session_id                                         
                              Unexpected keyword argument                      
                            [type=unexpected_keyword_argume                    
                            nt,                                                
                            input_value='1baad35c-3f97-4bb3                    
                            -8d34-906a0eb0a76f',                               
                            input_type=str]                                    
                                For further information                        
                            visit                                              
                            https://errors.pydantic.dev/2.1                    
                            1/v/unexpected_keyword_argument                    
2025-07-25 19:39:56,230 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Response sent - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:668)->_handle_request
2025-07-25 19:39:56,231 - mcp.server.sse - DEBUG    - 139666845583168:10 - Sending message via SSE: SessionMessage(message=JSONRPCMessage(root=JSONRPCResponse(jsonrpc='2.0', id=1, result={'content': [{'type': 'text', 'text': "Error calling tool 'list_versions': 1 validation error for call[list_versions]\nsession_id\n  Unexpected keyword argument [type=unexpected_keyword_argument, input_value='1baad35c-3f97-4bb3-8d34-906a0eb0a76f', input_type=str]\n    For further information visit https://errors.pydantic.dev/2.11/v/unexpected_keyword_argument"}], 'isError': True})), metadata=None) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:172)->sse_writer

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from eranco74 and jhernand July 25, 2025 20:52
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jul 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carbonin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 25, 2025

Walkthrough

The changes update the MCP server implementation to use a unified FastMCP instance, modify token extraction to use the MCP context, remove environment-based transport configuration, and simplify tool listing to an asynchronous call. Dependency requirements and deployment template parameters are also updated, and tests are refactored to match the new server structure.

Changes

File(s) Change Summary
pyproject.toml Lowered minimum required "fastmcp" version from 2.10.6 to 2.8.0.
server.py Refactored to use mcp from new import path, updated decorators, changed token extraction to use MCP context, removed transport selection, and updated app setup.
template.yaml Removed TRANSPORT parameter and its environment variable from deployment template.
tests/test_server.py Refactored tests to mock MCP context/request instead of header helper, removed intermediate MCP client calls, and simplified assertions.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant FastMCP (mcp)
    participant Server
    participant InventoryClient

    Client->>Server: HTTP Request (with headers)
    Server->>mcp: Register tool with @mcp.tool()
    Server->>mcp: Use mcp.get_context().request_context.request to access headers
    Server->>InventoryClient: Fetch cluster info (mocked in tests)
    Server->>mcp: list_tools() (async)
    Server->>mcp: sse_app() to create app
    Server->>Client: Response (via SSE)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

lgtm, approved, size/L

Suggested reviewers

  • eranco74

Poem

A hop and a skip, the server’s anew,
With MCP unified, and headers in view.
Tests now mock context, the tokens they seek,
Async tools listed, deployments less bleak.
Dependency lowered, the code hops ahead—
🐇 Onward, dear server, with confidence spread!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72430f2 and 86b6fd2.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • pyproject.toml (1 hunks)
  • server.py (17 hunks)
  • template.yaml (0 hunks)
  • tests/test_server.py (29 hunks)
💤 Files with no reviewable changes (1)
  • template.yaml
🧰 Additional context used
🧬 Code Graph Analysis (2)
server.py (2)
service_client/assisted_service_api.py (1)
  • InventoryClient (22-723)
service_client/metrics.py (3)
  • metrics (61-63)
  • track_tool_usage (43-57)
  • initiate_metrics (36-40)
tests/test_server.py (2)
server.py (15)
  • get_offline_token (46-76)
  • get_access_token (79-118)
  • cluster_info (123-145)
  • list_clusters (150-179)
  • cluster_events (184-203)
  • host_events (208-229)
  • cluster_iso_download_url (234-286)
  • create_cluster (291-337)
  • set_cluster_vips (342-372)
  • install_cluster (377-402)
  • list_versions (407-423)
  • list_operator_bundles (428-444)
  • add_operator_bundle_to_cluster (449-472)
  • set_host_role (521-544)
  • cluster_credentials_download_url (477-516)
service_client/assisted_service_api.py (14)
  • get_cluster (98-137)
  • list_clusters (139-161)
  • get_events (163-225)
  • list_infra_envs (263-298)
  • get_infra_env_download_url (682-723)
  • create_cluster (300-349)
  • create_infra_env (351-390)
  • update_cluster (392-441)
  • install_cluster (443-473)
  • get_openshift_versions (475-505)
  • get_operator_bundles (507-529)
  • add_operator_bundle_to_cluster (531-581)
  • update_host (583-630)
  • get_presigned_for_cluster_credentials (632-680)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Red Hat Konflux / assisted-service-mcp-saas-main-on-pull-request
🔇 Additional comments (6)
pyproject.toml (1)

9-9: Ensure the fastmcp downgrade is safe

We checked PyPI releases (2.8.0–2.10.6) and found no public security advisories or documented breaking changes in that range. However, please verify:

  • All code features introduced after 2.8.0 are not in use
  • No critical bug fixes or security patches in versions 2.8.1–2.10.6 are required by your changes

Add targeted tests or manual validation against 2.8.0+ to confirm compatibility.

tests/test_server.py (1)

28-35: Good refactoring of the mock fixture.

The new mock_mcp_get_context fixture properly returns a tuple containing both the context and request mocks, making it easier to access and verify header operations in tests.

server.py (4)

15-16: Import path change aligns with the revert.

The import has been changed from fastmcp to mcp.server.fastmcp, which appears to be reverting to an earlier module structure. This change is consistent with the PR objective.


68-73: Proper null checking for request context.

The token retrieval functions correctly check if the request object exists before accessing headers, preventing potential AttributeError exceptions.


547-554: Clean async wrapper implementation.

The list_tools() function properly wraps the async mcp.list_tools() call using asyncio.run(), maintaining backward compatibility while adapting to the new async API.


557-557: Simplified server initialization.

The removal of environment-based transport configuration and direct use of mcp.sse_app() aligns with the PR's goal of reverting to a simpler implementation that avoids the validation errors.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-38-MGMT-21086-support-streamable-http

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 25, 2025
@carbonin
Copy link
Copy Markdown
Collaborator Author

Tested this with chat locally and it resolves the issue with tool calls.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jul 25, 2025

@carbonin: This pull request references MGMT-21086 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

Reverts #38

In the integration environment we're seeing logs like this when tools are called:

2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Handling POST message - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:202)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Parsed session ID: c9705754-ea22-41bf-8ce2-cd20818007bc - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:218)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Received JSON: b'{"method":"tools/call","params":{"name":"list_versions","arguments":{"session_id":"1baad35c-3f97-4bb3-8d34-906a0eb0a76f"}},"jsonrpc":"2.0","id":1}' - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:231)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Validated client message: root=JSONRPCRequest(method='tools/call', params={'name': 'list_versions', 'arguments': {'session_id': '1baad35c-3f97-4bb3-8d34-906a0eb0a76f'}}, jsonrpc='2.0', id=1) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:235)->handle_post_message
2025-07-25 19:39:55,542 - mcp.server.sse - DEBUG    - 139666845583168:10 - Sending session message to writer: SessionMessage(message=JSONRPCMessage(root=JSONRPCRequest(method='tools/call', params={'name': 'list_versions', 'arguments': {'session_id': '1baad35c-3f97-4bb3-8d34-906a0eb0a76f'}}, jsonrpc='2.0', id=1)), metadata=ServerMessageMetadata(related_request_id=None, request_context=<starlette.requests.Request object at 0x7f06b546d0d0>)) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:246)->handle_post_message
INFO:     10.129.8.12:38048 - "POST /messages/?session_id=c9705754ea2241bf8ce2cd20818007bc HTTP/1.1" 202 Accepted
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Received message: <mcp.shared.session.RequestResponder object at 0x7f06b52e8550> - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:588)->run
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - INFO     - 139666845583168:10 - Processing request of type CallToolRequest - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:625)->_handle_request
2025-07-25 19:39:55,543 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Dispatching request of type CallToolRequest - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:627)->_handle_request
[07/25/25 19:39:55] ERROR    Error calling tool              tool_manager.py:193
                            'list_versions'                                    
                            ╭─ Traceback (most recent cal─╮                    
                            │ /opt/app-root/src/.venv/lib │                    
                            │ /python3.13/site-packages/f │                    
                            │ astmcp/tools/tool_manager.p │                    
                            │ y:184 in call_tool          │                    
                            │                             │                    
                            │   181 │   │   │   │   raise │                    
                            │   182 │   │   │             │                    
                            │   183 │   │   │   try:      │                    
                            │ ❱ 184 │   │   │   │   retur │                    
                            │   185 │   │   │             │                    
                            │   186 │   │   │   # raise T │                    
                            │   187 │   │   │   except To │                    
                            │                             │                    
                            │ /opt/app-root/src/.venv/lib │                    
                            │ /python3.13/site-packages/f │                    
                            │ astmcp/tools/tool.py:275 in │                    
                            │ run                         │                    
                            │                             │                    
                            │   272 │   │   │   arguments │                    
                            │   273 │   │                 │                    
                            │   274 │   │   type_adapter  │                    
                            │ ❱ 275 │   │   result = type │                    
                            │   276 │   │                 │                    
                            │   277 │   │   if inspect.is │                    
                            │   278 │   │   │   result =  │                    
                            │                             │                    
                            │ /opt/app-root/src/.venv/lib │                    
                            │ /python3.13/site-packages/p │                    
                            │ ydantic/type_adapter.py:421 │                    
                            │  in validate_python         │                    
                            │                             │                    
                            │   418 │   │   │   │   code= │                    
                            │   419 │   │   │   )         │                    
                            │   420 │   │                 │                    
                            │ ❱ 421 │   │   return self.v │                    
                            │   422 │   │   │   object,   │                    
                            │   423 │   │   │   strict=st │                    
                            │   424 │   │   │   from_attr │                    
                            ╰─────────────────────────────╯                    
                            ValidationError: 1 validation                      
                            error for call[list_versions]                      
                            session_id                                         
                              Unexpected keyword argument                      
                            [type=unexpected_keyword_argume                    
                            nt,                                                
                            input_value='1baad35c-3f97-4bb3                    
                            -8d34-906a0eb0a76f',                               
                            input_type=str]                                    
                                For further information                        
                            visit                                              
                            https://errors.pydantic.dev/2.1                    
                            1/v/unexpected_keyword_argument                    
2025-07-25 19:39:56,230 - mcp.server.lowlevel.server - DEBUG    - 139666845583168:10 - Response sent - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/lowlevel/server.py:668)->_handle_request
2025-07-25 19:39:56,231 - mcp.server.sse - DEBUG    - 139666845583168:10 - Sending message via SSE: SessionMessage(message=JSONRPCMessage(root=JSONRPCResponse(jsonrpc='2.0', id=1, result={'content': [{'type': 'text', 'text': "Error calling tool 'list_versions': 1 validation error for call[list_versions]\nsession_id\n  Unexpected keyword argument [type=unexpected_keyword_argument, input_value='1baad35c-3f97-4bb3-8d34-906a0eb0a76f', input_type=str]\n    For further information visit https://errors.pydantic.dev/2.11/v/unexpected_keyword_argument"}], 'isError': True})), metadata=None) - (/opt/app-root/src/.venv/lib/python3.13/site-packages/mcp/server/sse.py:172)->sse_writer

Summary by CodeRabbit

  • Refactor

  • Unified and simplified server implementation, including changes to server instance usage, token header access, tool listing, and server startup process.

  • Removed transport parameter configuration from deployment template.

  • Updated and streamlined tests to use direct server function calls and improved mocking of request context.

  • Chores

  • Lowered the minimum required version of a core dependency.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@eranco74
Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2025
@openshift-merge-bot openshift-merge-bot Bot merged commit c2a6a7d into master Jul 26, 2025
23 checks passed
@carbonin carbonin deleted the revert-38-MGMT-21086-support-streamable-http branch July 28, 2025 12:21
@coderabbitai coderabbitai Bot mentioned this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants