qwen-code/docs/developers/tools
Edenman 6c999fe29f
feat(cli): add OAuth configuration flags to mcp add (#3442)
* feat(cli): Add OAuth redirect URI support to  command

- Add --oauth-redirect-uri, --oauth-client-id, --oauth-client-secret,
  --oauth-authorization-url, --oauth-token-url, and --oauth-scopes flags
  to the  command
- Enable configuration of custom OAuth redirect URIs for remote/cloud
  server deployments (fixes hardcoded localhost issue)
- Document auth.redirectUri in both developer and user-facing MCP docs
- Add comprehensive tests for OAuth configuration via CLI
- Update documentation with examples and guidance for remote deployments

Fixes #3336

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* refactor(cli): harden OAuth flag handling in mcp add

- Reject combining --oauth-* flags with --transport stdio to surface the
  mistake instead of silently persisting an unused oauth config
- Rebuild OAuth config via single spread expression; drop the prior
  mutate-then-check pattern and the post-hoc enabled assignment
- Trim each scope token after comma split so "read, write" no longer
  stores leading/trailing whitespace
- Cover both new behaviors with tests; add missing --oauth-client-secret
  row and stdio-incompatibility note to the user MCP docs

* test(cli): use explicit Vitest/Yargs type imports in mcp add tests

Switch from namespace-style 'vi.Mock' and 'yargs.Argv' references to
explicit 'Mock' and 'Argv' imports, and replace the narrow
'(code?: number) => never' cast on the process.exit mock with
'typeof process.exit' so it tracks the current Node signature.

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-20 14:12:17 +08:00
..
_meta.ts feat(core): add dynamic swarm worker tool (#3433) 2026-04-19 14:46:59 +08:00
exit-plan-mode.md feat: update docs 2025-12-15 09:47:03 +08:00
file-system.md docs(tools): document file encoding and platform-specific behavior 2026-03-16 23:03:50 +08:00
introduction.md feat(core): add dynamic swarm worker tool (#3433) 2026-04-19 14:46:59 +08:00
mcp-server.md feat(cli): add OAuth configuration flags to mcp add (#3442) 2026-04-20 14:12:17 +08:00
multi-file.md feat: restructure docs 2025-12-04 18:26:05 +08:00
sandbox.md Merge branch 'main' into feat/sandbox-config-improvements 2026-03-06 14:38:39 +08:00
shell.md docs(shell): clarify enableInteractiveShell default behavior 2026-03-13 17:16:47 +08:00
swarm.md feat(core): add dynamic swarm worker tool (#3433) 2026-04-19 14:46:59 +08:00
task.md feat: update docs 2025-12-15 09:47:03 +08:00
todo-write.md feat: update docs 2025-12-15 09:47:03 +08:00
web-fetch.md feat(tools): add Markdown for Agents support to WebFetch tool (#2734) 2026-04-19 17:23:09 +08:00
web-search.md feat(auth): discontinue Qwen OAuth free tier (2026-04-15 cutoff) (#3291) 2026-04-15 22:30:20 +08:00