langfuse-mcp
CLAUDE.md112 starsChanged 8 months agoMITView on GitHub
This is the master agent instruction file for this repository. Keep repository policy here. AGENTS.md exists only as a Codex compatibility shim and should contain only Codex-specific notes. Langfuse MCP server for accessing Langfuse telemetry such as traces, observations, prompts, and datasets via MCP. The CLI entrypoint is langfuse-mcp, which runs langfuse_mcp.__main__:main using MCPServer.
- Reads credentials
- Installs packages
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/langfuse-mcp-general-rules.mdcCursor rule
- langfuseSkill
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 54
Use type hints and Google-style docstrings.
- Distinctive: line 61
Update README tool docs and examples.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude Code Instructions
This is the master agent instruction file for this repository. Keep repository policy here. AGENTS.md exists only as a Codex compatibility shim and should contain only Codex-specific notes.
Project summary
Langfuse MCP server for accessing Langfuse telemetry such as traces, observations, prompts, and datasets via MCP.
The CLI entrypoint is langfuse-mcp, which runs langfuse_mcp.__main__:main using MCPServer.
Repo layout
langfuse_mcp/__main__.py: Core server implementation and tool definitionstests/: Pytest suite; integration tests are marked withpytest.mark.integration
Dev setup (uv)
uv venv --python 3.11 .venv
source .venv/bin/activate
uv pip install -e ".[dev]"Common commands
uv run python -m langfuse_mcp --public-key YOUR_KEY --secret-key YOUR_SECRET --host https://cloud.langfuse.com
uv run -m pytest
uv run -m ruff format .
uv run -m ruff check --fix .Supply chain / dependencies
pyproject.tomlsets[tool.uv] exclude-newer = "7 days"as a deliberate supply-chain quarantine:uv lock/uv syncwill not resolve any package version published in the last 7 days, blocking freshly-published malicious versions from landing in dependency resolution. Dependabot'scooldownonly delays generated PRs and does not cover ad-hoc lock/sync — the two are complementary.- The relative-duration syntax (
"7 days","1 week","24 hours") requires uv ≥ 0.9 (added via astral-sh/uv#16814, Dec 2025). Older uv versions emit a parse warning or hard-fail; that is a local-toolchain problem, not a config bug. Bump local uv before assuming the line is broken. - Do not remove
exclude-neweror any other security/supply-chain config as "dead" or "noisy" without confirming what it gates. Investigate root cause (uv version, syntax change) before deleting protections. Past incident: a "follow-up cleanup" PR almost shipped removal of this line.
Release Contract
- Release from
mainonly through./scripts/release.sh X.Y.Zor theRelease requestGitHub Actions workflow (workflow_dispatchversionX.Y.Z) and the resulting release PR; do not create manual tags, GitHub releases, or ad hoc release uploads. - A push to
mainupdates the AvivSinai marketplace immediately for thelangfuseskill. - Keep one version across
CHANGELOG.mdand skill/plugin metadata in the release commit; after merge, CI validates the merged commit, creates the tag, and then publishes the GitHub release plus PyPI and Docker artifacts. The committed changelog entry becomes the GitHub release notes, while the Python package version remains tag-derived viauv-dynamic-versioning.
Environment variables
LANGFUSE_PUBLIC_KEY,LANGFUSE_SECRET_KEY,LANGFUSE_HOSTLANGFUSE_MCP_LOG_FILEdefaults to/tmp/langfuse_mcp.logLANGFUSE_MCP_TOOLSselects comma-separated tool groupsLANGFUSE_MCP_DEFAULT_OUTPUT_MODEsets the default MCP tooloutput_modeLANGFUSE_MCP_TRACE_TIMEOUT_SECONDSsets the per-request read timeout (seconds) for single-trace fetches (fetch_trace); defaults to120
Code style
- Use type hints and Google-style docstrings.
- Ruff enforces formatting and lint rules.
- Target Python is 3.10+ with a 140-character line length.
When adding tools
- Add tests.
- Update README tool docs and examples.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

