external_mcp

command
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Demonstrates WithMCPServers: attach an external MCP server to every new session. The server runs in its own process — opencode launches it over whichever transport is declared (stdio, HTTP, or SSE) and discovers its tools automatically.

This example defaults to the everything-server reference implementation over stdio:

npx -y @modelcontextprotocol/server-everything

Override the command + args with the EXTERNAL_MCP_COMMAND (space-separated) environment variable to point at a different stdio MCP server, e.g.

EXTERNAL_MCP_COMMAND="uvx mcp-server-time" go run ./examples/external_mcp

For HTTP/SSE transports, substitute `acp.McpServer{Http: ...}` for the stdio block below.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL