---
title: "Finish signing in to an MCP server"
method: POST
path: "/api/v1/org-mcp-servers/sign-ins/complete"
tags: ["authed"]
---

# Finish signing in to an MCP server

`POST /api/v1/org-mcp-servers/sign-ins/complete`

## Request

- Base URL: `https://api.teaflask.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.teaflask.com/api/v1/org-mcp-servers/sign-ins/complete`
- Auth: none declared

Finishes a sign-in the callback page received: adds the server (201)
or reconnects it (200). Finishing the same sign-in again answers the
server it already connected.

## Request body

- object
  - `state` string, required: The state the sign-in page returned.
  - `code` string, password, nullable: The code the sign-in page returned.
  - `iss` string, nullable: The iss the sign-in page returned, if any.
  - `error` string, nullable: The error the sign-in page returned, if any.
  - `url` string, password, nullable: When adding a server: the address the sign-in started with.
  - `display_name` string, nullable: When adding a server: its name in the dashboard.

## Response `200`

Successful Response

- OrgMcpServerResponse
  - `id` string, uuid, required: The server's id.
  - `handle` string, required: The server's short name in agent tool names; it never changes.
  - `display_name` string, required: The server's name in the dashboard.
  - `host` string, required: The host name of the server's address.
  - `state` 'active' | 'needs_reconnect' | 'failed', required
  - `last_error` string, nullable, required: Why the server last failed to connect, or null.
  - `sign_in` 'oauth' | 'token' | 'none', required
  - `signed_in_by` OrgMcpServerSignedInBy, required
    - `id` string, uuid, required: The person's id.
    - `name` string, required: The person's name, or their email without one.
  - `header_names` string[], required: The names of the headers carrying its access token.
  - `tool_count` integer, required: How many tools the server lists now.
  - `new_tool_count` integer, required: How many of those arrived after the server was added.
  - `skipped_tools` OrgMcpServerSkippedTool[], required: Tools the server lists that agents can't use, and why.
    - `name` string, required: The tool's name on the server.
    - `reason` string, required: Why agents can't use this tool.
  - `first_listed_at` string, date-time, required: When the server was added.
  - `tools_refreshed_at` string, date-time, required: When its tool list was last read.
  - `removed_at` string, date-time, nullable, required: When the server was removed, or null while it is live.
  - `created_at` string, date-time, required: When the server was created.
  - `version` integer, required: Pass back as expected_version when renaming the server.

## Other responses

- `201`: The server was added
- `401`: Unauthorized
- `403`: Forbidden
- `404`: The server is gone
- `405`: Method not allowed
- `409`: The sign-in can't be finished here, was cancelled, or the server is already added or changed
- `422`: The request was refused, or the server couldn't be connected
- `429`: Too many dials this minute or day
- `500`: Internal server error

---

[API](https://skmtc.dev/teaflask/apis/teaflask-api.md) - [All operations](https://skmtc.dev/teaflask/apis/teaflask-api/llms.txt) - [OpenAPI document](https://skmtc.dev/teaflask/apis/teaflask-api/revisions/d23e9286b847?raw)
