This project demonstrates how to build a simple MCP (Model Context Protocol) server in Go that provides temperature data for a given location.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"go-mcp-temperature-server": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
This project demonstrates how to build a simple MCP (Model Context Protocol) server in Go that provides temperature data for a given location. The server exposes a get_temperature tool via MCP, which proxies requests to an underlying HTTP temperature service.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in maps
A Model Context Protocol (MCP) server providing TomTom's location services, search, routing, and traffic data to AI agents.
Real-time BART departures, trip planning, fares, stations, and advisories.
MCP server for the VesselAPI — maritime vessel tracking, port events, emissions, and navigation data
Fair meeting point discovery for AI agents with isochrone-based travel time fairness
MCP Security Weekly
Get CVE alerts and security updates for Go Mcp Temperature Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
This project demonstrates how to build a simple MCP (Model Context Protocol) server in Go that provides temperature data for a given location. The server exposes a get_temperature tool via MCP, which proxies requests to an underlying HTTP temperature service.
mark3labs/mcp-go library.get_temperature) that accepts a location parameter.main.go: Main entry point. Sets up the MCP server, registers the tool, and implements the handler logic.go.mod, go.sum: Go module files for dependency management.http://localhost:8080/temperature?location=<LOCATION> (you can use your own implementation or go-temperature-server)Clone the repository or copy the source files to your Go workspace.
Install dependencies:
go mod tidy
Build the MCP server:
go build -o mcp-temperature-server main.go
Ensure your HTTP temperature service is running on port 8080.
Start the MCP server:
./mcp-temperature-server
You can use an MCP-compatible client or integration to call the get_temperature tool with a location parameter, e.g.:
{
"tool": "get_temperature",
"params": { "location": "Chapel Hill" }
}
The response will be in plain text, containing a JSON object with the location and temperature:
Temperature for Chapel Hill: {"location":"Chapel Hill","temperature":18.25}
mcp_config.json for Windsurf IDETo use this project with the Windsurf IDE, create a .codeium/windsurf/mcp_config.json file in your home directory (or project root) with the following content:
{
"mcpServers": {
"temperature": {
"command": "./ABSOLUTE/PATH/TO/YOUR/REPO/go-mcp-temperature-server/go-mcp-temperature-server",
// <-- Modify this to match your checkout location and leave the initial ./ alone
"args": [],
"env": {
"WEATHER_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
YOUR_API_KEY_HERE with your actual weather API key.get_temperature.location argument, then queries the HTTP service at http://localhost:8080/temperature?location=<LOCATION>&units=metric&appid=<YOUR_API_KEY>.endpoint variable in main.go.appid query parameter (e.g., ...&appid=YOUR_API_KEY). If you receive a 500 Internal Server Error, check the backend service logs and ensure the API key is valid and passed as a query parameter.MIT or as specified in your project.
For more information on MCP, see mark3labs/mcp-go.