Back to MCP directory
publicPublicdnsLocal runtime

mcp-go-sse-server

一个基于SSE的简单MCP服务器,提供示例工具、资源和提示,支持多种传输方式,包含PostgreSQL和NATS的实际应用案例。

article

README

🚀 简单MCP服务器项目

本项目是一个简单的MCP服务器,借助SSE(Server-Sent Events)协议对外暴露服务,同时附带了示例工具、资源和提示。此项目是在以下GitHub仓库示例的基础上修改而来:https://github.com/mark3labs/mcp-go/blob/main/examples/everything/main.go

🚀 快速开始

要运行该项目,请使用以下命令:

go build . && ./mcp-go-sse-server --transport sse --baseurl http://localhost
go build . && ./mcp-go-sse-server --transport sse --baseurl https://mcp.example.com --omitPort

💻 使用示例

基础用法

nats-postgres分支中,提供了一个实际用例的实现。该示例展示了如何从PostgreSQL数据库读取数据并将其写入NATS通道。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client