Skip to main content
Back to the Glean MCP server

MCP Gateway · OpenCode

Glean icon

Connect Glean to OpenCode

Added as a remote server in OpenCode's mcp config, Glean lets the agent search your company's knowledge without leaving the shell. That covers on-call notes, platform docs and past decisions that never made it into the repo. The OpenCode plugin sends each prompt and tool call to Speakeasy for an allow or deny decision before it runs.

Category
Productivity
Authentication
None
OpenCode
Terminal

Behind the MCP Gateway

Run Glean MCP behind the MCP Gateway

One URL for every agent, sign-in through your IdP, RBAC down to the tool, and every Glean call inspected and logged.

Deploy on MCP Gateway

Set up

Add Glean to OpenCode in 4 steps

  1. 01

    Add Glean from the catalog

    An admin finds Glean 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.

    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 Glean

    Give teams the mcp:connect scope on the Glean server through team access or a role. OpenCode connects to the Glean 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 Glean from OpenCode

    The first time OpenCode connects, it opens a browser so the person can sign in to Speakeasy through your identity provider.

    From then on, Glean'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 Glean

Search on-call notes during an alert

When an alert fires, ask OpenCode to search Glean for previous incidents and on-call notes about that service and summarize what fixed it before.

Look up internal platform commands

OpenCode finds the platform team's documented commands for deploying, rotating secrets or requesting access, so you run the approved steps in your shell.

Answer a review question with sources

When a reviewer asks why a choice was made, OpenCode searches Glean for the discussion or doc that settled it and gives you a link to cite.

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 Glean call is logged with the person and the client that made it.

Access by role

Gateway

People reach only the Glean tools their team or role allows.

Request and response blocking

Gateway

A risk policy scoped to Glean 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 usage for Glean searches?
OpenCode has no OpenTelemetry exporter, so session data comes through the Speakeasy plugin. Token and cost totals flow through it, reported per turn.
Where is Glean output blocked for OpenCode?
Tool output is blocked at the gateway rather than in OpenCode's hooks. Prompt injection detection and PII redaction run on every Glean tool call there.
How do OpenCode users get Glean?
An admin adds Glean 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 Glean tools their access allows.
Are Glean calls from OpenCode logged?
Yes. Glean 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

Glean in other clients

AI everywhere.

Control here.