Use FlashMCP to act as an intermediary or change transport for other MCP servers.
New in version: 2.0.0
FlashMCP provides a powerful proxying capability that allows one FlashMCP server instance to act as a frontend for another MCP server (which could be remote, running on a different transport, or even another FlashMCP instance). This is achieved using the FlashMCP.as_proxy()
class method.
as_proxy()
accepts either an existing Client
or any argument that can be passed to a Client
as its transport
parameter—such as another FlashMCP
instance, a URL to a remote server, or an MCP configuration dictionary.
tools/call
or resources/read
), it forwards that request to a backend MCP server, receives the response, and then relays that response back to the original client.
FlashMCPProxy
).FlashMCP.as_proxy()
class method. This creates a standard FlashMCP server that forwards requests to another MCP server.
as_proxy
Works:
FlashMCP
server instance that can be used like any other.FlashMCP
instance, which is useful for adjusting the configuration or behavior of a server you don’t completely control.
New in version: 2.3.6
You can create a proxy directly from a configuration dictionary that follows the MCPConfig schema. This is useful for quickly setting up proxies to remote servers without manually configuring each connection detail.
FlashMCPProxy
ClassFlashMCP.as_proxy()
uses the FlashMCPProxy
class. You generally don’t need to interact with this class directly, but it’s available if needed.
Using the class directly might be necessary for advanced scenarios, like subclassing FlashMCPProxy
to add custom logic before or after forwarding requests.