About Go
Go is an MCP server published by tr4d3r in the Developer Tools category: go mcp server.
Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/tr4d3r/mcp-goThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Go
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
- ✓License declaredUsable under a stated license.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
3 checks have not been run yet.
README
MCP Go Development Container
This is a development container setup for building Model Context Protocol (MCP) servers using Go.
Features
- Go 1.22 development environment
- Pre-configured VS Code with Go extensions
- MCP server implementation with basic tools
- WebSocket support for MCP communication
- Health monitoring endpoint
- Hot reload with Air (for development)
- Static analysis tools (golangci-lint, staticcheck)
Getting Started
Prerequisites
- Docker
- VS Code with Dev Containers extension
Development Setup
-
Open in Dev Container
- Open VS Code in this folder
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Select "Dev Containers: Reopen in Container"
-
Install Dependencies
go mod tidy -
Run the Server
go run main.go -
Test the Server
- Health check:
curl http://localhost:8080/health - WebSocket endpoint:
ws://localhost:8080/mcp
- Health check:
MCP Server Features
Available Tools
-
Echo Tool
- Echoes back any message
- Useful for testing MCP communication
-
Timestamp Tool
- Returns the current timestamp
- Demonstrates parameter-less tools
MCP Protocol Support
- Protocol version:
2024-11-05 - JSON-RPC 2.0 communication
- WebSocket transport
- Tool execution capabilities
Development Commands
Run with Hot Reload
air
Lint Code
golangci-lint run
Run Static Analysis
staticcheck ./...
Format Code
goimports -w .
Build for Production
go build -o mcp-server main.go
Testing the MCP Server
Using WebSocket Client
You can test the MCP server using a WebSocket client. Here's an example initialization message:
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "test-client",
"version": "1.0.0"
}
}
}
List Available Tools
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}
Call Echo Tool
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "echo",
"arguments": {
"message": "Hello, MCP!"
}
}
}
Project Structure
.
├── .devcontainer/
│ ├── devcontainer.json # Dev container configuration
│ └── Dockerfile # Custom container setup
├── static/ # Static files for testing
├── main.go # MCP server implementation
├── go.mod # Go module definition
└── README.md # This file
Adding New Tools
To add a new tool to the MCP server:
- Add the tool definition in the
handleToolsListmethod - Add the tool execution logic in the
handleToolCallmethod - Test the new tool using the WebSocket interface
Environment Variables
PORT: Server port (default: 8080)LOG_LEVEL: Logging level (default: info)
Contributing
- Make your changes
- Run tests:
go test ./... - Lint code:
golangci-lint run - Format code:
goimports -w .
Resources
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.