Skip to main content
Glama

langfuse-mcp

MCP server for Langfuse — lets Claude Code create projects, manage API keys, and query traces without touching the web UI.

Designed to work with langfuse-kickstart, a self-hosted Langfuse v3 stack running locally via Docker Compose.


Tools

Tool

Description

list_projects

List all projects accessible with the current API key

list_organizations

List all organizations

create_project

Create a new project inside an organization

create_api_key

Create a new pk/sk pair for a project

list_api_keys

List API keys for a project

delete_api_key

Delete an API key by ID

list_traces

List traces with optional filters

get_trace

Get full trace details including observations

list_sessions

List sessions

list_scores

List scores with optional filters

create_score

Create a score on a trace or observation

list_observations

List spans, generations, and events

list_datasets

List datasets

get_dataset

Get a dataset and its items

list_prompts

List prompts in the prompt library

get_prompt

Get a prompt by name, version, or label


Related MCP server: paperclip-mcp

Requirements


Setup

git clone https://github.com/dominic-righthere/langfuse-mcp
cd langfuse-mcp
cp .env.example .env

Edit .env:

LANGFUSE_HOST=http://langfuse.localhost
LANGFUSE_PUBLIC_KEY=pk-lf-kickstart
LANGFUSE_SECRET_KEY=sk-lf-kickstart
LANGFUSE_DATABASE_URL=postgresql://langfuse:YOUR_POSTGRES_PASSWORD@localhost:5432/langfuse

LANGFUSE_DATABASE_URL is needed for admin tools (create_project, create_api_key, etc.) that write directly to Postgres. With langfuse-kickstart, Postgres is exposed on 127.0.0.1:5432 — use the POSTGRES_PASSWORD from your kickstart .env.


Claude Code integration

Add to your .mcp.json (project-level) or claude_desktop_config.json:

{
  "mcpServers": {
    "langfuse": {
      "command": "uv",
      "args": ["run", "--project", "/path/to/langfuse-mcp", "langfuse-mcp"],
      "env": {
        "LANGFUSE_HOST": "http://langfuse.localhost",
        "LANGFUSE_PUBLIC_KEY": "pk-lf-kickstart",
        "LANGFUSE_SECRET_KEY": "sk-lf-kickstart",
        "LANGFUSE_DATABASE_URL": "postgresql://langfuse:YOUR_POSTGRES_PASSWORD@localhost:5432/langfuse"
      }
    }
  }
}

Replace /path/to/langfuse-mcp with the actual path to the cloned repo.

Alternatively, if you use a .env file in the repo root, you can omit the env block and let the server load it automatically.


Notes

  • create_api_key returns the secret key only at creation time — store it immediately.

  • Admin tools (create_project, create_api_key, delete_api_key, list_organizations) connect directly to Postgres. If Langfuse changes its schema in a major version these tools may need updating.

  • The REST API tools (list_traces, get_trace, etc.) use the public Langfuse API and are schema-stable.


License

MIT

Available Tools

20 tools
create_api_keyA

Create a new API key pair (pk/sk) for a project.

Returns the secret key — store it immediately, it is not shown again.

Args: project_id: The project ID to create the key for. note: Optional label for the key.

Inputs: project_id (required), note.

create_projectA

Create a new project inside an organization.

Args: name: Display name for the project. org_id: The organization ID to create the project in (get from list_organizations).

Inputs: name (required), org_id (required).

create_scoreA

Create a score on a trace or observation.

Args: trace_id: The trace to score. name: Score name (e.g. "quality", "faithfulness"). value: Numeric value (or 0/1 for BOOLEAN, category index for CATEGORICAL). observation_id: Optionally attach score to a specific observation. comment: Optional comment. data_type: NUMERIC | BOOLEAN | CATEGORICAL.

Inputs: name (required), value (required), trace_id (required), comment, +2 more.

delete_api_keyA

Delete an API key by its ID.

Args: key_id: The API key ID to delete (get from list_api_keys).

Inputs: key_id (required).

get_datasetC

Get a dataset and its items.

Args: dataset_name: The dataset name.

Inputs: dataset_name (required).

get_or_create_projectA

Find a project by name or create it if it doesn't exist.

Args: name: Project name to find or create. org_id: Organization ID to create in if not found (get from list_organizations).

Inputs: name (required), org_id (required).

get_promptA

Get a prompt by name, optionally pinned to a version or label.

Args: prompt_name: The prompt name. version: Specific version number. label: Label (e.g. "production", "latest").

Inputs: prompt_name (required), label, version.

get_traceC

Get full details of a trace including observations.

Args: trace_id: The trace ID.

Inputs: trace_id (required).

list_api_keysB

List API keys for a project.

Args: project_id: The project ID.

Inputs: project_id (required). Returns: result

list_datasetsC

List datasets.

Args: limit: Number of results. page: Page number.

Inputs: page, limit.

list_observationsA

List observations (spans, generations, events).

Args: trace_id: Filter by trace ID. limit: Number of results (max 100). page: Page number (1-based). obs_type: Filter by type: SPAN | GENERATION | EVENT.

Inputs: page, limit, obs_type, trace_id.

list_organizationsC

List all organizations.

Inputs: no named parameters. Returns: result

list_project_mappingsA

List all local repo → Langfuse project mappings.

Inputs: no named parameters.

list_projectsA

List all Langfuse projects accessible with the current API key.

Inputs: no named parameters. Returns: result

list_promptsB

List prompts in the prompt library.

Args: limit: Number of results. page: Page number. name: Filter by name.

Inputs: name, page, limit.

list_scoresB

List scores with optional filters.

Args: limit: Number of results (max 100). page: Page number (1-based). trace_id: Filter by trace ID. user_id: Filter by user ID. name: Filter by score name.

Inputs: name, page, limit, user_id, +1 more.

list_sessionsB

List sessions.

Args: limit: Number of results (max 100). page: Page number (1-based).

Inputs: page, limit.

list_tracesA

List traces with optional filters.

Args: limit: Number of results (max 100). page: Page number (1-based). user_id: Filter by user ID. session_id: Filter by session ID. name: Filter by trace name. tags: Filter by tags.

Inputs: name, page, tags, limit, +2 more.

lookup_projectA

Look up which Langfuse project a local repo/path is mapped to. Walks up the directory tree to find the nearest match.

Args: path: Absolute path to look up (usually the current working directory).

Inputs: path (required).

map_projectA

Record that a local repo/path uses a specific Langfuse project.

Args: path: Absolute path to the local project/repo. project_id: Langfuse project ID to associate with this path. project_name: Optional human-readable project name for reference.

Inputs: path (required), project_id (required), project_name.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action (e.g., create_api_key vs. delete_api_key, list_traces vs. list_sessions). No overlap in purpose; descriptions are clear.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (create_*, delete_*, get_*, list_*, lookup_*, map_*) using snake_case with no mixing of conventions.

    Tool Count4/5

    20 tools is slightly above the typical 3-15 range but well-justified by the diverse resources (projects, keys, prompts, traces, etc.). No tool is redundant.

    Completeness2/5

    Several resource types lack CRUD coverage: no create/update for prompts, traces, observations, datasets, sessions; only list/get operations. API keys missing update. Major gaps for agent workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      A
      maintenance
      MCP server for Langfuse observability. Query traces, debug exceptions, analyze sessions, and manage prompts and datasets for your LLM applications.
      48
      3,543 PyPI
      112
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that exposes the Paperclip control plane API as tools for Claude Code agents — manage issues, coordinate agents, post comments, and orchestrate work without direct API calls.
      100
      25 npm
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Comprehensive MCP server for Langfuse, enabling AI assistants to access and manage traces, observations, scores, datasets, and sessions for observability.
      24
      18 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for Dify Console API that enables managing apps, workflows, knowledge bases, models, plugins, and MCP servers programmatically from Claude Code or any MCP client.
      8
      MIT