go-mcp-example
by rameshsunkara·★ 4·Score 39
A well-structured Go MCP server implementing analytics reporting with modern Go architecture and enterprise-grade features.
Overview
This repository provides a comprehensive MCP server implementation in Go that demonstrates analytics reporting capabilities through integration with external APIs. It showcases idiomatic Go development practices including dependency injection, structured logging, configuration management, and comprehensive error handling. The server implements all three MCP protocol components: tools for analytics reporting, resources for extensible data management, and prompts for enhanced user interaction. The codebase is well-organized with clear separation of concerns, featuring auto-generated models from OpenAPI specifications and secure handling of API keys.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this if you're developing Go-based MCP servers and need a production reference with analytics capabilities.
When NOT to choose this
Don't choose if you need non-analytics MCP functionality or are not using Go as your primary development language.
Tools this server exposes
1 tool extracted from the READMEget_reportreport_name, limit, page, after, beforeFetches analytics reports from the Digital Analytics Program API for U.S. federal government websites
Comparable tools
Installation
Installation
Prerequisites
- Go 1.24+
- US Data Analytics Program API key ([Get your API key](https://open.gsa.gov/api/dap/#authentication))
- Make (optional)
- Docker (optional)
Steps
- Clone the repository:
``bash git clone https://github.com/rameshsunkara/go-mcp-example.git cd go-mcp-example ``
- Configure your environment:
``bash cp .env.example .env # Edit .env and add your API key ``
- Install dependencies and run:
``bash go mod download make run # or go run main.go ``
Claude Desktop Integration
- Build the binary:
make build - Copy configuration: Copy
docs/claude-desktop/claude-desktop-config.jsonto your Claude Desktop config directory - Update paths and API_KEY in the configuration file
- Restart Claude Desktop
VS Code Integration
- Build the executable:
make build - Copy configurations:
cp docs/vscode/* .vscode/ - Install the official MCP extension for VS Code
FAQ
- What analytics reports are available?
- The server provides 12+ report types including traffic, top-pages, devices, browsers, countries, and realtime data. All reports are fetched from the Digital Analytics Program (DAP) API for U.S. federal government websites.
- Why am I getting empty results from the API?
- The Digital Analytics Program API may sometimes return empty results due to recent data not being available yet, specific filters having no data, or API maintenance. Try querying data from a few days ago, using broader date ranges, or checking different report types.
Compare go-mcp-example with
Last updated · Auto-generated from public README + GitHub signals.