MCP Gateway · OpenCode
Connect Amplitude to OpenCode
Numbers in Amplitude are only as good as the data behind them. From the OpenCode terminal, through the Speakeasy MCP Gateway, you can inspect the transformations that merge events, check governance settings and validate a chart definition before running it. The OpenCode plugin sends each prompt and tool call to Speakeasy, which allows or denies it before it runs.
- Category
- Data & analytics
- Tools
- 44
- Authentication
- OAuth
- OpenCode
- Terminal
Behind the MCP Gateway
Run Amplitude MCP behind the MCP Gateway
One URL for every agent, sign-in through your IdP, RBAC down to the tool, and every Amplitude call inspected and logged.
Before you start
What Amplitude needs first
An Amplitude organization admin does the Amplitude side of the setup.
- There is nothing to create in Amplitude. Users sign in with their own accounts and keep their existing permissions.
- US and EU organizations use different server URLs, and the two are not interchangeable.
- Custom roles need Use MCP (read) enabled, or MCP calls fail for that role.
In Amplitude
- Find your data region from the Amplitude hostname and record the matching server URL.
- In Settings, Content Access > MCP, confirm the MCP server is allowed.
- For custom roles, enable Use MCP (read), and Use MCP (write) only if needed.
Set up
Add Amplitude to OpenCode in 4 steps
- 01
Add Amplitude from the catalog
An admin finds Amplitude in the MCP Catalog (MCP Gateway > MCP > Catalog) and clicks Add. Speakeasy registers the vendor's server as a remote MCP server and proxies sessions to it. Nothing is copied or re-hosted.
Amplitude uses OAuth. Servers that support dynamic client registration get their OAuth configuration applied automatically.
Where MCP-scoped policies are enabled, the install offers a recommended risk policy for the new server that detects secrets and PII and inspects tool requests and responses.
- 02
Choose who can use Amplitude
Give teams the
mcp:connectscope on the Amplitude server through team access or a role. OpenCode connects to the Amplitude server's own URL, and the server's authorization decides who can connect and which tools they can call. - 03
Connect OpenCode
Add the server to OpenCode's own mcp config block as a remote server.
Copy the server's URL from its hosted install page in Speakeasy.
Add it to the
mcpblock of your OpenCode config withtypeset toremote.Restart OpenCode and sign in when prompted.
{ "mcp": { "<server slug>": { "type": "remote", "url": "<URL from the hosted install page>" } } } - 04
Sign in and use Amplitude from OpenCode
The first time OpenCode connects, it opens a browser so the person can sign in to Speakeasy through your identity provider.
Amplitude needs its own OAuth grant, so each person connects it once. Until they do, Amplitude calls fail while the rest of the gateway keeps working.
From then on, Amplitude's tools appear in OpenCode, limited to what the person's access allows, and every call lands in the gateway's tool logs.
OpenCode doesn't receive MCP servers from plugins. The observability package is installed separately, from a ZIP or with speakeasy-hooks install --provider=opencode, and the device agent can maintain it.
Use cases
What OpenCode users do with Amplitude
Trace a metric back to transformations
When a count looks wrong after a tracking change, ask OpenCode to list the project's transformations and see which merged events or remapped property values feed the number.
Validate a query before running it
OpenCode fetches the parameter schema for a chart type, checks and corrects the definition, then runs it. That helps when you script the same analysis across several projects.
get_chart_definition_paramsverify_chart_definitionquery_dataset
Review data governance settings
Read the project's settings and its data workspace configuration for governance and data quality, and compare them with what your tracking code assumes before opening a pull request.
Tools
44 tools
Each Amplitude tool can be allowed or denied per team and role at the MCP Gateway before OpenCode sees it.
get_charts
Retrieve full chart objects by their IDs using the chart service directly
save_chart_edits
Save temporary chart edits as permanent charts
get_cohorts
Get detailed information about specific cohorts by their IDs.
create_cohort
Create a new cohort with the provided definition and configuration.
get_context
Get information about the current user, organization, and list of accessible projects.
get_project_context
Get project-specific settings and configuration for a specific project.
Control
What Speakeasy can see and stop in OpenCode
The gateway covers every client the same way. The rest depends on what OpenCode exposes to Speakeasy.
Tool logs
Gateway
Every Amplitude call is logged with the person and the client that made it.
Access by role
Gateway
People reach only the Amplitude tools their team or role allows.
Request and response blocking
Gateway
A risk policy scoped to Amplitude can reject a tool request before it reaches the server, or withhold a result from OpenCode. MCP-scoped policies are enabled per organization.
Prompt and tool-call blocking
OpenCode
The OpenCode plugin sends each prompt and tool call to Speakeasy, which allows or denies it before it runs.
Usage telemetry
OpenCode
Token and cost totals flow through the plugin, reported per turn.
Device agent
OpenCode
The device agent installs and maintains the observability package.
- OpenCode has no OpenTelemetry exporter, so session data comes through the plugin.
- Tool output is blocked at the gateway rather than in OpenCode's hooks.
Questions
Frequently asked questions
How does OpenCode report Amplitude usage?
Do I need an Amplitude credential in my OpenCode config?
How do OpenCode users get Amplitude?
Are Amplitude calls from OpenCode logged?
Connect more