MCP server config + builtin server infrastructure#583
Open
NamN8Tr wants to merge 8 commits into
Open
Conversation
Config-driven and builtin MCP server support for agents: - base_react: get_mcp_servers_config() merges an agent's BUILTIN_MCP_SERVERS with deployment-config servers; _build_mcp_tools passes them through and skips cleanly when none are configured. - tools/mcp: initialize_mcp_client accepts explicit server definitions. - cms_comp_ops_agent: BUILTIN_MCP_SERVERS hook (submit_status example). - templates_manager + base-compose: bind-mount host files for stdio MCP servers and mount ~/.ssh into the chat container. - Dockerfile-chat(-gpu): install openssh-client for SSH-based servers. - examples/agents: submit-cluster agent + mcp tool on cms-comp-ops. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lucalavezzo
reviewed
Jun 22, 2026
Collaborator
There was a problem hiding this comment.
this should be in a submit specific repo
lucalavezzo
reviewed
Jun 22, 2026
Collaborator
There was a problem hiding this comment.
please don't modify this either
lucalavezzo
reviewed
Jun 22, 2026
Collaborator
There was a problem hiding this comment.
please remove the builtin mcp servers
langchain-mcp-adapters (0.1.11) sets each tool's to the MCP server's raw JSON-schema dict rather than a pydantic model. langchain-core (1.2.13) then calls on it; for a non-pydantic input that helper recurses on , which for a dict (then None) never terminates -> RecursionError on every MCP tool call. It's caught and logged at DEBUG, so it's non-fatal, but it burns ~1000 stack frames per call and floods the logs. Install a guarded at MCP-client init that adds the missing base case: a non-type with no generic origin returns no annotations instead of recursing. Real pydantic args_schema models are unaffected. The patch is idempotent and applies to all MCP tools.
All MCP tools share one client/session on a single background loop, so concurrent calls (when the model emits parallel tool calls) corrupt response routing and leak server-side connections. Hold a lock in the sync wrapper so they run one at a time. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MCP servers can be declared in a .mcp.json file next to the deployment config
(the project-scoped format Claude Code uses), instead of or alongside the YAML
mcp_servers: block:
- src/utils/mcp_json.py owns the format: parses {"mcpServers": ...}, maps
Claude 'type' (stdio/http/sse) onto langchain transports (http ->
streamable_http), infers type from command/url when omitted, validates
per-transport required fields, drops '_'-prefixed comment keys, and passes
archi-only fields (path, host_file_mounts, env_from_secrets, build_context,
image, skill) through so one file serves both archi and Claude Code.
- ConfigurationManager discovers .mcp.json beside each config file (or the file
named by an explicit mcp_servers_file: key) and merges it into
config['mcp_servers']; YAML entries win on name collision (warned).
- ${VAR} / ${VAR:-default} placeholders are expanded at connect time in
initialize_mcp_client against the container env, before the stdio os.environ
merge; an unset variable without default disables that server with a logged
error.
- base-config template renders 'headers' so HTTP auth survives into the seeded
runtime config.
- 19 unit tests (loader, expansion, merge precedence) + docs section.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a runtime MCP server registry and a Settings -> MCP servers panel so users can view, connect, reconnect, inspect, and remove MCP servers without redeploying. Servers are split into Deployment (read-only, from the deployment config) and User (added at runtime) sections; each server's status is a single pill (green Connected / red Disconnected, click to reconnect), and its config + full tool list open in a detail window with a back arrow. - src/utils/mcp_server_registry.py: whitelisted runtime server store (HTTP/SSE only; stdio and deploy-time fields rejected). - tools/mcp.py: get_effective_mcp_servers (config + runtime merge), per-server probe, and last-build status for the UI. - base_react.py: agents load the effective server set and can reset cached MCP tools when the runtime set changes. - app.py: /api/mcp/servers CRUD + per-server reconnect endpoints. - frontend (chat.js/chat.css, index.html): the Settings MCP panel. Reachable via the Settings gear; the /mcp slash command is intentionally not ported (this branch has no command palette). Registry unit tests: 19 passing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Config-driven and builtin MCP server support for agents: