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
-
mkdir project folder, cd project folder, and
go mod init projectnamemkdir hello cd hello go mod init github.com/lqwangxg/go-hello-mcp-server -
mkdir .gemini folder and create .env and setting.json for mcp-server.
mkdir .gemini cd .gemini touch .env touch setting.json -
create GEMINI.md under project root folder for coding rules like
- Formatting
- Naming Conventions
- Error Handling
- Simplicity and Clarity
- Documentation
2. Test MCP Server
- edit setting.json
{ "mcpServers": { "helloworld": { "stdio": true, "command": "./bin/go-helle-mcp-server.exe", "timeout": 5000 } } } - run gemini-cli
- enter
/mcp listfor 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