deerflow2/tests/unit
Willem Jiang 612bddd3fb
feat(server): add MCP server configuration validation (#830)
* feat(server): add MCP server configuration validation

Add comprehensive validation for MCP server configurations,
inspired by Flowise's validateMCPServerConfig implementation.

MCPServerConfig checks implemented:
- Command allowlist validation (node, npx, python, docker, uvx, etc.)
- Path traversal prevention (blocks ../, absolute paths, ~/)
- Shell command injection prevention (blocks ; & | ` $ etc.)
- Dangerous environment variable blocking (PATH, LD_PRELOAD, etc.)
- URL validation for SSE/HTTP transports (scheme, credentials)
- HTTP header injection prevention (blocks newlines)

* fix the unit test error of test_chat_request

* Added the related path cases as reviewer commented

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-24 17:32:17 +08:00
..
agents fix: migrate from deprecated create_react_agent to langchain.agents.create_agent (#802) 2026-01-07 09:06:16 +08:00
checkpoint Fixes(unit-test): the unit tests error of recent change of #816 (#826) 2026-01-22 09:17:14 +08:00
config fix: handle false values correctly in (#823) 2026-01-21 09:33:20 +08:00
crawler feat: support infoquest (#708) 2025-12-02 08:16:35 +08:00
eval feat(eval): add report quality evaluation module and UI integration (#776) 2025-12-25 21:55:48 +08:00
graph fix: migrate from deprecated create_react_agent to langchain.agents.create_agent (#802) 2026-01-07 09:06:16 +08:00
llms fix(llm): filter unexpected config keys to prevent LangChain warnings (#411) (#726) 2025-11-29 16:13:05 +08:00
podcast fix(podcast): add fallback for models without json_object support (#747) (#785) 2025-12-26 23:04:20 +08:00
prompt_enhancer Upgrade langchain version to 1.x (#720) 2025-11-28 22:09:13 +08:00
rag refactor: Refactors the retriever function to use async/await (#821) 2026-01-20 19:56:26 +08:00
server feat(server): add MCP server configuration validation (#830) 2026-01-24 17:32:17 +08:00
tools feat(context): decrease token in web_search AIMessage (#827) 2026-01-23 08:31:48 +08:00
utils feat(context): decrease token in web_search AIMessage (#827) 2026-01-23 08:31:48 +08:00