Back to MCP directory
publicPublicdnsLocal runtime

mcp-golang-http-server

一个基于SSE的简单MCP服务器,包含示例工具、资源和提示,支持PostgreSQL读取和NATS写入功能。

article

README

🚀 mcp-go-sse-server

本项目是一个简单的MCP服务器,通过SSE(Server-Sent Events)协议进行数据暴露。同时,项目还附带了示例工具、相关资源以及使用提示。其实现是基于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

实际用例

若你想查看一个从PostgreSQL数据库读取数据并写入NATS通道的实际用例,可参考分支nats-postgres

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