Summary
Read a Langfuse project with your AI: LLM traces, observations and sessions with cost, tokens and latency, metrics over time, scores and evaluations, prompts with their versions and labels, datasets, dataset items and experiments. It can also publish prompt versions, move labels, add scores and build datasets.
Guided setup
Connect Langfuse to Microsoft Copilot in 2 minutes
Start a free trial on AnythingMCP Cloud, connect Langfuse in the guided setup, then add your MCP URL to Microsoft Copilot. No code and no server to run.
No credit card · 7-day trial · Self-host alternative available
Try asking
Example prompts for Langfuse
Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.
Claude is AI and can make mistakes. Please double-check responses.
💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Langfuse, paste your credentials, mint an MCP API key and you're done. No Docker, no
git clone, no local server.
Langfuse + Microsoft Copilot
Read a Langfuse project with your AI: LLM traces, observations and sessions with cost, tokens and latency, metrics over time, scores and evaluations, prompts with their versions and labels, datasets, dataset items and experiments. It can also publish prompt versions, move labels, add scores and build datasets.
Prerequisites
See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:
LANGFUSE_HOST, LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY
Step 1 — Get credentials
Setting up takes about 3 minutes. You need a Langfuse project on Langfuse Cloud (EU, US, Japan or HIPAA) or on a self-hosted Langfuse v4.
- In Langfuse open the project, then Settings, API Keys, Create new API keys. Use a project key, not an organization key.
- Copy the public key (
pk-lf-...) intoLANGFUSE_PUBLIC_KEYand the secret key (sk-lf-..., shown only once) intoLANGFUSE_SECRET_KEY. The connector sends them as HTTP Basic auth. - Set
LANGFUSE_HOSTto the region of the project, without a trailing slash:https://cloud.langfuse.com(EU),https://us.cloud.langfuse.com(US),https://jp.cloud.langfuse.com(Japan),https://hipaa.cloud.langfuse.com(HIPAA) or your self-hosted address. Keys of one region do not work on another. - Install the connector and run
langfuse_get_projectto check the keys;langfuse_get_healthshows the server version.
Costs: no tool runs a model. The connector only reads and writes Langfuse data; the costs it shows are the ones Langfuse recorded for your applications' LLM calls.
Tracing data: in Langfuse v4 a trace is the set of observations (spans, generations, tool calls, events) that share a traceId, and a session is the set of traces that share a sessionId. The connector reads them from Observations API v2 and Metrics API v2, the real-time read path; the old /traces, /sessions and /metrics/daily endpoints are deprecated (Langfuse Cloud serves them until 16 November 2026). Other endpoints can lag about 10 minutes behind ingestion.
langfuse_list_observationslists rows newest first, always bounded byfrom_start_timeandto_start_time. Filters:type(GENERATION for LLM calls),name,user_id,session_id,trace_id,level(ERROR for failures),environment,is_root_observation(true gives one row per trace) or a structuredfilter.fieldspicks the field groupscore,basic,time,io(input and output),metadata,model,usage(tokens and cost),prompt,metrics(latency) andtrace_context; the default iscore,basic,usage.langfuse_get_tracereturns every observation of one trace with input, output, model, usage and latency; the root has noparentObservationIdand carries the trace's input and output.langfuse_get_sessionreturns one row per trace of a session by default;root_only: falsegives every observation.langfuse_query_metricsaggregates.queryis a JSON string withview(observations,scores-numeric,scores-boolean,scores-categorical),metrics(measures such ascount,latency,totalTokens,totalCostortimeToFirstToken, with the aggregationssum,avg,count,max,min,p50,p75,p90,p95,p99),dimensions(such asprovidedModelName,traceName,promptName,promptVersion,environment,release),timeDimension(per minute, hour, day, week or month),filters,fromTimestampandtoTimestamp. High-cardinality fields such asuserIdandsessionIdcan be filtered on but not grouped by.
Scores: langfuse_list_scores filters by name, source (API, ANNOTATION, EVAL), data_type, trace, session, observation, experiment, value range and time range; langfuse_list_score_configs shows the score definitions. langfuse_create_score adds one score (numeric, boolean as 0 or 1, categorical or text) to a trace, observation, session or experiment run. It is processed asynchronously (HTTP 202), and sending the same score_id again overwrites it.
Prompts: langfuse_list_prompts lists names with versions, labels and tags; langfuse_get_prompt returns the version labelled production unless version or label is given. langfuse_create_prompt_version publishes a new version of a text prompt (with {{variables}}) or a chat prompt, and a new name creates the prompt; langfuse_update_prompt_labels moves labels such as production or staging to a version. Moving production changes what your applications fetch, so the AI asks you first. Folder names such as support/greeting are passed as they are.
Datasets and experiments: langfuse_list_datasets, langfuse_get_dataset and langfuse_create_dataset (optionally with JSON schemas for input and expected output); langfuse_list_dataset_items, langfuse_get_dataset_item and langfuse_upsert_dataset_item (creates an item, or updates it when item_id exists; status ARCHIVED hides it from new runs). langfuse_list_experiments lists dataset runs and experiments with their scores; from_start_time is required.
Langfuse's own MCP server: Langfuse also runs a native MCP server at <LANGFUSE_HOST>/api/public/mcp with the same key pair, mainly for prompt management. This connector covers prompts too, plus tracing data, metrics, scores and datasets.
Switched off at install: nothing. All 20 tools are on; the write tools add prompt versions, labels, scores, datasets and dataset items, and none of them deletes anything.
Data formats: times are ISO 8601, UTC. Costs are in USD; in v2 observations inputPrice, outputPrice and totalPrice are strings for decimal precision, and input and output arrive as JSON text. Latency and time to first token in metrics are milliseconds.
Paging: observations, traces, sessions, scores and experiments use cursors: the AI passes meta.cursor back as cursor until it is missing (observations: 50 rows by default, up to 1,000). Prompts, datasets, dataset items and score configs use page (from 1) and limit (default 50, at most 100); meta.totalPages says how many pages exist.
Limits: self-hosted Langfuse must be v4 or later for the observation and metrics tools. Data outside Observations and Metrics API v2 can lag about 10 minutes behind.
Common errors: 400 means a bad parameter (a malformed filter or query JSON, a group-by on a high-cardinality field, a limit over the maximum); 401 a wrong key pair or the wrong region; 403 the key may not use this endpoint (use a project key); 404 an unknown prompt, dataset or item, or a self-hosted version without the v2 endpoints; 429 rate limiting (the AI waits instead of retrying in a loop).
The connector does not delete traces, prompts, datasets or scores and does not send traces (the Langfuse SDKs do that over OpenTelemetry). Annotation queues, LLM connections and organization or SCIM administration are not included.
Step 2 — Install the adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
Step 3 — Add the connector in Microsoft Copilot
Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (
https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide showsYOUR_SERVER_ID.
Microsoft Copilot uses MCP servers through agents built in Copilot Studio: you add AnythingMCP to an agent as a tool, then publish the agent to Microsoft 365 Copilot and Teams. Copilot Studio connects from Microsoft's cloud over Streamable HTTP, which AnythingMCP supports.
- In Copilot Studio, open your agent (or create one), go to Tools and choose Add a tool → New tool → Model Context Protocol.
- Enter a Server name (for example
AnythingMCP), a Server description that says what the connector does, and the Server URLhttps://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID. Copilot Studio uses the description to decide when to call the server. - Under authentication, choose API key, set Type to Header and the header name to
X-API-Key, then select Create. - In Add tool, choose Create a new connection, paste an MCP API key from AnythingMCP (MCP Servers → your server → API keys) and select Add to agent.
- Try it in the agent's Test pane: ask for something that needs the
Langfusetools. - Select Publish, then Channels → Microsoft 365 and Microsoft Teams, keep Make agent available in Microsoft Copilot selected and choose Add channel. See agent in Teams installs it for you; in Microsoft 365 Copilot, type @ and pick the agent.
Prefer per-user sign-in? Choose OAuth 2.0 → Dynamic discovery instead of an API key: each user then signs in to AnythingMCP the first time the agent calls it.
Self-hosting? Use your instance's public HTTPS address instead of https://cloud.anythingmcp.com. Copilot Studio connects from Microsoft's cloud, so localhost does not work.
Available tools
| Tool | What it does |
|---|---|
langfuse_get_project | Show the Langfuse project this key pair belongs to: id, name, organization and retention settings |
langfuse_get_health | Check that the Langfuse server and its database are up and read the Langfuse version (v4 or later is needed for the observation and metrics… |
langfuse_list_observations | List observations (LLM generations, spans, tool calls, events) of the Langfuse project, newest first, with the chosen field groups |
langfuse_get_trace | Read one Langfuse trace: all of its observations with input, output, model, token usage, cost and latency, newest first |
langfuse_get_session | Read one Langfuse session (for example a chat conversation): by default one row per trace, the entry point of each turn, with input, output… |
langfuse_query_metrics | Aggregate Langfuse data (Metrics API v2): counts, tokens, cost, latency percentiles or score values, grouped by dimensions such as model… |
langfuse_list_scores | List Langfuse scores (evaluations, user feedback, annotations) newest first, with name, value, data type, source, comment and the trace… |
langfuse_create_score | Add one score to a Langfuse trace, observation, session or experiment run, e.g. a quality rating or a correctness check |
langfuse_list_score_configs | List the score configs of the Langfuse project: name, data type, numeric range or categories, description and whether archived |
langfuse_list_prompts | List the prompts of the Langfuse project: name, type, versions, labels, tags and last update |
langfuse_get_prompt | Read one Langfuse prompt version: its text or chat messages, config (model, temperature), labels, tags, version and commit message |
langfuse_create_prompt_version | Publish a new version of a Langfuse prompt (a new name creates the prompt) |
langfuse_update_prompt_labels | Set the deployment labels of one Langfuse prompt version, e.g. promote version 4 to production |
langfuse_list_datasets | List the datasets of the Langfuse project with id, name, description, metadata and dates |
langfuse_get_dataset | Read one Langfuse dataset by name: description, metadata, input and expected-output JSON schemas and dates |
langfuse_create_dataset | Create a Langfuse dataset for evaluations and experiments, optionally with JSON schemas that every item's input and expected output must… |
langfuse_list_dataset_items | List the items of Langfuse datasets: input, expected output, metadata, status (ACTIVE or ARCHIVED) and the trace or observation they came… |
langfuse_get_dataset_item | Read one Langfuse dataset item: input, expected output, metadata, status, source trace and observation, dataset and dates |
langfuse_upsert_dataset_item | Add an item to a Langfuse dataset, or update it when item_id already exists: input, expected output, metadata, the source trace or… |
langfuse_list_experiments | List Langfuse experiments and dataset runs with recent activity first: name, dataset, metadata and, with fields scores, their aggregated… |
Example prompts
- "What did our LLM calls cost per model per day over the last 7 days?"
- "Show me yesterday's generations with level ERROR, with model, input and output."
- "Show me the whole conversation of session chat-8f21 with the input and output of each turn."
- "What is the p95 latency per trace name this week, and which one got slower?"
- "Publish a new version of the prompt support/greeting with a friendlier tone, but do not move the production label yet."
FAQ
Which Copilot is this for? Microsoft 365 Copilot at work, through agents built in Copilot Studio. The Microsoft Copilot app for personal accounts has no option to add your own MCP server.
What do I need? A work account with access to Copilot Studio (a license or a trial) to build the agent. People who use it in Microsoft 365 Copilot or Teams need access to the agent: share it with them, or ask an admin to publish it to the organization. If your organization applies data policies to Power Platform connectors, they cover MCP servers too.
The agent doesn't call the tools. Check that the header name is exactly X-API-Key and that the key belongs to the same MCP server as the URL, and make the server description specific: Copilot Studio uses it to decide when to call the server. Publish the agent again after each change; in an open chat, type "start over" to get the new version.
Next steps
- Connector landing page
- Connect to Claude
- Connect to ChatGPT
- Connect to Cursor
- Connect to Gemini
- Connect to Meta Muse
Was this guide helpful?