Connect OpenCode to Langfuse
Set up in minutes
Choose where it runs
On your computer through your own OpenCode, or hosted in the cloud. The rest of setup adapts to your choice:
Pick what it can do in Langfuse
A preset of real Langfuse operations. Each one becomes a tool the agent can call, and it can't touch anything outside the list.
Connect Langfuse
One sign-in. The agent acts through your account, scoped to the operations you picked.
Add your personal MCP link
The last step mints a private MCP URL for this agent and walks you through exactly this, with your real link filled in. The page flips to Connected the moment your OpenCode first calls in. opencode mcp add only saves the config. OpenCode connects when it starts — run opencode, or restart a running one.
1. Run this in your terminal
2. Choose Remote and paste your server URL
3. Choose No when asked about OAuth authentication — the link itself is the key
<your-link> is your personal server URL — setup mints it for you.
Tools OpenCode gets
Langfuse
19 toolsRead the project associated with this project API key.
List prompt metadata, versions and labels.
Get a prompt, optionally selecting its version or label.
Create a text prompt or a new version of an existing prompt.
Replace a prompt version's deployment labels; labels move between versions.
List evaluation datasets.
Get dataset metadata by name.
Create an evaluation dataset.
List dataset items, optionally filtering by dataset and source trace.
Get one dataset item.
Create an item or update the supplied project-unique item ID.
Irreversibly delete a dataset item and all its run items.
Read observation rows using the current v2 cursor API.
Read evaluation scores using the current v3 cursor API.
Submit one numeric trace score for asynchronous processing.
Delete a score by its Langfuse ID.
List comments in the project.
Get a comment by ID.
Attach a comment to a trace, observation, session or prompt.
About OpenCode
Frequently asked questions
More ways to connect
More tools for OpenCode
Use Langfuse with other agents
Open your OpenCode agent in one click.
NoClick runs OpenCode for you with Langfuse wired in as tools. Connect your account and run.