Tool Use & Environment

MCP Bidirectional Bridge

Run a framework as both MCP client (consuming external MCP servers as tools) and MCP server (publishing its own agents, tools, and workflows back over MCP) so capabilities flow both directions across the protocol boundary.

Problem

A framework that only acts as an MCP client can consume external capabilities but cannot expose its own agents and workflows to peers, locking its value inside its own runtime. A framework that only acts as an MCP server can be called from outside but cannot integrate external MCP tools without writing per-vendor adapters. Either asymmetry forces teams to commit to one framework and rewrite integrations whenever they want to combine its agents with another system, defeating the point of having a shared protocol.

Solution

Build the framework with two symmetric MCP modules: a client module that lets agents call external MCP servers as tools (with auth, schema validation, and elicitation handling), and a server module that publishes internal artefacts — typically agents, tools, workflows, prompts, and resources — over MCP for external consumers. Treat the two as one architectural decision, not two: the same registry should describe both what the framework consumes and what it offers. Pair with mcp (the underlying protocol), mcp-as-code-api (code-as-import variant), and tool-agent-registry. The bridge is also a useful anti-lock-in stance — see vendor-lock-in.

When to use

  • The framework participates in a heterogeneous MCP ecosystem.
  • Internal artefacts (agents, workflows, prompts) should be reusable by external MCP clients.
  • Anti-lock-in stance is part of the product positioning.
  • External capabilities arrive through MCP rather than vendor SDKs.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related