Skip to content

fix(mcp): make API base URLs configurable via env vars#5644

Open
ManuelElvir wants to merge 2 commits intoHelicone:mainfrom
ManuelElvir:fix/mcp-configurable-base-url
Open

fix(mcp): make API base URLs configurable via env vars#5644
ManuelElvir wants to merge 2 commits intoHelicone:mainfrom
ManuelElvir:fix/mcp-configurable-base-url

Conversation

@ManuelElvir
Copy link

Closes #5643

Problem

The MCP server hardcodes both API base URLs:

const HELICONE_API_BASE = "https://api.helicone.ai";
const HELICONE_AI_GATEWAY_BASE = "https://ai-gateway.helicone.ai";

EU users (eu.api.helicone.ai) get a 401 "No API key found" error because their EU API key is sent to the US endpoint. Any HELICONE_BASE_URL env var set in the MCP config is silently ignored.

Changes

helicone-mcp/src/lib/helicone-client.ts

const HELICONE_API_BASE = process.env.HELICONE_BASE_URL || "https://api.helicone.ai";
const HELICONE_AI_GATEWAY_BASE = process.env.HELICONE_AI_GATEWAY_URL || "https://ai-gateway.helicone.ai";

helicone-mcp/README.md

  • Added EU configuration example
  • Added environment variables table documenting HELICONE_BASE_URL and HELICONE_AI_GATEWAY_URL

How to test

  1. Get an EU API key from https://eu.helicone.ai/settings/api-keys
  2. Configure the MCP server with:
    {
      "env": {
        "HELICONE_API_KEY": "sk-helicone-eu-xxx",
        "HELICONE_BASE_URL": "https://eu.api.helicone.ai"
      }
    }
  3. query_requests should return results instead of 401

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@vercel
Copy link

vercel bot commented Mar 23, 2026

@ManuelElvir is attempting to deploy a commit to the Helicone Team on Vercel.

A member of the Team first needs to authorize it.

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.

MCP server: support configurable base URL for EU instances

1 participant