Proxy Servers
Use Hyperia as an intermediary or transport bridge for other MCP servers.
New in Hyperia v2.0 —
Hyperia.as_proxy()
A proxy server lets one Hyperia instance stand in front of another MCP server (remote URL, different transport, or even an in‑process Hyperia). The proxy accepts requests from clients, forwards them to the backend, then relays responses—handy for transport conversion, security boundaries, or unified routing.
At a glance
graph TD
C[Your Client<br>(e.g. Claude Desktop, Stdio)] -->|tools/call| P(Hyperia Proxy)<br/>Stdio
P -->|tools/call| B(Backend MCP Server)<br/>Streamable‑HTTP or SSE
B -->|result| P
P -->|result| CWhy Proxy?
Transport Bridging
Expose a remote Streamable‑HTTP or SSE server locally via Stdio so desktop clients work out‑of‑the‑box.
Security Gateway
Keep your production server on a private network; publish only the proxy with auth, rate‑limiting, or logging.
Augmentation Layer
Future: subclass the proxy to cache, rewrite, or watermark responses without touching backend code.
Stable Endpoint
Clients hit one static URI even if the real server location or transport changes later.
Creating a Proxy with Hyperia.as_proxy()
Hyperia.as_proxy()from hyperia import Hyperia, Client
# Easiest: pass any value accepted by Client(...)
proxy = Hyperia.as_proxy(
"backend_server.py", # could be URL, config dict, or Hyperia instance
name="MyProxyServer",
)
# Custom client first
backend = Client("https://api.example.com/mcp/sse")
proxy2 = Hyperia.as_proxy(backend, name="CustomClientProxy")What happens under the hood
Hyperia spins up a
Clientto the backend.It discovers all tools, resources, templates, and prompts.
It auto‑generates local “proxy” counterparts that forward calls.
It returns a fully‑fledged Hyperia server you can run via any transport.
Current proxying covers the major MCP objects. Advanced features (notifications, sampling relay) are roadmap items.
Transport Bridging Example
Convert a remote Streamable‑HTTP endpoint to local Stdio for an IDE:
Your LLM tool (Cursor, Claude Desktop, etc.) can now connect to the proxy via stdio while the proxy talks HTTP under the hood.
In‑Memory Proxying
Wrap an existing Hyperia server to tweak settings without touching backend code.
Calls to proxy forward instantly to backend in the same process—useful for adding duplicate‑name handling, CORS, etc.
Configuration‑Based Proxies (v2.3.6+)
Supply an MCPConfig‑style dict:
Composite Proxy (multi‑backend)
Tools/resources are auto‑prefixed (weather_get_forecast, calendar_add_event, etc.).
Spec note
MCPConfigis evolving; field names may change as the standard matures.
Internals: HyperiaProxy
HyperiaProxyHyperia.as_proxy() builds an instance of HyperiaProxy under the hood. You normally don’t need to touch it, but advanced users can subclass:
Limitations & Roadmap
Sampling relay: proxies currently forward tools/resources; relaying
ctx.sample()calls is under development.Notifications: backend push notifications are not yet surfaced through proxies.
Auth & Policy hooks: coming extensions for request rewriting and auth injection.
Last updated