Skip to main content
Glama

MCP Proxy Server

"""Create a local server that proxies requests to a remote server over SSE.""" from typing import Any from mcp.client.session import ClientSession from mcp.client.streamable_http import streamablehttp_client from mcp.server.stdio import stdio_server from .proxy_server import create_proxy_server async def run_streamablehttp_client(url: str, headers: dict[str, Any] | None = None) -> None: """Run the SSE client. Args: url: The URL to connect to. headers: Headers for connecting to MCP server. """ async with ( streamablehttp_client(url=url, headers=headers) as (read, write, _), ClientSession(read, write) as session, ): app = await create_proxy_server(session) async with stdio_server() as (read_stream, write_stream): await app.run( read_stream, write_stream, app.create_initialization_options(), )

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sparfenyuk/mcp-proxy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server