Skip to main content
Back to the Amplitude MCP server

MCP Gateway · OpenCode

Amplitude icon

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.

Deploy on MCP Gateway

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

  1. Find your data region from the Amplitude hostname and record the matching server URL.
  2. In Settings, Content Access > MCP, confirm the MCP server is allowed.
  3. For custom roles, enable Use MCP (read), and Use MCP (write) only if needed.
Full Amplitude setup guide in the docs

Set up

Add Amplitude to OpenCode in 4 steps

  1. 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.

  2. 02

    Choose who can use Amplitude

    Give teams the mcp:connect scope 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.

  3. 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 mcp block of your OpenCode config with type set to remote.

    Restart OpenCode and sign in when prompted.

    {
      "mcp": {
        "<server slug>": {
          "type": "remote",
          "url": "<URL from the hosted install page>"
        }
      }
    }
  4. 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.

get_transformationsget_events

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.

get_workspace_settingsget_project_context

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.

See all 44 tools

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?
OpenCode has no OpenTelemetry exporter, so session data comes through the Speakeasy plugin, with token and cost totals reported per turn. The device agent can install and maintain that observability package.
Do I need an Amplitude credential in my OpenCode config?
No. Agents never hold an Amplitude credential. Each person signs in with their own Amplitude account and keeps the project access that account already has.
How do OpenCode users get Amplitude?
An admin adds Amplitude from the Speakeasy MCP Catalog and grants access by team or role. Add the server to OpenCode's own mcp config block as a remote server. Each person then sees only the Amplitude tools their access allows.
Are Amplitude calls from OpenCode logged?
Yes. Amplitude calls go through the MCP Gateway, which logs each tool call and attributes it to the person and the client that made it.

Connect more

Amplitude in other clients

AI everywhere.

Control here.