watch_agentsLABSCO SUMMARY
Trace debugging without opening the dashboard.
Langfuse already holds the answer to why a run cost what it cost; the friction is going to look. Pulling the trace and the metrics into the session where the agent is being fixed puts the evidence next to the code.
What it is
A monitoring server over Langfuse. It watches instrumented agents, reads a single trace in detail for a failed execution, returns latency, cost and token metrics, and analyses performance across a time period — including comparing agent versions through metadata filters.
What you get
- Instrumented agents monitored in real time
- A detailed trace read for one execution, for debugging a failure
- Latency, cost and token usage metrics
- Performance analysed across a time period
- Agent versions compared through metadata filters
- Stdio for Claude Desktop and Cursor, or Streamable HTTP and SSE for anything else
Requirements
Python 3.11 or higher, a Langfuse account, and agents already instrumented to send traces there — this reads Langfuse, it does not instrument anything for you. LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY and LANGFUSE_HOST go in the environment or a .env file. For a URL-based connection, start it in Streamable HTTP mode and point the client at its local /mcp endpoint.
Setup effort
Build from source — git clone https://github.com/hardikloglogn/langfuse-mcp-python.git
USE CASES
Debugging a run that failed
Pull the detailed trace for that execution and read what happened step by step.
Finding where the money went
Read latency, cost and token usage directly, rather than inferring spend from the bill.
Judging whether a change helped
Compare performance across time periods, and across agent versions through metadata filters.
Keeping an eye on things while they run
Monitor the instrumented agents as they work, instead of finding out afterwards.
34 tools
Listed in project docs. Your client may show a different list.
get_traceanalyze_performanceget_metricsget_scoressubmit_scoreget_score_configsget_promptscreate_promptdelete_promptget_sessionsget_datasetscreate_datasetcreate_dataset_itemget_modelscreate_modeldelete_modelget_commentsadd_commentdelete_traceget_annotation_queuescreate_annotation_queueget_queue_itemsresolve_queue_itemget_blob_storage_integrationsupsert_blob_storage_integrationget_blob_storage_integration_statusdelete_blob_storage_integrationget_llm_connectionsupsert_llm_connectionget_projectscreate_projectupdate_projectdelete_projectBEFORE YOU INSTALL
What to know first
Tools you get
34 tools named in the project's documentation. Seventeen tools write or delete, including delete_trace, delete_project and delete_model.
Requires
- Python 3.11 or later
- a Langfuse account, with the project public key (LANGFUSE_PUBLIC_KEY, pk-lf-…) and secret key (LANGFUSE_SECRET_KEY, sk-lf-…), and LANGFUSE_HOST (https://cloud.langfuse.com unless you self-host)
- agents already instrumented with Langfuse, so there are traces to read
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/hardikloglogn/langfuse-mcp-python.git
cd langfuse-mcp-python
pip install -e .
cp .env.example .env # then set LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY / LANGFUSE_HOSTMCP Clients
Claude Desktop
{
"mcpServers": {
"langfuse-monitor": {
"command": "python",
"args": [
"-m",
"langfuse_mcp_python"
],
"env": {
"LANGFUSE_PUBLIC_KEY": "<YOUR_LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<YOUR_LANGFUSE_SECRET_KEY>",
"LANGFUSE_HOST": "https://cloud.langfuse.com"
}
}
}
}Runs the copy you installed with pip install -e . above, so python has to be that same interpreter: give its full path if you installed into a virtual environment. <YOUR_LANGFUSE_PUBLIC_KEY> and <YOUR_LANGFUSE_SECRET_KEY> are your Langfuse project's public and secret keys.
Cursor
{
"mcpServers": {
"langfuse-monitor": {
"command": "python",
"args": [
"-m",
"langfuse_mcp_python"
],
"env": {
"LANGFUSE_PUBLIC_KEY": "<YOUR_LANGFUSE_PUBLIC_KEY>",
"LANGFUSE_SECRET_KEY": "<YOUR_LANGFUSE_SECRET_KEY>"
}
}
}
}Runs the copy you installed with pip install -e . above, so python has to be that same interpreter: give its full path if you installed into a virtual environment. <YOUR_LANGFUSE_PUBLIC_KEY> and <YOUR_LANGFUSE_SECRET_KEY> are your Langfuse project's public and secret keys.