Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/ai-tools/mcp-servers/oss-mcp/configure/multi-organization-and-headers.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/ai-tools/mcp-servers/oss-mcp/configure/multi-organization-and-headers/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Multi-organization and headers
You can point the server at a specific Grafana organization and add custom HTTP headers to every request to Grafana.
What you’ll achieve
All Grafana API calls use the chosen organization context, and any extra headers you need (for example, tenant or custom auth) are sent automatically.
Before you begin
- A Grafana instance with multiple organizations (or a need for custom headers).
- The server configured with Authentication.
Set the organization
Set GRAFANA_ORG_ID to the numeric organization ID. The server sends X-Grafana-Org-Id on all requests to Grafana.
When using SSE or streamable-http, you can also send X-Grafana-Org-Id from the client; the header takes precedence over the environment variable so you can override the default org per request.
Select an organization per tool call
The settings above fix the organization for the whole connection. To let a single connection target different organizations per call, start the server with the --dynamic-multi-org flag. This is off by default.
When enabled:
- Every tool accepts an optional
orgIdargument that overrides the connection’s organization for that call, setting both theX-Grafana-Org-Idheader and, for app-platform APIs, the resolved Kubernetes namespace. Calls that omitorgIduse the connection’s default organization. - Proxied datasource tools are discovered across every organization the credential can access, so you can target a datasource in any of those orgs with
orgIdplus itsdatasourceUid.
This only works for credentials that belong to more than one organization (for example a user or on-behalf-of identity); a service-account token stays bound to its single organization. Call the user_info tool to discover which orgId values are valid.
Send custom headers
Set GRAFANA_EXTRA_HEADERS to a JSON object mapping header names to values. These headers are added to every Grafana API request.
Example:
"GRAFANA_EXTRA_HEADERS": "{\"X-Custom-Header\": \"value\", \"X-Tenant-ID\": \"tenant-123\"}"Next steps
- Authentication for Grafana credentials.
- Enable and disable tools to limit which tools are available.
Was this page helpful?
Related resources from Grafana Labs


