-
Notifications
You must be signed in to change notification settings - Fork 7
Description
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:
- Complex nginx rewrite rules in the ingress (affects other services)
- Additional reverse proxy sidecars (adds complexity and resource overhead)
- 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.