Skip to content

Conversation

@killme2008
Copy link
Contributor

@killme2008 killme2008 commented Dec 10, 2025

Main changes:

@killme2008
Copy link
Contributor Author

@copilot review this PR, please

Copy link

Copilot AI commented Dec 10, 2025

@killme2008 I've opened a new pull request, #25, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces HTTP transport support for the MCP server (addressing issue #23) and fixes TQL time parameter formatting to support SQL expressions alongside literal timestamps. The changes enable containerized and Kubernetes deployments through streamable-http and SSE transport modes, while maintaining backward compatibility with stdio mode for local CLI integration.

Key Changes:

  • Added HTTP transport modes (streamable-http, sse) with configurable host/port settings
  • Fixed TQL time parameter handling to support SQL expressions like now() - interval '5' minute
  • Updated documentation and templates to clarify time format options

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/greptimedb_mcp_server/config.py Added transport, listen_host, and listen_port configuration parameters with environment variable and CLI argument support
src/greptimedb_mcp_server/server.py Implemented get_config() with fallback, updated main() to configure HTTP server settings based on transport mode, and integrated new time expression validation
src/greptimedb_mcp_server/utils.py Added is_sql_time_expression(), format_tql_time_param(), and validate_time_expression() functions for handling SQL time expressions vs literal timestamps
tests/test_config.py Added comprehensive tests for new transport-related configuration options
tests/test_http_transport.py Added blackbox tests for streamable-http and SSE transport modes, including endpoint validation and configuration testing
tests/test_server.py Updated setup_state fixture to include new transport configuration parameters
tests/test_utils.py Added tests for time expression detection, formatting, and validation functions
README.md Added HTTP Server Mode section with usage examples and transport mode descriptions
src/greptimedb_mcp_server/templates/promql_analysis/template.md Added clarification about supported time formats for TQL queries
src/greptimedb_mcp_server/templates/promql_analysis/config.yaml Updated argument descriptions to document time format options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@killme2008 killme2008 requested a review from sunng87 December 10, 2025 10:29
@sunng87 sunng87 merged commit 74aff15 into main Dec 10, 2025
1 check 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.

Feature request: Support always-on / HTTP-based MCP server mode for long-running usage

3 participants