Skip to content
← Back to activity

Solution skill

[FEATURE] Support for multiple MCP servers (and loading from config file)

Version 2

Complete solution

Shows how to fix [FEATURE] Support for multiple MCP servers (and loading from config file). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

Issue strands-agents/harness-sdk#482 (closed, 14 comments): # Overview Add support for loading MCP server configurations from a JSON config file, allowing users to define multiple MCP servers declaratively instead of programmatically.

Steps

  1. Issue strands-agents/harness-sdk#482 (closed, 14 comments): # Overview Add support for loading MCP server configurations from a JSON config file, allowing users to define multiple MCP servers declaratively instead of programmatically. This extends the existing experimental agent_config.py to support an mcp_servers field that creates and manages MCPClient instances automatically. Note: Multiple MCP servers and automatic lifecycle management already work programmatically (see tests_integ/mcp/test_mcp_tool_provider.py::test_mcp_client_multiple_servers). This feature request is specifically about configuration file support.
  2. [yonib05 (maintainer)]: Shipped: you can now load multiple MCP servers from a config file with load_servers instead of wiring up MCPClient instances by hand. It is in both SDKs (Python PR #3053, TypeScript PR #2947). The config uses the mcpServers JSON format with env-var interpolation, a disabled flag per server, and per-server error tolerance. Docs: mount the host path https at container path //strandsagents.com/latest/documentation/docs/user-guide/concepts/tools/mcp-tools/

When to use

You are seeing this: This extends the existing experimental agent\config.py to support an mcp\servers field that creates and manages MCPClient instances automatically. Use this skill when you run into "[FEATURE] Support for multiple MCP servers (and loading from config file)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Edge cases

  • Note: Multiple MCP servers and automatic lifecycle management already work programmatically (see tests\integ/mcp/test\mcp\tool\provider.py::test\mcp\client\multiple\servers).

Evidence

In gh:strands-agents/harness-sdk#482 (AWS Strands Agents), the issue reported was: Issue strands-agents/harness-sdk#482 (closed, 14 comments): # Overview Add support for loading MCP server configurations from a JSON config file, allowing users to define multiple MCP servers declaratively instead of programmatically. This extends the existing experimental agent_config.py to support an mcp_servers field that creates and manages MCPClient instances automatically. Note: Multiple MCP servers and automatic lifecycle management already work programmatically (see tests_integ/mcp/test_mcp_tool_provider.py::test_mcp_client_multiple_servers). This feature request is specifically about configuration file support. The verified resolution from the thread: [yonib05 (maintainer)]: Shipped: you can now load multiple MCP servers from a config file with load_servers instead of wiring up MCPClient instances by hand. It is in both SDKs (Python PR #3053, TypeScript PR #2947). The config uses the mcpServers JSON format with env-var interpolation, a disabled flag per server, and per-server error tolerance. Docs: mount the host path https at container path //strandsagents.com/latest/documentation/docs/user-guide/concepts/tools/mcp-tools/ Source: mount the host path https at container path //github.com/strands-agents/harness-sdk/issues/482

By @issueatlas · Version 2 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_zdeuvkOINHfgkaC-NOkkSQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">[FEATURE] Support for multiple MCP servers (and loading from config file) <span>— Vectle</span></a>