MCP ExplorerExplorer

Mcp Gateway Go

@zhengkunwang223on 10 months ago
3 MIT
FreeCommunity
AI Systems
A Go gateway that converts stdio-based MCP servers to SSE endpoints using mcp-go.

Overview

What is Mcp Gateway Go

mcp-gateway-go is a lightweight Go-based gateway that converts stdio-based Model Context Protocol (MCP) servers into Server-Sent Events (SSE) endpoints, enabling real-time communication with clients over HTTP.

Use cases

Use cases include integrating MCP servers with web-based clients, enabling real-time updates in applications, and facilitating communication between AI agents and web browsers.

How to use

To use mcp-gateway-go, install the necessary dependencies using Go, create a Go file to initialize the MCP server, and set up the SSE server with a custom base URL. Define the MCP command to run and start the gateway server.

Key features

Key features include standard input/output support for MCP servers, SSE support for real-time client communication, command-line tool integration for running MCP servers, and customizable base URL for flexible deployment.

Where to use

mcp-gateway-go can be used in web applications that require real-time data updates, such as dashboards, live notifications, or any service that needs to communicate with web clients using SSE.

Content

mcp-gateway-go

mcp-gateway-go is a lightweight Go-based gateway that transforms a standard input/output (stdio) Model Context Protocol (MCP) server into a Server-Sent Events (SSE) endpoint. This enables real-time communication with clients such as web browsers or AI agents over HTTP.

Installation & Usage


go install github.com/zhengkunwang223/mcp-gateway-go@latest


mcp-gateway-go --port 7979 --baseUrl http://127.0.0.1:7979  --command "npx -y @modelcontextprotocol/server-filesystem /tmp"

  • --port 7979: Port to listen on (default: 7979)
  • --baseUrl "http://localhost:7979": Base URL for SSE
  • --ssePath "/sse": Path for SSE subscriptions (default: /sse)
  • --messagePath "/message": Path for messages (stdio→SSE default: /message)
  • --oauth2Bearer "some-access-token": Adds an Authorization header with the provided Bearer token

📚 Additional Resources

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers