Skip to content

feat: hide MCP list tools#60

Open
csush wants to merge 3 commits into
mainfrom
feat/hide-mcp-list-tools
Open

feat: hide MCP list tools#60
csush wants to merge 3 commits into
mainfrom
feat/hide-mcp-list-tools

Conversation

@csush
Copy link
Copy Markdown

@csush csush commented May 21, 2026

  • keep MCP list-tools calls internal
  • prevent mcp_list_tools from streaming or final response output
  • remove demo rendering for MCP tool lists

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@csush csush changed the title Hide MCP list tools fix: hide MCP list tools May 21, 2026
@csush csush changed the title fix: hide MCP list tools feat: hide MCP list tools May 21, 2026
@csush csush requested a review from Copilot May 22, 2026 07:20
@csush csush requested a review from a team May 22, 2026 07:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the MCP integration so that mcp_list_tools is used strictly for internal orchestration (tool discovery) and is no longer emitted as streamed events or included in the final response.output. The demo UI is also adjusted to stop rendering MCP tool-list output.

Changes:

  • Replace streaming listMcpToolsStream with an internal listMcpTools function that returns tool metadata without emitting response output/events.
  • Update server-side and integration tests to assert mcp_list_tools is not present in response output.
  • Remove demo-side rendering/types for MCP tool-list output items.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/responses.test.js Updates assertions to ensure mcp_list_tools never appears in final outputs.
src/routes/responses/mcpStream.ts Converts tool listing from a streamed output item to an internal-only async function.
src/routes/responses/mcpStream.test.ts Updates tests for the new internal listMcpTools behavior.
src/routes/responses/innerStream.ts Switches orchestration to call listMcpTools without emitting output items/events.
src/routes/responses/innerStream.test.ts Updates MCP stream mocking to the new function name.
src/routes/responses/closeOutputItem.ts Updates comment to reflect list-tools output is internal-only.
demo/lib/assistant.ts Removes demo types/handling for mcp_list_tools output items.
demo/components/chat.tsx Stops rendering MCP tool-list UI in the chat component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread demo/lib/assistant.ts
@@ -61,7 +54,7 @@ export interface McpApprovalRequestItem {
arguments?: string;
}

Copy link
Copy Markdown
Collaborator

@frac frac May 27, 2026

Choose a reason for hiding this comment

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

@copilot Remove it from the demo, importing *.ts is a bad practice anyway.

Comment on lines 74 to 85
(connectMcpServer as ReturnType<typeof vi.fn>).mockResolvedValue(mockClient);

const responseObject = createMockResponseObject();
const events = await collectEvents(listMcpToolsStream(mcpTool, responseObject, traceContext, log));
const types = events.map((e) => e.type);
const result = await listMcpTools(mcpTool, traceContext, log);

expect(types).toEqual([
"response.output_item.added",
"response.mcp_list_tools.in_progress",
"response.mcp_list_tools.completed",
"response.output_item.done",
]);
expect(types.filter((t) => t === "response.output_item.done")).toHaveLength(1);
expect(result).toMatchObject({
type: "mcp_list_tools",
server_label: "test-server",
tools: [{ name: "search", input_schema: { type: "object" }, description: "Search tool" }],
});
expect(responseObject.output).toEqual([]);
});
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