#5721 [GUI] Fix MCP tool forwarding in Desktop Serving API

open · @vladare · 0 コメント · GitHub で見る

Server & APISecurity

本文

### Summary

Fixes #5661.

The Desktop Serving API previously forced `strata_mcp: false`, preventing external clients from invoking configured MCP tools.

This patch preserves explicit boolean opt-in when forwarding chat completion requests to the engine.

### Changes

- Forward `strata_mcp: true` only when explicitly requested.
- Preserve default MCP-disabled behavior.
- Update gateway regression tests.
- Leave the existing MCP engine implementation unchanged.

### Verification

Gateway tests (`node --test tests/native-gateway.test.mjs` in `apps/host`): 5 passed, 0 failed.

Full desktop host suite (`node scripts/test.mjs` in `apps/host`): 876 passed, 117 failed, 106 skipped. The full suite did not pass. The 117 failures were `Cannot find package 'esbuild'` while loading unrelated UI tests. The 106 skips require `STRATA_HARNESS_DIR`. Neither result is caused by this change.

Manual validation:

- Filesystem MCP successfully accessed and read a local file.
- SearXNG MCP successfully returned web search results through the external API.

### Compatibility and Security

Existing requests without `strata_mcp: true` retain their previous behavior.

Explicitly enabling MCP allows clients with Serving API access to execute configured MCP tools, including potentially filesystem tools. This changes the existing gateway security policy and should be reviewed by the maintainer.

関連リンク

インストール・モデル・リリースへのサイト内リンク。