embabel-agent icon indicating copy to clipboard operation
embabel-agent copied to clipboard

Allow selective configuration of MCP servers when using @EnableAgents annotation

Open alexheifetz opened this issue 4 months ago • 1 comments

Allow selective configuration of MCP servers when using @EnableAgents annotation

Description

Currently, when using @EnableAgents(mcpServers = {McpServers.DOCKER}), the framework automatically spins up multiple MCP servers (github, google-maps, etc.) that may not be needed for a specific application context. This creates unnecessary resource overhead and potential security surface area.

Current Behavior

  • @EnableAgents with McpServers.DOCKER enables all available MCP servers by default
  • No mechanism exists to disable unwanted servers
  • Configuration only allows adding additional servers via embabel.agent.platform.tools.includes

Desired Behavior

Provide configuration options to:

  1. Exclude specific servers: Allow developers to disable unwanted MCP servers
  2. Include-only mode: Allow specifying only the required servers instead of defaulting to all
  3. Maintain backward compatibility: Existing configurations should continue working

Business Value

  • Reduced resource consumption for applications that only need specific MCP capabilities
  • Improved security posture by minimizing exposed services
  • Better alignment with Domain Driven Design principles of explicit bounded context configuration
  • Enhanced developer experience through granular control

Acceptance Criteria

  • [ ] Developers can exclude specific MCP servers from the default set
  • [ ] Developers can specify an include-only list of required servers
  • [ ] Existing applications using current configuration continue to work unchanged
  • [ ] Configuration follows Spring Framework conventions for consistency

Additional Context

As noted by @springrod, currently there is no way to disable servers you don't need, although they will not be exposed to actions unless explicitly requested. The framework should make the entire MCP server selection configurable.

alexheifetz avatar Oct 01 '25 16:10 alexheifetz

@jamesward, your contributions are welcome.

alexheifetz avatar Oct 01 '25 16:10 alexheifetz