go-hello-mcp-server

lqwangxg/go-hello-mcp-server

3.1

If you are the rightful owner of go-hello-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Model Context Protocol (MCP) server is a specialized server designed to handle model context protocols, facilitating communication and data exchange between different systems and applications.

Create a MCP SERVER by go

1. env setting

  1. mkdir project folder, cd project folder, and go mod init projectname

    mkdir hello
    cd hello
    go mod init github.com/lqwangxg/go-hello-mcp-server
    
  2. mkdir .gemini folder and create .env and setting.json for mcp-server.

    mkdir .gemini
    cd .gemini
    touch .env
    touch setting.json
    
  3. create GEMINI.md under project root folder for coding rules like

    • Formatting
    • Naming Conventions
    • Error Handling
    • Simplicity and Clarity
    • Documentation

2. Test MCP Server

  1. edit setting.json
    {
      "mcpServers": {
        "helloworld": {
          "stdio": true,
          "command": "./bin/go-helle-mcp-server.exe",
          "timeout": 5000
        }
      }
    }
    
  2. run gemini-cli
  3. enter /mcp list for checking hello-mcp-server is running.

3. Build Methods

Linux
GOOS=linux GOARCH=amd64 go build -o bin/go-hello-mcp-server main.go
Windows
GOOS=windows GOARCH=amd64 go build -o bin/go-hello-mcp-server.exe main.go