- Explore MCP Servers
- mcp-calculator-go
Mcp Calculator Go
What is Mcp Calculator Go
mcp-calculator-go is a simple calculator implemented in Go that adheres to the Model Context Protocol (MCP). It serves as a demonstration of how to build an MCP server using the mcp-go library.
Use cases
Use cases for mcp-calculator-go include integrating arithmetic functionalities into applications, serving as a backend service for calculation requests, and demonstrating the implementation of MCP servers.
How to use
To use mcp-calculator-go, first build the binary and configure it in your development environment. You can set it up in VS Code or Zed by specifying the command path and arguments in the respective configuration files.
Key features
Key features of mcp-calculator-go include basic arithmetic operations (addition, subtraction, multiplication, division), accurate decimal calculations using the github.com/shopspring/decimal library, a single ‘calculate’ tool with operation parameters, and the use of go-enum for generating enums.
Where to use
mcp-calculator-go can be used in software development environments where arithmetic calculations are required, particularly in applications that follow the Model Context Protocol.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Calculator Go
mcp-calculator-go is a simple calculator implemented in Go that adheres to the Model Context Protocol (MCP). It serves as a demonstration of how to build an MCP server using the mcp-go library.
Use cases
Use cases for mcp-calculator-go include integrating arithmetic functionalities into applications, serving as a backend service for calculation requests, and demonstrating the implementation of MCP servers.
How to use
To use mcp-calculator-go, first build the binary and configure it in your development environment. You can set it up in VS Code or Zed by specifying the command path and arguments in the respective configuration files.
Key features
Key features of mcp-calculator-go include basic arithmetic operations (addition, subtraction, multiplication, division), accurate decimal calculations using the github.com/shopspring/decimal library, a single ‘calculate’ tool with operation parameters, and the use of go-enum for generating enums.
Where to use
mcp-calculator-go can be used in software development environments where arithmetic calculations are required, particularly in applications that follow the Model Context Protocol.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP Calculator Go
This is a simple calculator implemented in Go that conforms to the Model Context Protocol (MCP). It demonstrates how to build an MCP server using the mcp-go library.
Features
- Performs basic arithmetic operations: addition, subtraction, multiplication, and division.
- Uses
github.com/shopspring/decimalfor accurate decimal calculations. - Exposes a single
calculatetool withoperation,x, andyparameters. - Uses
go-enumto generate enums and related helper methods. - Provides a
Taskfilefor convenient build and dependency management.
Building and Running
First you need to install the dependencies described in the task file.
go install github.com/abice/go-enum@latest go generate ./...
or simply
task deps task enum
To build the executable, run:
go build -o mcp-calculator-go
or
task build
How to use
- build mcp binary
- configure
- VS Code and Client:
{
"mcpServers": {
"calculator-go": {
"command": "/path/to/mcp-calculator-go",
"args": [],
"disabled": false,
"autoApprove": []
}
}
}
- Zed
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










