feat(mcp): support tool-level directTools array and 3-state UI configuration (#297)

* feat(mcp): support tool-level directTools array and 3-state UI configuration

* refactor(mcp): refine tool hint explanation and separate server instructions block

* style(mcp): display tool count in header title and split option hints into 3 lines

* style(mcp): update tools description paragraph and place bulk buttons on a separate row

* fix(mcp): enforce excludeTools in proxy path and align direct-tool counts

- Filter the per-agent tool registry by excludeTools at build time (DB cache
  and lazy-connect paths), so excluded tools are unreachable through the mcp
  proxy (call, search, list, describe) — matching pi-mcp-adapter where
  isToolAllowed gates both direct and gateway exposure.
- Add shared isDirectTool predicate (matches original or prefixed name) used
  by both buildDirectTools and the proxy description counts, so the
  advertised direct/proxy counts can no longer drift from actual
  registration; toolCount now reflects allowed tools only.
- Remove the legacy boolean directTools branch (no legacy data exists).
- Drop the now-unused mcp_excluded_tools_hint i18n key and regenerate
  Paraglide messages.
- Extend unit tests: excluded tools are not counted, listed, searched, or
  callable via the proxy; prefixed-name directTools configs count correctly.
This commit is contained in:
Yiling-J
2026-08-11 15:43:27 +08:00
committed by GitHub
parent 82aee9a291
commit 851ae49c84
33 changed files with 661 additions and 587 deletions
+1 -1
View File
@@ -259,7 +259,7 @@ describe.each(['local', 'temporal'] as const)('Workflow E2E - MCP tools (executo
it('runs a chat with direct-tools mode (server-prefixed native tools)', async () => {
const { team, project, agentUser, asset, regularUser } = await seedChatSetup()
await createMcpServerAndAssign(team.id, agentUser.id, { directTools: true })
await createMcpServerAndAssign(team.id, agentUser.id, { directTools: ['echo'] })
// For direct mode the model would call `e2e_mcp_echo` directly; simulate
// that by executing the direct tool on the harness.