Skip to content

Add support for configurable path prefix to enable ingress deployment #14

@miladosos

Description

@miladosos

Problem

Currently, the MCP Victoria Logs server serves endpoints at fixed paths (e.g., /mcp). This creates challenges when deploying behind ingress controllers that use path-based routing, where different services need to be accessible under different path prefixes.

Use Case

In Kubernetes deployments with ingress controllers, it's common to have multiple MCP services accessible under a single domain with different path prefixes:

  • mcp.example.com/victoria-logs/datacenter1/mcp
  • mcp.example.com/victoria-logs/datacenter2/mcp
  • mcp.example.com/other-service/mcp

Current Workaround Limitations

Currently, the only solutions are:

  1. Complex nginx rewrite rules in the ingress (affects other services)
  2. Additional reverse proxy sidecars (adds complexity and resource overhead)
  3. Separate ingress resources (management overhead)

Proposed Solution

Add an environment variable like MCP_PATH_PREFIX that allows configuring a path prefix for all endpoints:

MCP_PATH_PREFIX="/victoria-logs/production"

This would make the MCP endpoint available at /victoria-logs/production/mcp instead of just /mcp.

Expected Behavior

  • When MCP_PATH_PREFIX is not set: current behavior (endpoints at /mcp, /health/*, etc.)
  • When MCP_PATH_PREFIX="/prefix" is set: endpoints at /prefix/mcp, /prefix/health/*, etc.
  • Health check paths should also respect the prefix for consistency

This would enable clean ingress configurations without complex rewrite rules while maintaining backward compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions