What the Langfuse MCP server lets AI assistants do
A platform team often wants engineers to ask an AI assistant about traces, prompts or scores without switching to the Langfuse UI. The short answer is that Langfuse ships a native, authenticated Model Context Protocol server, so an assistant or agent client can query and, if you allow it, update Langfuse data directly. Read and write tools are both enabled by default, which means the first decision is not whether the server works but which tools each client may call. Clients can use an allowlist to restrict them to read-only tools, and that allowlist should be set before any assistant is connected to a production project.
The server is stateless and each API key is scoped to one project, so access is bounded by the key you issue. Clients connect over the streamable HTTP transport and authenticate with Basic authentication using the project's public and secret keys. Your self-hosted endpoint is documented alongside the Cloud regions in the Langfuse MCP server docs. Confirm the exact endpoint path, header format and allowlist syntax there against the version you run, and test them in a non-production project first.
Teams should expose the server when they have a clear use case, such as an engineer asking an assistant to pull the traces behind a failing prompt version, and when the people using it already have Langfuse project access. Teams should hold off when the key would reach projects containing personal data that has not been masked, when no one owns the allowlist, or when write tools would let an assistant change prompts or scores without review. Put the MCP key in your secrets manager, record which clients hold it, and rotate it on the same schedule as your other platform credentials.
How an assistant request reaches your Langfuse project
The request starts in an AI client on a workstation or in an agent runtime, then travels to the MCP endpoint on your self-hosted Langfuse inside your network. The endpoint checks the Basic authentication header against a project-scoped API key, so every call stays inside one project. Next, the allowlist decides whether the requested tool is permitted, and only then does the read or write tool query or change data. Check that the allowlist and key scope match what the assistant should be able to do.
Assistant requests pass authentication and the tool allowlist before reaching project data.
Which MCP configuration fits each use case
This table compares the main MCP configurations for a self-hosted Langfuse, with the fit and main risk of each. Read each row as a choice you make separately: tool access, key scope and endpoint. The safest default for most assistants is a read-only allowlist with a key scoped to a single project.
| Configuration | When it fits | Main risk | What to confirm |
|---|---|---|---|
| Full read and write tools | Trusted internal automation that creates or updates prompts, scores or annotations and needs the write path | An agent or prompt injection can change prompts or data in production projects | Current tool names and write operations in the MCP server docs |
| Allowlist limited to read-only tools | Assistants that analyze traces, summarize failures or answer questions about usage | Read access still exposes trace content, which may contain personal data | That the allowlist syntax in your client restricts to the read-only set |
| One API key per project | A single assistant or team working on one project with a clear owner | A compromised key exposes that whole project, and key sprawl is hard to track | Where keys are stored and how rotation is handled in your secrets system |
| One API key per assistant | Several assistants or agents with different purposes that need separate revocation and audit trails | More keys to rotate and monitor, and mistakes in key assignment across projects | How your self-hosted instance records key activity in audit logs |
| Cloud regional endpoint | Teams using Langfuse Cloud rather than their own infrastructure | Trace data leaves your infrastructure, which may conflict with your data residency rules | The region your data is hosted in and the endpoint in the docs |
| Self-hosted endpoint | Organizations that keep traces and prompts inside their own network and control access to the MCP route | The endpoint is only as protected as your TLS, network policy and reverse proxy setup | The documented self-hosted MCP path and that it is reachable only from approved clients |
Setting up the self-hosted MCP endpoint step by step
This sequence takes an AI assistant from a Langfuse deployment that may not yet expose the MCP server to a verified, read-only connection scoped to one project. Each step ends with a check you can run before moving on.
Confirm the version and endpoint availability
Your platform team checks which Langfuse version runs in your environment and confirms that the MCP server is available on your self-hosted deployment. Compare the running version with the release notes and the MCP server documentation, and ask your vendor or DeployOpen engineer to confirm the exact endpoint path for your installation. The step is done when you can reach the endpoint from the network where the AI assistant runs and get an authentication response rather than a connection error.
Create a project-scoped API key
A Langfuse project owner or admin creates an API key inside a single non-production project for the first test. Each MCP API key is scoped to one project, so the assistant can never see data in other projects through that key. Record the public and secret key in your secrets manager, not in a shared document. The step is done when the key appears in the project settings and you can see its creation in the audit trail if your audit logs are enabled.
Build the Basic authentication header
The MCP server uses Basic authentication, so combine the public and secret key into a Base64-encoded credential in the format public key, colon, secret key, and send it in the Authorization header. Generate the value in a script or secrets tool rather than typing it by hand, and keep it out of shell history and client configuration files committed to source control. The step is done when a plain request with that header returns a successful response from the endpoint and a request with a wrong secret is rejected.
Configure the MCP client for streamable HTTP
Add the Langfuse server to the AI assistant or agent configuration, set the transport to streamable HTTP, point the URL at your self-hosted endpoint, and pass the Authorization header from the previous step. Load the secret from an environment variable or secrets store reference that your client supports. The step is done when the client lists the Langfuse server as connected and reports its available tools without errors.
Apply the read-only tool allowlist
Restrict the client to read tools by adding an allowlist that names only the read operations your use case needs, because the MCP server exposes read and write tools by default. Review the tool names against the current MCP server documentation, since the list can change between versions. The step is done when the client's tool list shows only the allowed read tools and the configuration file is stored under change control.
Test with a non-production project
Run the assistant against the test project and ask it to list recent traces, then confirm the results match what you see in the Langfuse UI for that project. Next, ask it to perform a write action, such as creating a score or updating a prompt, and confirm the allowlist blocks the call. Check the Langfuse project data and your logs to make sure nothing changed. The step is done when both checks pass and you have written down the results for your security reviewer before promoting the key or client configuration to any production project.
Securing assistant access to trace data
An AI assistant that connects to Langfuse through MCP inherits the reach of the key it uses. The cards below cover the risks that matter most for a self-hosted deployment, from personal data inside traces to write actions that change prompts and scores. Each one names a check your team can make before the server reaches production use.
Personal data in traces
Prompts, model outputs and tool results can contain names, contact details or customer records, and an assistant that reads traces will see whatever was stored. Before you grant read access, confirm which fields your SDKs send and whether masking is applied at the client or on the server. Decide who may ask an assistant to pull full trace bodies, since a summary request and a raw export carry different exposure.
Project-wide API key scope
Each Langfuse MCP API key is scoped to one project, so a leaked key exposes every trace, prompt and score in that project. Create a separate key per assistant and per project rather than sharing one across tools. Record which person owns each key and which project it reaches, so a review can match keys to business purposes.
Write tools change production data
Read and write tools are both enabled by default, so an assistant can modify prompts or add scores unless you narrow it. Use a tool allowlist to expose only read-only tools to assistants that do not need to change anything. Where writes are required, limit them to a named project and test them in a non-production project first, since a prompt edit can reach live applications quickly.
MCP server docsBasic authentication over TLS
The server uses Basic authentication, which sends encoded credentials with every request. Serve the self-hosted endpoint only over TLS, terminated at your load balancer or ingress, and block plain HTTP at the edge. Confirm that assistant clients do not write keys into logs, shared configuration files or chat transcripts.
Key rotation and revocation
Keys used by assistants often outlive the people who set them up, and they may be copied into developer tools. Define a rotation interval, a named owner and a revocation step that removes the key from every client configuration. Test revocation once before you rely on it, and confirm that a revoked key stops working on the self-hosted endpoint.
Audit trail for assistant activity
Assistant calls should appear in the same audit approach your organization uses for other automated access. Ask whether your Langfuse audit logs record actions taken through API keys, and whether your gateway or reverse proxy logs MCP requests with the key identifier. Match those records to the assistant owner so a write to a prompt can be traced to a person and a time.
Where the self-hosted endpoint sits in your network
The Langfuse MCP server is not a separate service you have to build or place. It ships inside the same codebase as the self-hosted Langfuse web application, so it is reached through the same path as the UI and APIs: your load balancer, your TLS termination and the Langfuse Web container. Plan it as an extra client-facing route on that existing ingress, not as a new internal component. The practical consequence is that every AI assistant or agent runtime that uses it must be able to open an HTTPS connection to the Langfuse hostname you already publish, from wherever those clients actually run.
That reachability question has two halves. Developer workstations usually sit on a corporate network with egress rules, so confirm that the Langfuse hostname is allowed from those segments. Agent runtimes are often hosted separately, in a CI system, a container platform or a vendor's cloud, and they may be blocked from reaching private addresses at all. If your Langfuse is only reachable over a VPN or an internal load balancer, decide early whether each runtime will join that network, go through a proxy, or be excluded from MCP use. Ask your platform team which ingress paths exist today, whether the MCP route passes through a web application firewall or API gateway that inspects request bodies, and whether streaming responses are cut off by any idle timeout on the load balancer.
SSO-only sign-in does not block the MCP server. Self-hosted Langfuse can disable password sign-in or enforce SSO for given email domains, but that governs browser access for people. The MCP server authenticates with a project-scoped API key over Basic authentication, so a client that cannot complete an interactive SSO login will still work as long as it holds a valid key. Confirm this with your security team before you rely on it, and decide who is allowed to issue those keys, because the key, not the user's SSO session, is the credential the assistant presents. Your ingress and TLS settings are documented in the Langfuse self-hosting guide, and the endpoint details are in the Langfuse MCP server documentation.
Limits to confirm before you connect an assistant
The Langfuse MCP server is simple to switch on, but several behaviors depend on your Langfuse version, your endpoint and your client configuration. Confirm the items below in your own environment before an assistant gets a key with write access.
Exact tool list and write controls
Read and write tools are enabled by default, so the first decision is which tools a given client may call. Confirm the full tool list against the version you run, then test whether your client can disable write tools or limit it to an allowlist of read-only tools. Do not assume an allowlist exists in every client you use. Run a test call for each write tool on a non-production project and confirm that the call is refused.
MCP server docsBehavior across your Langfuse version
Tool names, parameters and responses can change between Langfuse releases, and an assistant prompt written for one version can fail on another. Record the Langfuse version you run, read the release notes for that version, and repeat the tool test after every upgrade. Keep the version pinned in your change records so an upgrade is reviewed as a change to the assistant's permissions as well as to the platform.
Langfuse releasesSelf-hosted endpoint path
The documentation lists the endpoint pattern for Langfuse Cloud regions and notes that a self-hosted endpoint is documented alongside them. Confirm the exact path for your deployment, including the host, any path prefix behind your reverse proxy and the transport your client expects. Check it with a request from the same network segment the assistant uses, because a proxy rule that works in a browser can still block streamable HTTP traffic.
Endpoint detailsStateless server and long sessions
The server is stateless, so each request is handled on its own rather than tied to a session held by the server. Confirm how your client reconnects after a timeout, a proxy idle limit or a restart, and whether it retries tool calls safely. Long agent runs that combine many reads with a write can leave partial results behind, so decide which writes must be idempotent and how the agent reports a failed step.
Key scope and credential handling
Each API key is scoped to one project, and the server authenticates with Basic authentication built from the public and secret key pair. Confirm that every assistant uses its own key, that keys are stored in your secrets manager rather than in client configuration files, and that you have a rotation procedure. Ask who can create keys and whether a key's role limits what its write tools can change.
Enterprise-only access controls
Some access controls depend on the Enterprise license key, including project-level RBAC roles and audit logs. Without them, you cannot rely on a project-level role to restrict what an assistant sees across projects or on an audit trail of its changes. Confirm which controls your license covers, and the license key documentation lists the features that require one.
License key docsQuestions teams ask before connecting an AI assistant to Langfuse
Is the Langfuse MCP server included in the free open source version?
Yes. Langfuse includes a native, authenticated Model Context Protocol server, and Langfuse states that all core features and APIs are available in the MIT-licensed open source version without limits. Self-hosted deployments use the same codebase as Langfuse Cloud, so the MCP server behaves the same way in both. The Enterprise license key applies only to the features listed in the license key documentation, such as project-level RBAC roles, audit logs and the instance management API. Confirm the current license terms in the repository's LICENSE file before you rely on them in a procurement decision, because the enterprise directories fall under a separate license.
What does the team need to provide for an MCP server setup?
Most of the work sits on the Langfuse side and in the assistant's configuration, but the team has to supply several inputs. You need a running self-hosted Langfuse instance with a reachable endpoint, a named owner for each project the assistant may query, and a decision on which assistant clients will connect. Each Langfuse API key is scoped to one project, so the team must list the projects, decide who owns each key, and decide where keys are stored. Security review also needs the endpoint, the transport and the authentication method documented. Ask your security team early, because they will want to see the key scope and the read-only configuration before approval.
How long does setup take, and what drives the effort?
No duration is supplied for this work, so confirm any estimate in writing with the team doing the work. The effort depends mainly on the number of projects the assistant should reach, since each project needs its own key and its own review. Other drivers include how many assistant clients and developer machines connect, whether the team wants read-only access for some users and read and write for others, and how much the security review asks for. Effort also rises if the self-hosted endpoint is not yet deployed or if its network path to the assistant host needs work. A small pilot with one project usually makes the scope clear before you agree a fixed plan.
Can our own engineers set up the MCP server without a partner?
Yes, if your team already runs self-hosted Langfuse and manages API keys and assistant configuration. The Langfuse MCP server is stateless, uses the streamable HTTP transport with Basic authentication, and is documented in the Langfuse docs, so the configuration itself is not complex. A partner is useful when the team lacks time for the security review, needs an allowlist design that its auditors will accept, or wants the endpoint placed behind the right gateway and identity controls. Decide whether you want the work done in-house, with advice, or as a fixed-scope engagement, and write that decision down before you start.
How do we restrict an AI assistant to read-only access?
Langfuse's MCP server enables read and write tools by default, so read-only access requires an explicit configuration step. Use the allowlist option supported by the MCP client to limit the assistant to read-only tools, then confirm the exact tool names in the Langfuse MCP server documentation for your version. Pair that client-side control with a project-scoped API key that has the lowest role your use case allows. Test the restriction by attempting a write from the assistant and checking that the call is refused. Record the test result, because security reviewers usually ask for evidence that the control works.
Which cost components apply to connecting an assistant?
There are three main components. The Langfuse MCP server itself is part of the open source version, so there is no separate license charge for it. The self-hosted infrastructure, including the web, worker, PostgreSQL, ClickHouse, Redis or Valkey and blob storage, is a recurring cost you already carry if you run Langfuse. The third component is the one-time work to design keys, allowlists, documentation and the security review, which may come from your own staff or a partner. Ask any partner for a quote that lists scope, number of projects, assistant clients, security review deliverables and retest effort as separate lines. Enterprise support plans are a separate, custom-priced option on Langfuse's pricing page.
Does the self-hosted MCP endpoint need extra security review?
Usually yes, because the endpoint gives an assistant access to trace data, prompts and evaluations that may contain personal or sensitive content. Review the authentication method, the key scope, the network path and who can reach the endpoint. Confirm whether your organization routes assistant traffic through a gateway or identity layer, and record how keys are rotated and revoked. A security test of the assistant setup, including prompt injection and credential handling, can show whether a compromised or manipulated assistant could reach data it should not. Plan that review before the rollout, not after.
Rolling out assistant access in stages
Start with a pilot in a non-production Langfuse project, because the MCP server gives an assistant the same reach as the API key behind it, and that key is scoped to one project. The first decision is which project the pilot key points at. Use a project that holds synthetic or already-sanitized traces, and confirm with your security team that the project's retention window and masking settings match what you would accept for production. Every pilot key should be issued for one named assistant client, so the audit trail shows which tool made which call. Record the endpoint you used, including whether it is your self-hosted address, since the MCP server is documented alongside the Cloud regions and you should confirm which URL your instance exposes before any client is configured.
Before expanding, review what the pilot actually did. Ask the security team to look at the tool names the client invoked, the volume and shape of queries, and whether any response contained personal data that should have been masked. Use the allowlist to restrict the client to read-only tools and confirm in testing that a write tool call is refused. Do this check against a real client configuration, not only the documentation, because allowlist behavior is a control you must verify in your environment. Then expand to read-only assistants in production projects, issuing one key per client rather than sharing a key across tools.
Decide write tools case by case, and only after the read-only rollout has run without findings. Each write capability needs a named business owner, a documented reason, and a test showing its effect on prompts, datasets or scores. Key issuance should sit with the team that administers the Langfuse project, not with the assistant's developers, and revocation should have a named owner too. Keep a register of approved clients with their configuration, allowlist, key identifier, owner, approval date and review date. For security review, retain the register, pilot test results, allowlist configuration, access reviews and revocation records. Confirm with your own auditors which of these artifacts they expect, since DeployOpen prepares evidence but does not issue assessments.
Official Langfuse sources for MCP and self-hosting
The four pages below cover the decisions that shape an MCP deployment: how the server authenticates and scopes access, how the self-hosted stack is built, which features need an Enterprise license key, and how users sign in. Read them in this order before you issue any API key to an assistant or agent.
MCP server documentation
This page describes the native, authenticated Model Context Protocol server built into Langfuse. Read it first to confirm the transport, which is streamable HTTP, and the authentication method, which is Basic authentication. It also explains that each API key is scoped to one project and that the server is stateless. Check whether read and write tools are enabled by default in your version, and confirm how the allowlist is configured before you connect any assistant. Note the self-hosted endpoint, which is documented alongside the Cloud regions, and test it against a non-production instance first.
- Transport
- Streamable HTTP
Self-hosting overview
This overview lists the components of a self-hosted deployment: the Langfuse Web and Worker containers, PostgreSQL, ClickHouse, Redis or Valkey, and S3-compatible blob storage. The MCP endpoint lives on the Web container, so the availability and network path of that container determine whether your assistants can reach Langfuse. Review the deployment options, which include Docker Compose on a single VM for testing without high availability and Kubernetes for production, and decide where the endpoint sits behind your load balancer and TLS termination.
Self-hosting docsLicense key documentation
This page lists which features need an Enterprise license key, including project-level RBAC roles, protected prompt labels, audit logs, and the instance management API. The MCP server itself is part of the core product, but the access controls around it are not all free. If your plan is to restrict assistants by role, confirm with the vendor which roles and audit capabilities your edition includes. The MIT license covers the repository except the directories under the separate enterprise license, so check the LICENSE file before assuming a feature is open.
License key docsAuthentication and SSO
This page covers how users and administrators sign in to a self-hosted Langfuse. It lists the supported identity providers, the ability to disable password sign-in, and the option to enforce SSO for given email domains. These settings govern who can open the UI and create keys, which is the first gate before any MCP key is issued. Coordinate with your identity team on provider configuration, and confirm which SSO options are available on your edition before you plan the key issuance process around them.
SSO documentationHow DeployOpen scopes and delivers MCP access for Langfuse
The sequence turns an assistant request into a written scope, a self-hosted MCP endpoint configured inside your infrastructure, and tested access that your team can review and maintain.
Agree the written scope
DeployOpen and your team define which assistants and agents need access, which projects they may reach, whether they read, write or both, and which data they must never see. The scope, deliverables and timeline are agreed in writing before any work starts, and the quote follows from that document. The step closes when both parties sign off the scope and the list of in-scope assistants.
Confirm the self-hosted endpoint and version
DeployOpen checks that your self-hosted Langfuse instance exposes the MCP server at its own endpoint, confirms the Langfuse version it runs, and records how the endpoint is reached from your network. Where the endpoint, version or network path does not match the documentation, the gap is logged for your team to confirm with the vendor before configuration continues. The step closes with a short environment record that lists the endpoint, version and network path.
Design project-scoped API keys
Each Langfuse API key is scoped to one project, so DeployOpen maps each assistant or agent to the projects it needs and creates a separate key per consumer. Keys are issued in your environment, stored in your secrets tooling, and never placed in shared prompts or client configuration files. The step closes with a key inventory that names the owner, project and purpose of every key.
Build the read and write tool allowlists
The MCP server enables read and write tools by default, so DeployOpen builds an allowlist for each client that exposes only the read-only tools it needs, or only the specific write tools approved in the scope. Each allowlist is written to the client configuration and reviewed against the tool list your team agreed. The step closes when every assistant's configuration matches its approved allowlist.
Test assistant access and permissions
DeployOpen tests each configured assistant against its allowlist and key scope. The tests cover attempts to reach other projects, calls to tools outside the allowlist, prompt injection content inside trace data that tries to trigger writes or deletions, and handling of credentials in logs and responses. Each failed check produces a finding with a recommended fix and a retest. The step closes with a test report that lists every check, its result and the retest outcome.
Document the setup for operators
DeployOpen writes the runbook for your team: endpoint details, key issuance and rotation steps, allowlist change control, how to add or remove an assistant, and what to check when an assistant reports unexpected results. The documentation is delivered in your repository or document system and walked through with the operators who will run it. The step closes when your operators confirm they can perform each documented task.
Hand over and plan ongoing support
DeployOpen hands over the configuration, keys inventory, allowlists, test report and runbook, and confirms who holds each credential. If you want continued help, an optional retainer can cover upgrades of Langfuse, re-testing after allowlist changes and support for new assistants. DeployOpen does not issue certifications or audit reports, so any compliance evidence from this work is material for your own assessors or independent auditors. The step closes with a signed handover record.

