A proper way to set MCP_CONFIG
Author: omdvCreated Oct 16, 2025Updated Jul 6, 2026
Does the current code support setting MCP_CONFIG through environment vars or only via Langchain studio?
Suppose I set export MCP_CONFIG='{"url": "http://localhost:8000/mcp", "auth_required": "false"}'. After submitting any prompt I get the error Input should be a valid dictionary or instance of MCPConfig [type=model_type, input_value='{"url": "http://localhos...uth_required": "false"}', input_type=str].
It is actually expected, because MCPConfig is an instance of BaseModel and the string will need to be decoded first. The right approach would be to use BaseSettings, which will automatically parse json string.
Is this the intended behavior?
Source: langchain-ai/open_deep_research