mcp-server

pihapi/mcp-server

3.2

If you are the rightful owner of 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 henry@mcphub.com.

The MCP Server is a versatile tool designed to provide weather, time, and calculator functionalities while supporting the Model Context Protocol (MCP).

Tools
  1. get_weather

    Fetches weather information for a specified city.

  2. get_time

    Provides the current time.

  3. calculator

    Performs basic arithmetic operations.

Сервер включает:

Три инструмента: получение погоды, времени и калькулятор

Логирование в файл mcp-server.log для отладки

Обработку ошибок

Полную поддержку протокола MCP

После сборки вы получите исполняемый файл, который можно использовать с Claude Desktop.

Build

Windows: go build -o mcp-server.exe main.go

Linux/Mac: go build -o mcp-server main.go

build.bat (для Windows)

@echo off
echo Building MCP Server...
go build -o mcp-server.exe main.go
echo Build complete: mcp-server.exe

build.sh (для Linux/Mac)

#!/bin/bash
echo "Building MCP Server..."
go build -o mcp-server main.go
chmod +x mcp-server
echo "Build complete: mcp-server"

Test

test.bat (для тестирования на Windows)

@echo off
echo Testing initialize...
echo {"jsonrpc":"2.0","method":"initialize","id":1} | mcp-server.exe

echo.
echo Testing tools/list...
echo {"jsonrpc":"2.0","method":"tools/list","id":2} | mcp-server.exe

echo.
echo Testing get_weather...
echo {"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_weather","arguments":{"city":"Moscow"}},"id":3} | mcp-server.exe

Конфигурация для Claude Desktop

Для Windows:
{
    "mcpServers": {
        "go-mcp-server": {
            "command": "C:\\path\\to\\your\\mcp-server.exe"
        }
    }
}
Для Linux/Mac:
{
"mcpServers": {
    "go-mcp-server": {
            "command": "/path/to/your/mcp-server"
        }
    }
}