A Go-based server implementation for the Model Context Protocol (MCP) with Grafana Loki integration.
- Go 1.16 or higher
Build and run the server:
# Build the server
go build -o loki-mcp-server ./cmd/server
# Run the server
./loki-mcp-serverOr run directly with Go:
go run ./cmd/serverThe server communicates using stdin/stdout following the Model Context Protocol (MCP). This makes it suitable for use with Claude Desktop and other MCP-compatible clients. It does not run as an HTTP server on a port.
.
├── cmd/
│ ├── server/ # MCP server implementation
│ └── client/ # Client for testing the MCP server
├── internal/
│ ├── handlers/ # Tool handlers
│ └── models/ # Data models
├── pkg/
│ └── utils/ # Utility functions and shared code
└── go.mod # Go module definition
The Loki MCP Server implements the Model Context Protocol (MCP) and provides the following tools: