Langfuse MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Bind address when MCP_TRANSPORT=streamable-http | 0.0.0.0 |
| MCP_PORT | No | Port when MCP_TRANSPORT=streamable-http | 8000 |
| MCP_BASE_URL | No | Public base URL of the hosted server (required for OAuth) | |
| LANGFUSE_HOST | No | Langfuse instance URL (cloud or self-hosted) | https://cloud.langfuse.com |
| MCP_TRANSPORT | No | Transport mode: stdio or streamable-http | stdio |
| ALLOWED_EMAILS | No | Comma-separated emails allowed to call tools (requires OAuth) | |
| LANGFUSE_TOOLS | No | Comma-separated tool groups to load (e.g., 'traces,analytics') | |
| GOOGLE_CLIENT_ID | No | Google OAuth client ID | |
| LANGFUSE_PAGE_LIMIT | No | Traces per API page | 100 |
| LANGFUSE_PUBLIC_KEY | Yes | Langfuse public API key (required) | |
| LANGFUSE_SECRET_KEY | Yes | Langfuse secret API key (required) | |
| GOOGLE_CLIENT_SECRET | No | Google OAuth client secret | |
| ALLOWED_EMAIL_DOMAINS | No | Comma-separated email domains allowed to call tools (requires OAuth) | |
| LANGFUSE_MCP_READ_ONLY | No | Disable write operations (set to 'true' to enable) | false |
| LANGFUSE_DEFAULT_PROJECT | No | Default project name for multi-project mode | |
| LANGFUSE_INTERNAL_DOMAINS | No | Comma-separated internal domains to exclude from analytics |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_projectsA | List all Langfuse projects configured on this server. Returns the available project names and the default project (used when
a tool call omits the |
| fetch_tracesA | Fetch traces from Langfuse. Returns compact metadata (no input/output content). For analytical questions (accuracy, failures, costs), use the analytics tools instead. For user queries, use list_user_queries. For keyword search, use search_trace_content. Use fetch_trace(trace_id) to get full details for a specific trace. |
| fetch_traceA | Get FULL details for a single trace including input, output, and all observations. Use this when you have a trace ID and want to inspect the complete trace. For listing traces, use fetch_traces (returns compact metadata). |
| diff_tracesA | Compare two traces side-by-side. Fetches both in parallel and returns a summary of how their high-level fields differ (name, user, session, latency, cost, token usage, tags, model, status). Useful for answering 'why did trace X take longer than trace Y?' or 'what's different between these two runs?'. |
| fetch_observationsB | Fetch observations (spans, generations, events) with filters. Use observation_type='GENERATION' to get LLM calls specifically. Use trace_id to get all observations within a specific trace. |
| fetch_observationA | Get a single observation by ID. Returns full details including input/output, token usage, model, latency, and cost. |
| fetch_sessionsB | List sessions with optional time filters. |
| get_session_detailsC | Get full details of a session including all its traces. |
| get_user_sessionsA | Get sessions for a specific user. Fetches user's traces and extracts unique sessions to understand their interaction history. |
| find_exceptionsA | Find observations with error status. Use detect_failures for LLM output quality issues instead. |
| get_exception_detailsA | Get full exception/error details for a specific trace. Returns the trace with all observations, highlighting errors. |
| get_error_countC | Get total error count within a time period. |
| fetch_scoresC | Fetch scores/evaluations with optional filters. |
| list_scores_v2A | List scores using the v2 Scores API. Richer filters than fetch_scores. trace_tags / score_ids: comma-separated values. operator: comparator used with value (e.g. '>', '>=', '=', '<'). |
| get_score_v2C | Get a single score by ID via the v2 Scores API. |
| list_promptsC | List all prompts in the project. |
| get_promptB | Fetch a specific prompt by name. Optionally specify version or label. |
| get_prompt_unresolvedA | Fetch a prompt without resolving placeholders or linked dependencies. Use this for debugging prompt composition (seeing the raw template with
|
| create_text_promptA | Create a new text prompt version. labels: comma-separated. |
| create_chat_promptC | Create a new chat prompt version. messages: JSON string of [{role, content}]. |
| update_prompt_labelsC | Update labels for a specific prompt version. labels: comma-separated. |
| list_datasetsC | List all datasets in the project. |
| get_datasetB | Get metadata for a specific dataset. |
| list_dataset_itemsB | List items in a dataset. |
| get_dataset_itemB | Get a single dataset item by ID. |
| create_datasetC | Create a new dataset. metadata: JSON string. |
| create_dataset_itemC | Create or upsert a dataset item. input/expected_output: JSON strings. |
| delete_dataset_itemC | Delete a dataset item by ID. |
| get_daily_metricsA | Fetch Langfuse's pre-aggregated daily metrics rollup. Returns per-day totals (trace count, cost, token usage) computed by Langfuse server-side. Faster than aggregating traces yourself when you want high-level trends over a long window. |
| list_usersA | List users in the project with per-user trace counts. Langfuse does not expose a dedicated /users endpoint — this queries the metrics API (grouping traces by userId) and returns the top users by trace count. Use fetch_traces(user_id=...) for a specific user's traces. If timestamps are omitted, defaults to the last 30 days. |
| list_commentsB | List comments attached to traces, observations, sessions, or prompts. object_type: 'trace' | 'observation' | 'session' | 'prompt'. object_id requires object_type to also be set. |
| get_commentB | Get a single comment by ID. |
| create_commentB | Create a comment on a trace, observation, session, or prompt. project_id: the Langfuse project ID (different from the MCP |
| list_modelsB | List model definitions in the Langfuse models registry. Returns both Langfuse-managed models and any custom pricing/tokenizer configs the project has added. |
| get_modelA | Get a single model definition by ID, including pricing and tokenizer config. |
| get_data_schemaA | Get the data schema for the Langfuse project. Useful for understanding available fields and data types. |
| list_annotation_queuesC | List all annotation queues in the project. |
| create_annotation_queueB | Create a new annotation queue. score_config_ids: comma-separated score config IDs to attach to the queue. |
| get_annotation_queueB | Get a single annotation queue by ID. |
| list_annotation_queue_itemsB | List items in an annotation queue. status: PENDING or COMPLETED. |
| get_annotation_queue_itemC | Get a single queue item by ID. |
| create_annotation_queue_itemB | Add a trace or observation to an annotation queue for review. object_type: 'TRACE' or 'OBSERVATION'. status: optional initial status (defaults to PENDING). |
| update_annotation_queue_itemC | Update a queue item's status. status: PENDING or COMPLETED. |
| delete_annotation_queue_itemC | Remove an item from an annotation queue. |
| create_annotation_queue_assignmentB | Assign a reviewer (user) to an annotation queue. |
| delete_annotation_queue_assignmentB | Remove a reviewer assignment from an annotation queue. |
| aggregate_by_groupA | Aggregate trace metrics by user group. Returns per-group: trace count, unique sessions, unique users, accuracy rate, average latency, total cost. Sorted by trace count. group_by options:
Set exclude_internal=true and LANGFUSE_INTERNAL_DOMAINS env var to filter out internal team users (only relevant with group_by='domain'). |
| compute_accuracyA | Compute accuracy from feedback scores. Accuracy = correct / (correct + incorrect). group_by: 'domain', 'name', 'userId'. bucket_by: 'week', 'day' for trends. score_name: filter to a specific score (default: all scores). |
| detect_failuresA | Detect LLM output failures using pattern matching and feedback scores. Finds traces where output contains failure signals ('unable to', 'I can't', 'error occurred', etc.) OR where feedback score = 0. This catches LLM quality failures, NOT Python exceptions. Use find_exceptions for code errors. |
| compute_token_percentilesA | Compute token usage percentiles (TP50/TP90/TP95/TP99) across traces. Fetches generation observations to get per-trace token counts. Optionally group by 'domain' or other trace attribute. NOTE: Fetches observations per trace — can be slow for large date ranges. Use last_7_days or smaller for real-time results. |
| detect_context_breachesA | Scan for traces where token usage exceeds a context window threshold. Default: 256K tokens. Set check_per_generation=true to check if any SINGLE generation exceeds the limit (not just trace aggregate). Catches context window overflow causing degraded performance or truncation. |
| analyze_sessionsC | Analyze multi-turn session behavior. Returns: session count, depth distribution (single vs multi-turn), average traces per session, session-level cost/latency, and engagement metrics. |
| estimate_costsA | Compute cost breakdown from Langfuse totalCost field. Groups by 'domain', 'name', 'userId', or time buckets ('day', 'week'). Returns: total cost, average per trace, per group breakdown. |
| analyze_latencyA | Analyze latency distribution across traces and optionally per generation. Returns: latency percentiles (P50/P90/P95/P99), average, max. group_by: 'domain', 'name', 'model'. Set include_per_generation=true to also analyze per-LLM-call latency (slower, fetches observations). Identifies which model is the bottleneck. |
| list_user_queriesA | List user queries extracted from trace inputs. Use this to answer: 'What are merchants asking?', 'What queries came in today?', 'What did users ask about?', 'Show star insurance queries'. Returns extracted query text with metadata. domain: filter by email domain (e.g. 'starinsurance.in'). Use this when the user asks about a company/org by name instead of a specific user email. group_by: 'name' (agent), 'userId', 'domain'. Set exclude_internal=true to filter internal team users. |
| find_slow_tracesA | Find the slowest traces. Returns actual trace IDs and metadata. Use this to answer: 'Which traces were slowest?', 'Show me traces taking >30s', 'What's causing high latency today?'. domain: filter by email domain (e.g. 'acme.com'). If threshold_seconds is set, returns all traces above that threshold. Otherwise returns the top_n slowest traces. group_by: 'name' (agent), 'userId', 'domain'. |
| search_trace_contentA | Search trace inputs and outputs for keywords. Use this to answer: 'Find traces mentioning refund', 'Which queries asked about payment failures?', 'Show traces related to order ID X'. domain: filter by email domain (e.g. 'acme.com'). search_in: 'input', 'output', or 'both' (default). query: keyword or phrase to search for (case-insensitive). |
| score_tracesA | Write scores back to Langfuse traces. trace_ids: comma-separated. Use this after analysis to annotate traces with findings. Example: score failing traces with 'needs-review'. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/DrishtantKaushal/LangfuseMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server