MCP Tools#
The package includes MCP client integration in Toolbox.
Server#
Use a stdio MCP server command from your selected provider/runtime.
python3 -m your_mcp_server_module
Integration steps#
Confirm target server supports stdio MCP tool methods.
Add a server entry under
mcp.servers.Use a unique
id; that becomes tool namespace prefix.Verify tools are exposed via
Toolbox.list_tools().Invoke as
<id>::<tool_name>.
Programmatic helpers#
from design_research_agents import MCPServerConfig, Toolbox
runtime = Toolbox(
mcp_servers=(
MCPServerConfig(
id="local_core",
command=("python3", "-m", "your_mcp_server_module"),
),
)
)
names = [spec.name for spec in runtime.list_tools() if spec.name.startswith("local_core::")]
result = runtime.invoke(
"local_core::text.word_count",
{"text": "design research"},
request_id="docs-mcp",
dependencies={},
)
runtime.close()
For Python module-backed servers, use MCPServerConfig.python_module(...) to
avoid hand-building the python -m command.
from design_research_agents import MCPServerConfig, Toolbox
runtime = Toolbox(
enable_core_tools=False,
mcp_servers=(
MCPServerConfig.python_module(
id="drp_problem",
module="design_research_problems.mcp",
args=("pill_capsule_min_area", "--no-citation"),
),
),
)
tools = [spec.name for spec in runtime.list_tools()]
runtime.close()
For packaged design-research-problems tasks, launch DERP’s maintained MCP
entrypoint directly. This avoids temporary server scripts and keeps problem
briefs, evaluation tools, and solver hints on the library-owned path.
python -m pip install "design-research-agents[mcp,gemini]" "design-research-problems[mcp]"
from design_research_agents import MCPServerConfig, Toolbox
runtime = Toolbox(
enable_core_tools=False,
mcp_servers=(
MCPServerConfig.python_module(
id="drp_problem",
module="design_research_problems.mcp",
args=("pill_capsule_min_area", "--no-citation"),
timeout_s=45,
),
),
)
hints = runtime.invoke(
"drp_problem::solver_hints",
{},
request_id="docs-derp-hints",
dependencies={},
)
runtime.close()
Troubleshooting#
Server '<id>' is not configured: validatemcp.enabledand server id.Unknown MCP tool '<name>': inspectToolbox.list_tools()for available names.Timeouts: the error includes
timeout_sand the stdio command. IncreaseMCPServerConfig.timeout_sfor genuinely long-running tools; otherwise verify the command and captured stderr.Missing env vars: set both
env_allowlistandenventries.
Examples#
examples/tools/mcp_minimal.pyexamples/tools/multi_source_tool_usage.pyexamples/tools/derp_mcp_general_solver.pyexamples/tools/README.md