Provides API endpoints related to mcp
Summary
Functions
Add MCP server
Authenticate MCP OAuth
Complete MCP OAuth
Remove MCP OAuth
Start MCP OAuth
post /mcp/{name}/connect
post /mcp/{name}/disconnect
Get MCP status
Types
Functions
@spec mcp_add(body :: map(), opts :: keyword()) :: {:ok, map()} | {:error, OpenCode.Generated.BadRequestError.t()}
Add MCP server
Dynamically add a new Model Context Protocol (MCP) server to the system.
Options
directoryworkspace
Request Body
Content Types: application/json
@spec mcp_auth_authenticate(name :: String.t(), opts :: keyword()) :: {:ok, OpenCode.Generated.MCPStatusConnected.t() | OpenCode.Generated.MCPStatusDisabled.t() | OpenCode.Generated.MCPStatusFailed.t() | OpenCode.Generated.MCPStatusNeedsAuth.t() | OpenCode.Generated.MCPStatusNeedsClientRegistration.t()} | {:error, OpenCode.Generated.McpUnsupportedOAuthError.t() | OpenCode.Generated.NotFoundError.t()}
Authenticate MCP OAuth
Start OAuth flow and wait for callback (opens browser).
Options
directoryworkspace
@spec mcp_auth_callback(name :: String.t(), body :: map(), opts :: keyword()) :: {:ok, OpenCode.Generated.MCPStatusConnected.t() | OpenCode.Generated.MCPStatusDisabled.t() | OpenCode.Generated.MCPStatusFailed.t() | OpenCode.Generated.MCPStatusNeedsAuth.t() | OpenCode.Generated.MCPStatusNeedsClientRegistration.t()} | {:error, OpenCode.Generated.BadRequestError.t() | OpenCode.Generated.NotFoundError.t()}
Complete MCP OAuth
Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.
Options
directoryworkspace
Request Body
Content Types: application/json
@spec mcp_auth_remove(name :: String.t(), opts :: keyword()) :: {:ok, mcp_auth_remove_200_json_resp()} | {:error, OpenCode.Generated.NotFoundError.t()}
Remove MCP OAuth
Remove OAuth credentials for an MCP server.
Options
directoryworkspace
@spec mcp_auth_start(name :: String.t(), opts :: keyword()) :: {:ok, mcp_auth_start_200_json_resp()} | {:error, OpenCode.Generated.McpUnsupportedOAuthError.t() | OpenCode.Generated.NotFoundError.t()}
Start MCP OAuth
Start OAuth authentication flow for a Model Context Protocol (MCP) server.
Options
directoryworkspace
post /mcp/{name}/connect
Connect an MCP server.
Options
directoryworkspace
post /mcp/{name}/disconnect
Disconnect an MCP server.
Options
directoryworkspace
Get MCP status
Get the status of all Model Context Protocol (MCP) servers.
Options
directoryworkspace