Connector guide9-minute read20 MCP tools7 languages

Connect Langfuse to Cursor via MCP: Traces and Prompts

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.

HCBy HelpCode teamUpdated 9 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Langfuse

Langfuse

Let your AI read a Langfuse project: 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.

tools

20

Region

INTL

Category

Monitoring

Authentication

Basic Auth

Required env vars

LANGFUSE_HOSTLANGFUSE_PUBLIC_KEYLANGFUSE_SECRET_KEY
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

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 Cursor in 2 minutes

Start a free trial on AnythingMCP Cloud, connect Langfuse in the guided setup, then add your MCP URL to Cursor. 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.

Langfuse · live via MCP
Share
Opus 4.7

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 + Cursor

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.

  1. In Langfuse open the project, then Settings, API Keys, Create new API keys. Use a project key, not an organization key.
  2. Copy the public key (pk-lf-...) into LANGFUSE_PUBLIC_KEY and the secret key (sk-lf-..., shown only once) into LANGFUSE_SECRET_KEY. The connector sends them as HTTP Basic auth.
  3. Set LANGFUSE_HOST to 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.
  4. Install the connector and run langfuse_get_project to check the keys; langfuse_get_health shows 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_observations lists rows newest first, always bounded by from_start_time and to_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 structured filter. fields picks the field groups core, basic, time, io (input and output), metadata, model, usage (tokens and cost), prompt, metrics (latency) and trace_context; the default is core,basic,usage.
  • langfuse_get_trace returns every observation of one trace with input, output, model, usage and latency; the root has no parentObservationId and carries the trace's input and output.
  • langfuse_get_session returns one row per trace of a session by default; root_only: false gives every observation.
  • langfuse_query_metrics aggregates. query is a JSON string with view (observations, scores-numeric, scores-boolean, scores-categorical), metrics (measures such as count, latency, totalTokens, totalCost or timeToFirstToken, with the aggregations sum, avg, count, max, min, p50, p75, p90, p95, p99), dimensions (such as providedModelName, traceName, promptName, promptVersion, environment, release), timeDimension (per minute, hour, day, week or month), filters, fromTimestamp and toTimestamp. High-cardinality fields such as userId and sessionId can 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 Cursor

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 shows YOUR_SERVER_ID.

Cursor reads MCP servers from ~/.cursor/mcp.json. Add this entry:

{
  "mcpServers": {
    "anythingmcp": {
      "url": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
      "headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
    }
  }
}
  1. Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of YOUR_MCP_API_KEY.
  2. Save the file and restart Cursor.
  3. Open Cursor → Settings → MCP and check that anythingmcp is listed and connected.
  4. Start chatting: the agent can now call the Langfuse tools.

Available tools

ToolWhat it does
langfuse_get_projectShow the Langfuse project this key pair belongs to: id, name, organization and retention settings
langfuse_get_healthCheck 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_observationsList observations (LLM generations, spans, tool calls, events) of the Langfuse project, newest first, with the chosen field groups
langfuse_get_traceRead one Langfuse trace: all of its observations with input, output, model, token usage, cost and latency, newest first
langfuse_get_sessionRead 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_metricsAggregate Langfuse data (Metrics API v2): counts, tokens, cost, latency percentiles or score values, grouped by dimensions such as model…
langfuse_list_scoresList Langfuse scores (evaluations, user feedback, annotations) newest first, with name, value, data type, source, comment and the trace…
langfuse_create_scoreAdd one score to a Langfuse trace, observation, session or experiment run, e.g. a quality rating or a correctness check
langfuse_list_score_configsList the score configs of the Langfuse project: name, data type, numeric range or categories, description and whether archived
langfuse_list_promptsList the prompts of the Langfuse project: name, type, versions, labels, tags and last update
langfuse_get_promptRead one Langfuse prompt version: its text or chat messages, config (model, temperature), labels, tags, version and commit message
langfuse_create_prompt_versionPublish a new version of a Langfuse prompt (a new name creates the prompt)
langfuse_update_prompt_labelsSet the deployment labels of one Langfuse prompt version, e.g. promote version 4 to production
langfuse_list_datasetsList the datasets of the Langfuse project with id, name, description, metadata and dates
langfuse_get_datasetRead one Langfuse dataset by name: description, metadata, input and expected-output JSON schemas and dates
langfuse_create_datasetCreate a Langfuse dataset for evaluations and experiments, optionally with JSON schemas that every item's input and expected output must…
langfuse_list_dataset_itemsList the items of Langfuse datasets: input, expected output, metadata, status (ACTIVE or ARCHIVED) and the trace or observation they came…
langfuse_get_dataset_itemRead one Langfuse dataset item: input, expected output, metadata, status, source trace and observation, dataset and dates
langfuse_upsert_dataset_itemAdd an item to a Langfuse dataset, or update it when item_id already exists: input, expected output, metadata, the source trace or…
langfuse_list_experimentsList 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

Does Cursor support custom MCP servers on the free tier? Yes, MCP is available on Hobby, Pro and Business plans.

Next steps

Was this guide helpful?

Connect Langfuse to Cursor in 2 minutes

Start a free trial on AnythingMCP Cloud, connect Langfuse in the guided setup, then add your MCP URL to Cursor. No code and no server to run.

Related guides

Connectors

Connect Langfuse to ChatGPT via MCP: Traces and Costs

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.

Connectors

Connect Langfuse to Claude via MCP: Traces and Prompts

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.

Connectors

Connect Langfuse to Gemini CLI via MCP

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.

Connectors

Connect Langfuse to Meta Muse via MCP

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.

Connectors

Langfuse MCP Server: Traces, Prompts and Datasets

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.

Connectors

Connect Langfuse to Microsoft Copilot via MCP

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.