Example implementation of a calculator MCP server in Golang
{
"mcpServers": {
"example-go-mcp-server": {
"command": "<see-readme>",
"args": []
}
}
}No install config available. Check the server's README for setup instructions.
Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Example implementation of a calculator MCP server in Golang
Is it safe?
No package registry to scan.
No authentication — any process on your machine can connect.
MIT. View license →
Is it maintained?
Last commit 225 days ago. 1 stars.
Will it work with my client?
Transport: stdio. Works with Claude Desktop, Cursor, Claude Code, and most MCP clients.
No automated test available for this server. Check the GitHub README for setup instructions.
No known vulnerabilities.
This server is missing a description. Tools and install config are also missing.If you've used it, help the community.
Add informationHave you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Persistent memory using a knowledge graph
Privacy-first. MCP is the protocol for tool access. We're the virtualization layer for context.
Pre-build reality check. Scans GitHub, HN, npm, PyPI, Product Hunt — returns 0-100 signal.
Monitor browser logs directly from Cursor and other MCP compatible IDEs.
MCP Security Weekly
Get CVE alerts and security updates for Example Go Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A simple Model Context Protocol (MCP) server that provides basic mathematical operations. This project is based on the mark3labs MCP Go library and Kubescape MCP implementation pattern and demonstrates how to create custom MCP tools.
The server exposes four mathematical operation tools:
example-go-mcp-server/
├── cmd/
│ ├── root.go # Root command using Cobra
│ └── mcpserver.go # MCP server command
├── internal/
│ └── mcpserver/
│ └── server.go # Main MCP server implementation
├── main.go # Application entry point
├── go.mod # Go module file
└── README.md # This file
git clone <repository-url>
cd example-go-mcp-server
go mod tidy
go build -o example-go-mcp-server
Start the MCP server:
./example-go-mcp-server mcpserver
Or run directly with Go:
go run main.go mcpserver
The server provides the following tools that can be called via MCP:
add)a (required): First number to addb (required): Second number to add{
"operation": "addition",
"a": 5,
"b": 3,
"result": 8
}
sub)a (required): Number to subtract fromb (required): Number to subtract{
"operation": "subtraction",
"a": 10,
"b": 4,
"result": 6
}
mul)a (required): First number to multiplyb (required): Second number to multiply{
"operation": "multiplication",
"a": 6,
"b": 7,
"result": 42
}
div)a (required): Number to be divided (dividend)b (required): Number to divide by (divisor){
"operation": "division",
"a": 15,
"b": 3,
"result": 5
}
To add a new mathematical operation:
createMathTools() functionCallTool() switch statementhandlePow() for power operation)The server includes comprehensive error handling:
The server logs all MCP tool inputs and responses to a single file in the temp directory:
{temp_dir}/example-go-mcp-server/mcp_server.loggithub.com/mark3labs/mcp-go: MCP protocol implementationgithub.com/spf13/cobra: CLI frameworkThis project is open source and available under the MIT License.
This implementation is based on the Kubescape MCP server pattern: