Skip to content

Commit 151a05b

Browse files
committed
add vulnerability process
2 parents 271aebf + 550ebcb commit 151a05b

File tree

8 files changed

+395
-109
lines changed

8 files changed

+395
-109
lines changed

pages/changelog/2025-02-16-mcp-server-update.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import { ChangelogHeader } from "@/components/changelog/ChangelogHeader";
1111

1212
<ChangelogHeader />
1313

14+
<Callout type="info">
15+
**Update (November 2025):** This MCP server has been superseded by our [native MCP server](/changelog/2025-11-20-native-mcp-server) using StreamableHttp, which includes write operations and requires no external setup.
16+
</Callout>
17+
1418
Short demo of the MCP Server in action in Claude Desktop.
1519

1620
<iframe
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
date: 2025-11-20
3+
title: Hosted MCP Server for Langfuse Prompt Management
4+
description: Langfuse now includes a native Model Context Protocol (MCP) server with write capabilities, enabling AI agents to fetch and update prompts directly.
5+
author: Michael
6+
ogImage: /images/changelog/2025-11-20-native-mcp-server.png
7+
---
8+
9+
import { ChangelogHeader } from "@/components/changelog/ChangelogHeader";
10+
11+
<ChangelogHeader />
12+
13+
We're excited to announce that Langfuse now includes a **native MCP server** built directly into the platform. We release it with support for [Prompt Management](/docs/prompt-management/overview) and will extend it to the rest of the Langfuse data platform in the future.
14+
15+
Our previous Prompt MCP server ([changelog](/changelog/2025-02-16-mcp-server-update)) was a node package. The new one uses `StreamableHttp` to communicate with the Langfuse API directly, no need for building or installing any external dependencies.
16+
17+
## What's New
18+
19+
The native MCP server is available at `/api/public/mcp` and provides five tools for comprehensive prompt management:
20+
21+
**Read Operations:**
22+
23+
- `getPrompt` - Fetch specific prompts by name, label, or version
24+
- `listPrompts` - Browse all prompts with filtering and pagination
25+
26+
**Write Operations:**
27+
28+
- `createTextPrompt` - Create new text prompt versions
29+
- `createChatPrompt` - Create new chat prompt versions (OpenAI-style messages)
30+
- `updatePromptLabels` - Manage labels across prompt versions
31+
32+
## Setup
33+
34+
Simply configure your MCP client with BasicAuth credentials:
35+
36+
```bash
37+
# Claude Code - one command
38+
claude mcp add --transport http langfuse https://cloud.langfuse.com/api/public/mcp \
39+
--header "Authorization: Basic {your-base64-token}"
40+
```
41+
42+
The native server uses a stateless architecture, ensuring clean separation between projects and reliable operation across all deployment types (Cloud, self-hosted, or local development).
43+
44+
See [documentation](/docs/api-and-data-platform/features/mcp-server) for more details.
45+
46+
## Feedback
47+
48+
We'd love to hear about your experience with the Langfuse MCP server. Share your feedback, ideas, and use cases in our [GitHub Discussion](https://github.com/orgs/langfuse/discussions/10605).
49+
50+
## Get Started
51+
52+
- [MCP Server Documentation](/docs/api-and-data-platform/features/mcp-server) - Complete setup guide
53+
- [Prompt Management with MCP](/docs/prompt-management/features/mcp-server) - Prompt-specific workflows
Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
---
2+
title: Langfuse MCP Server
3+
sidebarTitle: MCP Server
4+
description: Native Model Context Protocol (MCP) server for Langfuse, enabling AI assistants to interact with your Langfuse data programmatically.
5+
---
6+
7+
# Langfuse MCP Server
8+
9+
Langfuse includes a native [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that enables AI assistants and agents to interact with your Langfuse data programmatically.
10+
11+
Currently, the MCP server is available for [Prompt Management](/docs/prompt-management/overview) and will be extended to the rest of the Langfuse data platform in the future. If you have feedback or ideas for new tools, please [share them on GitHub](https://github.com/orgs/langfuse/discussions/10605).
12+
13+
<Callout type="info">
14+
15+
This is the authenticated MCP server for the Langfuse data platform. There is also a public MCP server for the Langfuse documentation ([docs](/docs/docs-mcp)).
16+
17+
</Callout>
18+
19+
## Configuration
20+
21+
The Langfuse MCP server uses a stateless architecture where each API key is scoped to a specific project. Use the following configuration to connect to the MCP server:
22+
23+
<Tabs items={["Cloud EU", "Cloud US", "HIPAA US", "Self-Hosted"]}>
24+
25+
<Tab>
26+
27+
- Endpoint: `https://cloud.langfuse.com/api/public/mcp`
28+
- Transport: `streamableHttp`
29+
- Authentication: Basic Auth via authorization header
30+
31+
</Tab>
32+
33+
<Tab>
34+
35+
- Endpoint: `https://us.langfuse.com/api/public/mcp`
36+
- Transport: `streamableHttp`
37+
- Authentication: Basic Auth via authorization header
38+
39+
</Tab>
40+
41+
<Tab>
42+
43+
- Endpoint: `https://hipaa.langfuse.com/api/public/mcp`
44+
- Transport: `streamableHttp`
45+
- Authentication: Basic Auth via authorization header
46+
47+
</Tab>
48+
49+
<Tab>
50+
51+
- Endpoint: `https://your-domain.com/api/public/mcp`
52+
- Transport: `streamableHttp`
53+
- Authentication: Basic Auth via authorization header
54+
55+
</Tab>
56+
57+
</Tabs>
58+
59+
## Available Tools
60+
61+
The MCP server provides five tools for comprehensive prompt management.
62+
63+
<Callout type="warning">
64+
**Both read and write tools are available by default.** If you only want to
65+
use read-only tools, configure your MCP client with an allowlist to restrict
66+
access to write operations (`createTextPrompt`, `createChatPrompt`,
67+
`updatePromptLabels`).
68+
</Callout>
69+
70+
### Read Operations
71+
72+
- **`getPrompt`** - Fetch a specific prompt by name with optional label or version
73+
74+
- Supports filtering by production/staging labels
75+
- Returns compiled prompt with metadata
76+
- Read-only operation (auto-approved by clients)
77+
78+
- **`listPrompts`** - List all prompts in the project
79+
- Optional filtering by name, tag, or label
80+
- Cursor-based pagination support
81+
- Returns prompt metadata and available versions
82+
83+
### Write Operations
84+
85+
- **`createTextPrompt`** - Create a new text prompt version
86+
87+
- Supports template variables with `{{variable}}` syntax
88+
- Optional labels, config, tags, and commit message
89+
- Automatic version incrementing
90+
91+
- **`createChatPrompt`** - Create a new chat prompt version
92+
93+
- OpenAI-style message format (role + content)
94+
- Supports system, user, and assistant roles
95+
- Template variables in message content
96+
97+
- **`updatePromptLabels`** - Manage labels across prompt versions
98+
- Add or move labels between versions
99+
- Labels are unique (auto-removed from other versions)
100+
- Cannot modify the auto-managed `latest` label
101+
102+
## Set up
103+
104+
<Steps>
105+
106+
### Get Authentication Header
107+
108+
1. Navigate to your project settings and create or copy a **project-scoped API key**:
109+
- Public Key: `pk-lf-...`
110+
- Secret Key: `sk-lf-...`
111+
2. Encode the credentials to base64 format:
112+
```bash filename="your-base64-token"
113+
echo -n "pk-lf-your-public-key:sk-lf-your-secret-key" | base64
114+
```
115+
116+
### Client Setup
117+
118+
<Tabs items={["Claude Code", "Cursor", "Other MCP Clients"]}>
119+
120+
<Tab>
121+
122+
1. Register the Langfuse MCP server with a single command, replace `{your-base64-token}` with your encoded credentials:
123+
124+
```bash filename="terminal" /{your-base64-token}/
125+
# Langfuse Cloud (EU)
126+
claude mcp add --transport http langfuse https://cloud.langfuse.com/api/public/mcp \
127+
--header "Authorization: Basic {your-base64-token}"
128+
129+
# Langfuse Cloud (US)
130+
claude mcp add --transport http langfuse https://us.langfuse.com/api/public/mcp \
131+
--header "Authorization: Basic {your-base64-token}"
132+
133+
# Self-Hosted (HTTPS required)
134+
claude mcp add --transport http langfuse https://your-domain.com/api/public/mcp \
135+
--header "Authorization: Basic {your-base64-token}"
136+
137+
# Local Development
138+
claude mcp add --transport http langfuse http://localhost:3000/api/public/mcp \
139+
--header "Authorization: Basic {your-base64-token}"
140+
```
141+
142+
2. Verify the connection by asking Claude Code to `list all prompts in the project`. Claude Code should use the `listPrompts` tool to return the list of prompts.
143+
144+
</Tab>
145+
146+
<Tab>
147+
148+
1. Open Cursor Settings (`Cmd/Ctrl + Shift + J`)
149+
2. Navigate to **Tools & Integrations** tab
150+
3. Click **"Add Custom MCP"**
151+
4. Add your Langfuse MCP server configuration, replace `{your-base64-token}` with your encoded credentials:
152+
153+
<Tabs items={["Cloud EU", "Cloud US", "HIPAA US", "Self-Hosted"]}>
154+
155+
<Tab>
156+
157+
```json filename="mcp.json" /{your-base64-token}/
158+
{
159+
"mcp": {
160+
"servers": {
161+
"langfuse": {
162+
"url": "https://cloud.langfuse.com/api/public/mcp",
163+
"headers": {
164+
"Authorization": "Basic {your-base64-token}"
165+
}
166+
}
167+
}
168+
}
169+
}
170+
```
171+
172+
</Tab>
173+
<Tab>
174+
175+
```json filename="mcp.json" /{your-base64-token}/
176+
{
177+
"mcp": {
178+
"servers": {
179+
"langfuse": {
180+
"url": "https://us.cloud.langfuse.com/api/public/mcp",
181+
"headers": {
182+
"Authorization": "Basic {your-base64-token}"
183+
}
184+
}
185+
}
186+
}
187+
}
188+
```
189+
190+
</Tab>
191+
<Tab>
192+
193+
```json filename="mcp.json" /{your-base64-token}/
194+
{
195+
"mcp": {
196+
"servers": {
197+
"langfuse": {
198+
"url": "https://hipaa.cloud.langfuse.com/api/public/mcp",
199+
"headers": {
200+
"Authorization": "Basic {your-base64-token}"
201+
}
202+
}
203+
}
204+
}
205+
}
206+
```
207+
208+
</Tab>
209+
<Tab>
210+
211+
```json filename="mcp.json" /{your-base64-token}/
212+
{
213+
"mcp": {
214+
"servers": {
215+
"langfuse": {
216+
"url": "https://your-domain.com/api/public/mcp",
217+
"headers": {
218+
"Authorization": "Basic {your-base64-token}"
219+
}
220+
}
221+
}
222+
}
223+
}
224+
```
225+
226+
</Tab>
227+
</Tabs>
228+
229+
5. Save the file and restart Cursor
230+
6. The server should appear in the MCP settings with a green dot indicating it's active
231+
232+
</Tab>
233+
234+
<Tab>
235+
236+
- Endpoint: `/api/public/mcp`
237+
- EU: `https://cloud.langfuse.com/api/public/mcp`
238+
- US: `https://us.langfuse.com/api/public/mcp`
239+
- HIPAA: `https://hipaa.langfuse.com/api/public/mcp`
240+
- Self-Hosted: `https://your-domain.com/api/public/mcp`
241+
- Transport: `streamableHttp`
242+
- Authentication: Basic Auth via authorization header
243+
- `Authorization: Basic {your-base64-token}`
244+
245+
</Tab>
246+
</Tabs>
247+
248+
</Steps>
249+
250+
## Use Cases
251+
252+
The MCP server enables powerful workflows for AI-assisted prompt management:
253+
254+
- **Prompt Creation**: "Create a new chat prompt for customer support with system instructions and example messages"
255+
- **Version Management**: "Update the staging label to point to version 3 of the email-generation prompt"
256+
- **Prompt Discovery**: "List all prompts tagged with 'production' and show their latest versions"
257+
- **Iterative Development**: "Create a new version of the code-review prompt with improved instructions"
258+
259+
## Feedback
260+
261+
We'd love to hear about your experience with the Langfuse MCP server. Share your feedback, ideas, and use cases in our [GitHub Discussion](https://github.com/orgs/langfuse/discussions/10605).
262+
263+
## Related Documentation
264+
265+
- [Prompt Management with MCP](/docs/prompt-management/features/mcp-server) - Prompt-specific workflows and examples
266+
- [Prompt Management Overview](/docs/prompt-management/overview) - Learn about Langfuse prompt management
267+
- [Public API](/docs/api-and-data-platform/features/public-api) - REST API for programmatic access

pages/docs/api-and-data-platform/overview.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@ import {
3131
Download,
3232
Cloud,
3333
Sliders,
34+
Blocks,
3435
} from "lucide-react";
3536

3637
<Cards num={3}>
38+
<Card
39+
title="MCP Server"
40+
href="/docs/api-and-data-platform/features/mcp-server"
41+
icon={<Blocks />}
42+
arrow
43+
/>
3744
<Card
3845
title="Public API"
3946
href="/docs/api-and-data-platform/features/public-api"

pages/docs/docs-mcp.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ The Langfuse Docs MCP server exposes the Langfuse docs to AI agents.
44

55
Core use case: Use Cursor (or other AI Coding Agent) to automatically integrate Langfuse Tracing into your codebase, see [get started](/docs/get-started) for detailed instructions and an example prompt.
66

7+
<Callout type="info">
8+
9+
This is the public MCP server for the Langfuse documentation. There is also an authenticated MCP server to integrate with the rest of the Langfuse data platform ([docs](/docs/api-and-data-platform/features/mcp-server)).
10+
11+
</Callout>
12+
713
## Install
814

915
import DocsMcpServerInstallation from "@/components-mdx/docs-mcp-server-installation.mdx";

0 commit comments

Comments
 (0)