MCP Gateway · OpenCode
Connect Exa to OpenCode
Exa gives OpenCode a way to look things up without leaving the shell: web search, full-page reading and programming answers. It sits in the mcp block of your config as a remote server. Speakeasy's OpenCode plugin checks every prompt and tool call before it runs, and reports token and cost totals for each turn.
- Category
- AI & search
- Tools
- 8
- Authentication
- None
- OpenCode
- Terminal
Behind the MCP Gateway
Run Exa MCP behind the MCP Gateway
One URL for every agent, sign-in through your IdP, RBAC down to the tool, and every Exa call inspected and logged.
Set up
Add Exa to OpenCode in 4 steps
- 01
Add Exa from the catalog
An admin finds Exa 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.
- 02
Choose who can use Exa
Give teams the
mcp:connectscope on the Exa server through team access or a role. OpenCode connects to the Exa 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 Exa 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, Exa'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 Exa
Answer a quick programming question
Ask OpenCode how to do something in a language you rarely touch, like a shell one-liner or a regex flag, and it returns code and docs from Exa.
Read a vendor status page
When a build fails because a hosted service is down, have OpenCode find and read the vendor's status or incident page and tell you whether to wait or work around it.
Collect references for a design note
Writing a README or an architecture decision record? OpenCode searches for the articles and docs behind the decision and reads them, so the note cites real pages.
Tools
8 tools
Each Exa tool can be allowed or denied per team and role at the MCP Gateway before OpenCode sees it.
web_search_exa
Search the web for any topic and get clean, ready-to-use content.
company_research_exa
[Deprecated: Use web_search_advanced_exa instead] Research any company to get business information, news, and insights.
crawling_exa
Read a webpage's full content as clean markdown. Use after web_search_exa when highlights are insufficient or to read any URL.
people_search_exa
[Deprecated: Use web_search_advanced_exa instead] Find people and their professional profiles.
linkedin_search_exa
⚠️ DEPRECATED: This tool is deprecated. Please use 'people_search_exa' instead. This tool will be removed in a future version. For now, it searches for people on LinkedIn using Exa AI - finds professional profiles and people.
deep_researcher_start
[Deprecated] Start an AI research agent that searches, reads, and writes a detailed report. Takes 15 seconds to 2 minutes.
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 Exa call is logged with the person and the client that made it.
Access by role
Gateway
People reach only the Exa tools their team or role allows.
Request and response blocking
Gateway
A risk policy scoped to Exa 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
Where is Exa tool output blocked for OpenCode?
Do I need an Exa API key in my OpenCode config?
How do OpenCode users get Exa?
Are Exa calls from OpenCode logged?
Connect more