Skip to content

feat: per-agent MCP config and auto-detect transport#1232

Open
napter wants to merge 1 commit intoagent0ai:mainfrom
napter:feat/mcp-improvements
Open

feat: per-agent MCP config and auto-detect transport#1232
napter wants to merge 1 commit intoagent0ai:mainfrom
napter:feat/mcp-improvements

Conversation

@napter
Copy link

@napter napter commented Mar 9, 2026

Summary

This PR introduces two improvements to MCP (Model Context Protocol) handling:

1. Per-agent MCP configuration

Subordinate agents can now have their own dedicated MCP server configurations instead of sharing the global singleton. This enables hub-spoke architectures where different agent profiles connect to different MCP servers.

Changes:

  • Added get_agent_mcp_config() function with per-config caching in mcp_handler.py
  • Updated agent.py to use agent-aware MCP resolution
  • Updated _10_system_prompt.py to use agent-aware MCP config for tool prompts
  • Added get_profile_settings() in settings.py for loading per-profile settings overrides

2. MCP auto-detect transport

Remote MCP servers now default to auto transport type instead of sse. In auto mode, the client tries streamable HTTP first and falls back to SSE if that fails. This provides better compatibility with modern MCP servers.

Changes:

  • Default transport type changed from sse to auto
  • Added auto-detection logic with streamable HTTP → SSE fallback
  • Added informative logging for transport selection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant