Langfuse MCP server for AI agents

Live

PUBLIC KEY + SECRET KEY

LLM OBSERVABILITY

AI

Langfuse gives your agent LLM observability in your Langfuse project: read observations, scores, and metrics, manage prompts and datasets, configure evaluators and rules, and work annotation queues.

  • Per-user credentials: each call uses the actual user's credentials, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Langfuse
agent · Acme Q3
Run
Get the production version of my support-agent prompt.
S
langfuse_prompt_get
142ms
LLM ops agent
Returned the support-agent prompt at its production label, with its text and version.
Sources: Langfuse prompts, 1 prompt
langfuse
1 prompt
18:29
Message Claude...

Tools your LLM observability agent reaches for on Langfuse, scoped per user.

CALL ANY TOOL
58 tools for LLM observability in Langfuse: query metrics and observations, manage prompts and datasets, create scores, configure evaluators and rules, and work annotation queues.
langfuse_annotation_queue_assignment_create
Create annotation queue assignment
Assign a user to an annotation queue. Returns the assignment.
Parameters
Name
Type
Required
Description
queue_id
string
Required
ID of the annotation queue. Get it from langfuse_annotation_queues_list. Example: cm1q2w3e4r5t6y7u8i9o0p.
user_id
string
Required
Langfuse user ID to assign. Example: user-1.
langfuse_annotation_queue_get
Get annotation queue
langfuse_annotation_queue_item_add
Add annotation queue item
langfuse_annotation_queue_item_delete
Delete annotation queue item
langfuse_annotation_queue_item_get
Get annotation queue item
langfuse_annotation_queue_item_update
Update annotation queue item
langfuse_annotation_queue_items_list
List annotation queue items
langfuse_comment_create
Create comment
langfuse_comments_list
List comments
langfuse_dataset_get
Get dataset
langfuse_dataset_item_create
Create dataset item
langfuse_datasets_list
List datasets
langfuse_evaluation_rule_delete
Delete evaluation rule
langfuse_evaluation_rule_get
Get evaluation rule
langfuse_evaluators_list
List evaluators
langfuse_experiments_list
List experiments
langfuse_health_check
Check health
langfuse_llm_connection_delete
Delete llm connection
langfuse_media_get
Get media
langfuse_metrics_query
Query metrics
langfuse_model_create
Create model
langfuse_model_upsert
Upsert model
langfuse_observations_list
List observations
langfuse_project_get
Get project
langfuse_prompt_delete
Delete prompt
langfuse_prompt_version_labels_update
Update prompt version labels
langfuse_score_config_create
Create score config
langfuse_score_config_get
Get score config
langfuse_score_configs_list
List score configs
langfuse_trace_delete
Delete trace

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Langfuse tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["langfuse"], toolNames: [
    "langfuse_prompt_get",
    "langfuse_metrics_query",
    "langfuse_scores_list"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Get the production support-agent prompt, query last week's cost, and list low helpfulness scores" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["langfuse"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Get the production support-agent prompt, query last week's cost, and list low helpfulness scores" }],
  tools,
});

// Execute the tool call with the user's vaulted Langfuse public key and secret key
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["langfuse"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Get the production support-agent prompt, query last week's cost, and list low helpfulness scores" }],
  tools,
});

// Tool call runs with the user's vaulted Langfuse public key and secret key
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["langfuse"] }, pageSize: 100,
});

const agent = new Agent({
  name: "llm_ops_agent",
  model: "gemini-2.5-pro",
  instruction: "Langfuse tools scoped to this user",
  tools,
});

await agent.run("Get the production support-agent prompt, query last week's cost, and list low helpfulness scores");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Langfuse tool. Click to copy, paste into your agent, done.
Prompts and datasets
Copy the prompt
Copied
Get the production version of my support-agent prompt.
Copy the prompt
Copied
Create a new version of this prompt.
Copy the prompt
Copied
Add this question and its expected answer to my QA dataset.
Scores and metrics
Copy the prompt
Copied
Query token and cost totals for my generations this week.
Copy the prompt
Copied
List scores named helpfulness with a low value.
Copy the prompt
Copied
Create a user feedback score on this trace.
Evaluation and review
Copy the prompt
Copied
List my evaluators.
Copy the prompt
Copied
Add this trace to my review annotation queue.
Copy the prompt
Copied
Create an evaluation rule that samples new traces.
SEE HOW AUTH WORKS
Each user connects their own Langfuse public key and secret key once; Scalekit sends them with every call. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Langfuse
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Langfuse
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
Langfuse
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Langfuse
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other AI and monitoring connectors.
Engineering Teams
DevOps assistant agent
Polls GitHub for failing checks and stale PRs, opens Linear issues for the ones that need work, and posts a daily digest to Slack. It acts as the engineer, not a shared service account.
Test other agents
See the same per-user auth pattern across other AI and monitoring connectors.
ENGINEERING
DevOps assistant agent
Poll GitHub for failing checks and stale pull requests, open Linear issues for the ones that need work, and digest to Slack.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Langfuse key pair looks fine in a demo. In production every score and prompt change looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared keys
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Langfuse today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Langfuse as the user or through shared credentials?
As the user. Each user connects their own Langfuse public key and secret key once, and Scalekit sends them with every call. Audit logs attribute every score and prompt change to that user, not a shared service account.
Where are the Langfuse credentials stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Langfuse?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the get and list tools and langfuse_metrics_query without langfuse_trace_delete, langfuse_traces_delete, or langfuse_prompt_delete. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Langfuse access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
How does the agent measure token and cost usage?
langfuse_metrics_query runs aggregate queries over traces, observations, or scores: counts, latency, tokens, and cost. langfuse_model_create defines a custom model so Langfuse can compute cost for its generations.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""langfuse"": {
""url"": ""https://mcp.scalekit.com/langfuse"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.langfuse]
url = ""https://mcp.scalekit.com/langfuse""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""langfuse"": {
""url"": ""https://mcp.scalekit.com/langfuse"",
""type"": ""http""
}
}
}