-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
[Frontend] Responses API MCP tools for built in tools and to pass through headers #24628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yeqcharlotte
merged 14 commits into
vllm-project:main
from
alecsolder:builtin_mcp_tools_with_headers
Sep 22, 2025
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e6ad3ae
Adding the ability to use MCP tools for built in tools to pass throug…
69b7e04
Adding one unit test which works locally, fixing type to name transla…
f0553be
Removing log line
94162b0
Enabling oss coding tool for tests
103f6d9
Merge branch 'main' into builtin_mcp_tools_with_headers
alecsolder 8bc171d
adding the skip back
aa572f5
Moving MCP tests to separate file, adding env variable for allowing m…
12f67da
Merge branch 'main' into builtin_mcp_tools_with_headers
alecsolder dd50bda
Merge branch 'main' into builtin_mcp_tools_with_headers
yeqcharlotte 0bd5e53
Fixing nits and adding env variable validation
da6d8a5
Merge branch 'main' into builtin_mcp_tools_with_headers
alecsolder 823414a
Adding tests for env variable parsing
d247304
Merge branch 'main' into builtin_mcp_tools_with_headers
alecsolder 175a77c
Merge branch 'main' into builtin_mcp_tools_with_headers
yeqcharlotte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -453,8 +453,12 @@ async def responses_full_generator( | |
|
|
||
| async with AsyncExitStack() as exit_stack: | ||
| try: | ||
| mcp_tools = { | ||
| tool.server_label: tool | ||
| for tool in request.tools if tool.type == "mcp" | ||
| } | ||
| await context.init_tool_sessions(self.tool_server, exit_stack, | ||
| request.request_id) | ||
| request.request_id, mcp_tools) | ||
| async for _ in result_generator: | ||
| pass | ||
| except asyncio.CancelledError: | ||
|
|
@@ -728,9 +732,13 @@ def _construct_input_messages_with_harmony( | |
| # New conversation. | ||
| reasoning_effort = (request.reasoning.effort | ||
| if request.reasoning else None) | ||
| # Temporary: OpenAI types doesn't have container tool | ||
| # so we used MCP to cover that, up for change | ||
| tool_types = [tool.type for tool in request.tools] | ||
| # If there is a MCP tool with a matching server_label, then | ||
| # the tool is enabled. Native types like code_interpreter work | ||
| # as well | ||
| tool_types = [ | ||
| tool.server_label if tool.type == "mcp" else tool.type | ||
| for tool in request.tools | ||
| ] | ||
|
||
| if envs.VLLM_GPT_OSS_USE_CONTAINER_TOOL: | ||
| tool_types.append("container") | ||
| enable_browser = ("web_search_preview" in tool_types | ||
|
|
@@ -1654,8 +1662,12 @@ def _increment_sequence_number_and_return(event: T) -> T: | |
| async with AsyncExitStack() as exit_stack: | ||
| processer = None | ||
| if self.use_harmony: | ||
| mcp_tools = { | ||
| tool.server_label: tool | ||
| for tool in request.tools if tool.type == "mcp" | ||
| } | ||
| await context.init_tool_sessions(self.tool_server, exit_stack, | ||
| request.request_id) | ||
| request.request_id, mcp_tools) | ||
| processer = self._process_harmony_streaming_events | ||
| else: | ||
| processer = self._process_simple_streaming_events | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also add some unit tests coverage tool server init logic for mcp tool