Skip to content

Proposal: Enabling MCP Toolbox for Databases as Both MCP Server and MCP Client #715

@tuannvm

Description

@tuannvm

Prerequisites

What are you trying to do that currently feels hard or impossible?

Overview

Currently, the MCP Toolbox for Databases acts solely as an MCP server, exposing tools to clients (such as IDEs or agent frameworks) via the MCP protocol. To maximize flexibility and composability, we propose extending the Toolbox to also function as an MCP client. This will allow it to dynamically connect to other MCP servers, aggregate their tools, and expose them as a unified toolset to its own clients. This dual role enables federated tool management, cross-organization sharing, and dynamic tool composition.

Suggested Solution(s)

Key Features

1. MCP Client Mode

  • Configurable MCP Servers: Administrators can specify a list of remote MCP servers (with endpoints and credentials) that the Toolbox should connect to as a client.
  • Dynamic Tool Loading: The Toolbox will periodically (or on-demand) fetch tool definitions from these remote MCP servers and merge them into its own tool registry.
  • Conflict Resolution: If tool names or IDs collide, configurable strategies (e.g., namespacing, override, or ignore) can be applied.

2. MCP Server Mode (Saver)

  • Unified Tool Exposure: The Toolbox continues to expose all locally defined tools, plus any tools dynamically loaded from remote MCP servers, to its own clients.
  • Tool Source Metadata: Each tool exposed includes metadata indicating its origin (local or remote MCP server).
  • Proxying/Delegation: When a client invokes a remote tool, the Toolbox proxies the request to the appropriate upstream MCP server and returns the result.

3. Administration

  • Configuration File Extension: The tools.yaml (or a new mcp_clients.yaml) will include a section for remote MCP server definitions.
  • Health Checks & Failover: The Toolbox monitors connectivity to remote MCP servers and can gracefully degrade if a remote server is unavailable.
  • Security: Support for authentication, authorization, and optional filtering of which remote tools are exposed.

Sequence Diagram

Below is a sequence diagram illustrating the interaction when the Toolbox acts as both MCP client and server.

sequenceDiagram
    participant Admin
    participant Toolbox
    participant MCP_A
    participant MCP_B
    participant Client

    %% Admin configures Toolbox as MCP client
    Admin->>Toolbox: Configure remote MCP servers (MCP_A, MCP_B)

    %% Toolbox fetches tool lists from remote MCP servers
    Toolbox->>MCP_A: Fetch tool list
    Toolbox->>MCP_B: Fetch tool list
    MCP_A-->>Toolbox: Return tool definitions (A1, A2)
    MCP_B-->>Toolbox: Return tool definitions (B1, B2)

    %% Toolbox merges local and remote tools
    Toolbox->>Toolbox: Merge local and remote tools

    %% Client requests available tools from Toolbox
    Client->>Toolbox: List available tools
    Toolbox-->>Client: Return unified tool list (Local, A1, A2, B1, B2)

    %% Client invokes a remote tool via Toolbox
    Client->>Toolbox: Invoke remote tool (A1)
    Toolbox->>MCP_A: Proxy tool invocation (A1)
    MCP_A-->>Toolbox: Return result
    Toolbox-->>Client: Return result

Loading

Example Configuration

# tools.yaml
...
mcp_clients:
  - name: remote-mcp-a
    endpoint: https://mcp-a.example.com
    api_key: "secret"
    toolset: "default"
  - name: remote-mcp-b
    endpoint: https://mcp-b.example.com
    api_key: "secret"
    toolset: "analytics"
...

Benefits

  • Federation: Aggregate tools from multiple MCP servers, enabling cross-team or cross-org collaboration.
  • Dynamic Composition: Add or remove tool sources without redeploying clients.
  • Centralized Control: Administrators can curate which remote tools are exposed to local clients.
  • Scalability: Enables hierarchical or mesh-like MCP topologies for large organizations.

Implementation Considerations

  • Caching: Optionally cache remote tool definitions for performance and resilience.
  • Tool Invocation Routing: Clearly distinguish between local and remote tool invocations for logging and error handling.
  • Security: Ensure secure communication (TLS, authentication) between Toolbox and remote MCP servers.
  • Extensibility: Design the MCP client interface to support future protocols or authentication schemes.

Metadata

Metadata

Assignees

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions