Connect OpenCode
Use LeadsAgent from OpenCode with a remote MCP server and your own API key.
Set up with your AI assistant
Paste the prompt into OpenCode. It includes setup steps and a read-only connection check.
OpenCode — Terminal (CLI): sign in with LeadsAgent (recommended)
The opencode command and its terminal UI.
- OpenCode V2: add the server for all projects (drop --global for this project only).Terminal · V2
opencode mcp add leadsagent --url https://leadsagent.io/mcp/v1 --global - Or merge this V2 configuration into opencode.json. V2 nests servers under mcp.servers.opencode.json · V2
{ "mcp": { "servers": { "leadsagent": { "type": "remote", "url": "https://leadsagent.io/mcp/v1", "disabled": false } } } } - OpenCode V1: run opencode mcp add and answer the prompts (remote, the URL above). Or merge this into opencode.json.opencode.json · V1
{ "mcp": { "leadsagent": { "type": "remote", "url": "https://leadsagent.io/mcp/v1" } } } - Start sign-in.Terminal
opencode mcp auth leadsagent - A browser opens. Sign in with your LeadsAgent account and approve access.
- Check it.Terminal
opencode mcp list
OpenCode — Terminal (CLI): use an API key
- On the LeadsAgent setup page, select “Create an API key”. Name it for this app and set its expiry and limits. Copy it once; it starts with la_.
- Set LEADSAGENT_API_KEY in the environment used by this app. Restart the app so it reads the variable. Keep the value out of chats and shared files.Terminal
LEADSAGENT_API_KEY - OpenCode V2: add the server with the key header. Keep {env:LEADSAGENT_API_KEY} as written; OpenCode fills it in.Terminal · V2
opencode mcp add leadsagent --url https://leadsagent.io/mcp/v1 --header 'X-API-Key={env:LEADSAGENT_API_KEY}' --global - Or merge this V2 configuration into opencode.json. Keep the environment reference as written.opencode.json · V2
{ "mcp": { "servers": { "leadsagent": { "type": "remote", "url": "https://leadsagent.io/mcp/v1", "disabled": false, "oauth": false, "headers": { "X-API-Key": "{env:LEADSAGENT_API_KEY}" } } } } } - OpenCode V1, or to edit by hand: merge this into opencode.json(c). In V2 the entry goes under mcp.servers instead of mcp.opencode.json · V1
{ "$schema": "https://opencode.ai/config.json", "mcp": { "leadsagent": { "type": "remote", "url": "https://leadsagent.io/mcp/v1", "oauth": false, "headers": { "X-API-Key": "{env:LEADSAGENT_API_KEY}" } } } } - Restart OpenCode, then check the server. In V2, /mcps also opens the server controls.Terminal
opencode mcp list
OpenCode — Desktop app: sign in with LeadsAgent (recommended)
The OpenCode desktop app (V2). It uses the same opencode.json configuration as the CLI.
- Add the server once from a terminal. The desktop app reads the same global configuration.Terminal
opencode mcp add leadsagent --url https://leadsagent.io/mcp/v1 --global - Restart the desktop app. Open the MCP server controls (/mcps) and connect leadsagent, or run opencode mcp auth leadsagent in a terminal.In OpenCode
/mcps - A browser opens. Sign in with your LeadsAgent account and approve access.
OpenCode — Desktop app: use an API key
- On the LeadsAgent setup page, select “Create an API key”. Name it for this app and set its expiry and limits. Copy it once; it starts with la_.
- Set LEADSAGENT_API_KEY in the environment used by this app. Restart the app so it reads the variable. Keep the value out of chats and shared files.System environment
LEADSAGENT_API_KEY - Add the server once from a terminal.Terminal
opencode mcp add leadsagent --url https://leadsagent.io/mcp/v1 --header 'X-API-Key={env:LEADSAGENT_API_KEY}' --global - Restart the desktop app so it reads the variable. Open /mcps to check leadsagent is connected.In OpenCode
/mcps
Source: OpenCode docs: MCP servers · Open in Connectors