Skip to content

Conversation

@mo-silent
Copy link
Contributor

Description

Add Python-based Loki MCP Server to the community servers list. This server provides AI assistants with the ability to query and analyze logs from Grafana Loki using the Model Context Protocol.

Server Details

  • Server: New community server addition (loki-mcp-server)
  • Changes to: README.md - added new server entry in alphabetical order

Motivation and Context

This contribution adds a Python-based alternative to the existing Golang Loki MCP server, providing:

  • Language Choice: Offers Python developers a native implementation using the Python MCP SDK
  • Enhanced Features: Advanced filtering, multiple authentication methods (basic auth, bearer tokens), caching, and comprehensive error handling
  • Rich Documentation: Extensive examples, troubleshooting guides, and usage documentation
  • Production Ready: Comprehensive test coverage, performance optimizations, and robust configuration options

The server fills a gap for Python-based Loki integration and offers additional capabilities not present in existing implementations.

How Has This Been Tested?

  • ✅ Tested with Claude Desktop integration
  • ✅ Comprehensive test suite covering unit, integration, and performance tests
  • ✅ Verified with multiple Loki instances (local Docker, cloud deployments)
  • ✅ Tested authentication scenarios (basic auth, bearer tokens)
  • ✅ Validated log querying, searching, and label discovery functionality
  • ✅ Performance tested with large log datasets

Breaking Changes

  • No breaking changes - this is a new server addition

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

Key Features:

  • LogQL Query Support: Full support for Grafana Loki's LogQL query language
  • Authentication: Multiple auth methods including basic auth and bearer tokens
  • Error Handling: Comprehensive error handling with detailed error contexts
  • Performance: Built-in caching and query optimization
  • Documentation: Extensive examples and troubleshooting guides
  • Testing: 95%+ test coverage with unit, integration, and performance tests

Repository Structure:

  • Comprehensive documentation in /docs
  • Multiple usage examples in /examples
  • Docker deployment examples
  • Claude Desktop integration examples

The server is maintained at https://github.com/mo-silent/loki-mcp-server and follows MCP best practices for security, error handling, and protocol compliance.

Copy link
Member

@domdomegg domdomegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@domdomegg domdomegg merged commit 57ab02c into modelcontextprotocol:main Aug 17, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants