cmd

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package cmd provides the command-line interface for the MCP Prometheus server.

This package implements the Cobra CLI framework to provide commands for: - Starting the MCP server with various transport options (stdio, sse, http) - Managing server configuration and lifecycle - Self-updating capabilities

The main entry point is the serve command which starts the MCP server and registers all Prometheus-related tools for querying metrics, discovering metrics metadata, and retrieving target information.

Environment Variables:

  • PROMETHEUS_URL: Optional Prometheus server URL (takes precedence over tool parameters)
  • PROMETHEUS_ORGID: Optional organization ID for multi-tenant setups (takes precedence over tool parameters)
  • PROMETHEUS_USERNAME: Optional basic auth username
  • PROMETHEUS_PASSWORD: Optional basic auth password
  • PROMETHEUS_TOKEN: Optional bearer token for authentication

If PROMETHEUS_URL or PROMETHEUS_ORGID environment variables are not set, they can be provided as parameters to individual tool calls.

Example usage:

mcp-prometheus serve --transport stdio
mcp-prometheus serve --transport sse --http-addr :8080

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately.

func SetVersion

func SetVersion(version string)

SetVersion sets the version for the root command

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL