---
title: "Start MCP OAuth"
method: POST
path: "/mcp/{name}/auth"
---

# Start MCP OAuth

`POST /mcp/{name}/auth`

Start OAuth authentication flow for a Model Context Protocol (MCP) server.

## Path parameters

- `name` string, required

## Query parameters

- `directory` string
- `workspace` string

## Response `200`

OAuth flow started

- object
  - `authorizationUrl` string, required — URL to open in browser for authorization

## Other responses

- `400` — Bad request
- `404` — Not found

## Changes

- **2026-04-25** `0a2d50cb4204` — 1 info
  - added the new optional `query` request parameter `workspace`
- **2025-12-16** `dc065d96c390` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kaaass/apis/opencode/changes/mcp/:name/auth/post.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) · [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kaaass/opencode/revisions/8bb9a15bd144/schema)
