Skip to content

Conversation

@danny-avila
Copy link
Owner

Summary

I refactored the MCP (Model Context Protocol) UI visibility logic to conditionally display the interface only when MCP servers are configured, and ensured the backend doesn't send empty configuration objects.

  • Modified the config route to conditionally initialize mcpServers object only when actual server configurations exist
  • Added startupConfig to the AgentPanelContext provider's value for component access
  • Included startupConfig type definition in the AgentPanelContextType interface
  • Relocated MCP Tools section in AgentConfig component to appear after Knowledge section
  • Wrapped MCP Tools component with conditional rendering based on startupConfig?.mcpServers existence
  • Prevented sending empty MCP configuration objects from the backend when no servers are configured

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Testing

Test the changes by:

  1. Starting the application with no MCP servers configured in the environment
  2. Verify that the MCP Tools section doesn't appear in the Agent configuration panel
  3. Configure MCP servers in your environment/config
  4. Restart the application and verify the MCP Tools section now appears
  5. Check the network response from /api/config to ensure mcpServers field is absent when no servers are configured

Test Configuration:

  • Test with and without MCP server configurations
  • Verify UI rendering in Agent panel for both scenarios

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings

@danny-avila danny-avila merged commit a4a174b into dev Sep 5, 2025
7 checks passed
@danny-avila danny-avila deleted the refactor/mcp-agents-only-if-configured branch September 5, 2025 16:28
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.

[Enhancement]: Make "Add MCP Server Tools" in agent UI configurable as a capability

2 participants