MCP Catalogs
Home

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.

developer-toolsai-llmproductivity
1
Forks
1
Open issues
2 mo ago
Last commit
2d ago
Indexed

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:

you:Building Go-based MCP servers for data analytics and reporting
you:Creating enterprise-grade MCP implementations with proper error handling and logging
you:Developing MCP tools that integrate with external APIs for data retrieval
you:What analytics reports are available?
you:Why am I getting empty results from the API?

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 README
  • get_reportreport_name, limit, page, after, before

    Fetches analytics reports from the Digital Analytics Program API for U.S. federal government websites

Comparable tools

go-mcpmcp-fastapi-examplenode-mcp-serverpython-mcp-server

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

  1. Clone the repository:

``bash git clone https://github.com/rameshsunkara/go-mcp-example.git cd go-mcp-example ``

  1. Configure your environment:

``bash cp .env.example .env # Edit .env and add your API key ``

  1. Install dependencies and run:

``bash go mod download make run # or go run main.go ``

Claude Desktop Integration

  1. Build the binary: make build
  2. Copy configuration: Copy docs/claude-desktop/claude-desktop-config.json to your Claude Desktop config directory
  3. Update paths and API_KEY in the configuration file
  4. Restart Claude Desktop

VS Code Integration

  1. Build the executable: make build
  2. Copy configurations: cp docs/vscode/* .vscode/
  3. 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

GitHub →

Last updated · Auto-generated from public README + GitHub signals.