Skip to content

Support dynamic GraphQL endpoint configuration for multi-tenant deployments #498

@lupuletic

Description

@lupuletic

Description

Summary

Currently, apollo-mcp-server requires the GraphQL endpoint to be configured at startup time in the YAML configuration file. This prevents a single MCP server instance from serving multiple GraphQL endpoints dynamically, which is essential for multi-tenant applications.

Use Case

We operate a multi-tenant e-commerce GraphQL API where the endpoint URL determines the brand, locale, and product catalog. Each endpoint serves different products, pricing, currencies, and inventory based on the brand and locale.

Current Limitation

The endpoint is fixed in the configuration file:

endpoint: https://graphql-api-brand-x.com/graphql

Once the server starts, this cannot be changed without restarting the MCP server. This means:

Current workaround (inefficient):

  • Deploy separate MCP server instances for each brand/locale combination
  • 10 brands × 5 locales = 50 separate deployments
  • Each deployment requires its own Kubernetes resources, SSL certificates, and DNS entries
  • Significantly increases infrastructure costs and operational complexity

What we need (efficient):

  • Single MCP server instance
  • Clients specify their desired endpoint when connecting
  • One deployment serves all brands and locales

Proposed Solution

Add support for client-specified endpoints in one of these ways:

Option 1: Query Parameter (Simplest)

Allow clients to specify the endpoint via query parameter when connecting:

GET /mcp?endpoint=https://graphql-api-brand-x.com/graphql

The MCP server would:

  1. Accept the endpoint as a query parameter
  2. Validate the endpoint against an allowlist (for security)
  3. Create a GraphQL client for that specific endpoint
  4. Proxy all operations to the client-specified endpoint

Option 2: HTTP Header

Similar to query parameter, but via custom header:

GET /mcp
X-GraphQL-Endpoint: https://graphql-api-brand-x/graphql

Option 3: Configuration-based allowlist

Allow multiple endpoints in the configuration with client selection:

endpoints:
  x: https://graphql-api-brand-x/graphql
  y: https://graphql-api-brand-y/graphql
  z: https://graphql-api-brand-z/graphql

Clients specify which endpoint to use:

GET /mcp?tenant=brand-x

Environment

  • apollo-mcp-server version: v1.2.0
  • Transport: streamable_http (stateful mode)
  • Deployment: Kubernetes (GKE)
  • Scale: 50+ GraphQL endpoints needed

We're happy to contribute to this feature if there's interest from the maintainers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions