Skip to content

Connections (MCP servers)

External tool servers (Model Context Protocol) that the agent may call on the user's behalf — GitHub, Linear, an internal API — connected from the Connections page with the user's own login (OAuth) or an API key.

Endpoints

MethodPathPurpose
GET/mcp-servers/servers/My connected servers
POST/mcp-servers/servers/Connect a server
GET/mcp-servers/servers/{id}/Get a server
PUT/mcp-servers/servers/{id}/Update a server
DELETE/mcp-servers/servers/{id}/Disconnect a server
POST/mcp-servers/servers/{id}/test/Test a saved server
POST/mcp-servers/servers/test/Test an unsaved configuration
POST/mcp-servers/servers/discover/Does this server support sign-in?
POST/mcp-servers/servers/{id}/oauth/start/Start sign-in for an OAuth server
POST/mcp-servers/oauth/callback/Finish sign-in

GET /mcp-servers/servers/

My connected servers

Auth: Session token · In the app: Connections page

Response 200 — Servers, newest first.

Array of:

FieldTypeDescription
idinteger
labelstringDisplay name.
slugstringShort key the agent uses to name the server's tools.
urlstringThe server's MCP endpoint (HTTPS).
auth_typestring ("none", "bearer", "header", "oauth")
auth_header_namestringFor header auth (e.g. X-API-Key).
secretstringWrite-only token / API key for bearer and header auth.
has_secretboolean
enabledbooleanDisabled servers are kept but not offered to the agent.
statusstring ("untested", "ok", "error", "needs_reauth")
last_ok_atstring (date-time), nullable
last_errorstring
tool_countintegerTools discovered on the last successful test.
tool_namesstring[]
granted_scopesstringOAuth scopes granted (space-separated).
token_expires_atstring (date-time), nullable
oauth_providerstring, nullableHost of the OAuth issuer, e.g. mcp.notion.com.
created_atstring (date-time)
updated_atstring (date-time)
userinteger

Example

bash
curl -X GET "https://api.example.com/mcp-servers/servers/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

POST /mcp-servers/servers/

Connect a server

Saves the connection (max 10 per user). For oauth servers, follow with oauth/start/; for token-based ones, test it with {id}/test/.

Auth: Session token · In the app: Connections → Add

Request body (application/json)

FieldTypeRequiredDescription
idintegerno
labelstringnoDisplay name.
slugstringnoShort key the agent uses to name the server's tools.
urlstringnoThe server's MCP endpoint (HTTPS).
auth_typestring ("none", "bearer", "header", "oauth")no
auth_header_namestringnoFor header auth (e.g. X-API-Key).
secretstringnoWrite-only token / API key for bearer and header auth.
has_secretbooleanno
enabledbooleannoDisabled servers are kept but not offered to the agent.
statusstring ("untested", "ok", "error", "needs_reauth")no
last_ok_atstring (date-time), nullableno
last_errorstringno
tool_countintegernoTools discovered on the last successful test.
tool_namesstring[]no
granted_scopesstringnoOAuth scopes granted (space-separated).
token_expires_atstring (date-time), nullableno
oauth_providerstring, nullablenoHost of the OAuth issuer, e.g. mcp.notion.com.
created_atstring (date-time)no
updated_atstring (date-time)no
userintegerno
json
{
  "label": "Internal tools",
  "slug": "tools",
  "url": "https://mcp.acme.internal/mcp",
  "auth_type": "header",
  "auth_header_name": "X-API-Key",
  "secret": "s3cret"
}

Response 201 — Saved.

FieldTypeDescription
idinteger
labelstringDisplay name.
slugstringShort key the agent uses to name the server's tools.
urlstringThe server's MCP endpoint (HTTPS).
auth_typestring ("none", "bearer", "header", "oauth")
auth_header_namestringFor header auth (e.g. X-API-Key).
secretstringWrite-only token / API key for bearer and header auth.
has_secretboolean
enabledbooleanDisabled servers are kept but not offered to the agent.
statusstring ("untested", "ok", "error", "needs_reauth")
last_ok_atstring (date-time), nullable
last_errorstring
tool_countintegerTools discovered on the last successful test.
tool_namesstring[]
granted_scopesstringOAuth scopes granted (space-separated).
token_expires_atstring (date-time), nullable
oauth_providerstring, nullableHost of the OAuth issuer, e.g. mcp.notion.com.
created_atstring (date-time)
updated_atstring (date-time)
userinteger
json
{
  "id": 5,
  "label": "GitHub",
  "slug": "github",
  "url": "https://api.githubcopilot.com/mcp/",
  "auth_type": "oauth",
  "auth_header_name": "",
  "has_secret": true,
  "enabled": true,
  "status": "ok",
  "last_ok_at": "2026-09-22T06:00:00Z",
  "last_error": "",
  "tool_count": 42,
  "tool_names": [
    "list_issues",
    "create_issue",
    "search_code"
  ],
  "granted_scopes": "repo read:user",
  "token_expires_at": "2026-09-22T14:00:00Z",
  "oauth_provider": "github.com",
  "created_at": "2026-09-01T09:00:00Z",
  "updated_at": "2026-09-22T06:00:00Z",
  "user": 42
}

Response 400 — Validation error or server limit reached.

json
{
  "detail": "You can connect at most 10 servers."
}

Example

bash
curl -X POST "https://api.example.com/mcp-servers/servers/" \
  -H "Authorization: Token $FINBLADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"label":"Internal tools","slug":"tools","url":"https://mcp.acme.internal/mcp","auth_type":"header","auth_header_name":"X-API-Key","secret":"s3cret"}'

GET /mcp-servers/servers/{id}/

Get a server

Auth: Session token

Path parameters

FieldTypeRequiredDescription
idintegeryes

Response 200 — The server.

FieldTypeDescription
idinteger
labelstringDisplay name.
slugstringShort key the agent uses to name the server's tools.
urlstringThe server's MCP endpoint (HTTPS).
auth_typestring ("none", "bearer", "header", "oauth")
auth_header_namestringFor header auth (e.g. X-API-Key).
secretstringWrite-only token / API key for bearer and header auth.
has_secretboolean
enabledbooleanDisabled servers are kept but not offered to the agent.
statusstring ("untested", "ok", "error", "needs_reauth")
last_ok_atstring (date-time), nullable
last_errorstring
tool_countintegerTools discovered on the last successful test.
tool_namesstring[]
granted_scopesstringOAuth scopes granted (space-separated).
token_expires_atstring (date-time), nullable
oauth_providerstring, nullableHost of the OAuth issuer, e.g. mcp.notion.com.
created_atstring (date-time)
updated_atstring (date-time)
userinteger
json
{
  "id": 5,
  "label": "GitHub",
  "slug": "github",
  "url": "https://api.githubcopilot.com/mcp/",
  "auth_type": "oauth",
  "auth_header_name": "",
  "has_secret": true,
  "enabled": true,
  "status": "ok",
  "last_ok_at": "2026-09-22T06:00:00Z",
  "last_error": "",
  "tool_count": 42,
  "tool_names": [
    "list_issues",
    "create_issue",
    "search_code"
  ],
  "granted_scopes": "repo read:user",
  "token_expires_at": "2026-09-22T14:00:00Z",
  "oauth_provider": "github.com",
  "created_at": "2026-09-01T09:00:00Z",
  "updated_at": "2026-09-22T06:00:00Z",
  "user": 42
}

Response 404 — Not yours.

Example

bash
curl -X GET "https://api.example.com/mcp-servers/servers/<id>/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

PUT /mcp-servers/servers/{id}/

Update a server

Partial update. Changing url, auth_type, auth_header_name or secret resets status (to needs_reauth for OAuth servers).

Auth: Session token

Path parameters

FieldTypeRequiredDescription
idintegeryes

Request body (application/json)

FieldTypeRequiredDescription
idintegerno
labelstringnoDisplay name.
slugstringnoShort key the agent uses to name the server's tools.
urlstringnoThe server's MCP endpoint (HTTPS).
auth_typestring ("none", "bearer", "header", "oauth")no
auth_header_namestringnoFor header auth (e.g. X-API-Key).
secretstringnoWrite-only token / API key for bearer and header auth.
has_secretbooleanno
enabledbooleannoDisabled servers are kept but not offered to the agent.
statusstring ("untested", "ok", "error", "needs_reauth")no
last_ok_atstring (date-time), nullableno
last_errorstringno
tool_countintegernoTools discovered on the last successful test.
tool_namesstring[]no
granted_scopesstringnoOAuth scopes granted (space-separated).
token_expires_atstring (date-time), nullableno
oauth_providerstring, nullablenoHost of the OAuth issuer, e.g. mcp.notion.com.
created_atstring (date-time)no
updated_atstring (date-time)no
userintegerno
json
{
  "enabled": false
}

Response 200 — Updated.

FieldTypeDescription
idinteger
labelstringDisplay name.
slugstringShort key the agent uses to name the server's tools.
urlstringThe server's MCP endpoint (HTTPS).
auth_typestring ("none", "bearer", "header", "oauth")
auth_header_namestringFor header auth (e.g. X-API-Key).
secretstringWrite-only token / API key for bearer and header auth.
has_secretboolean
enabledbooleanDisabled servers are kept but not offered to the agent.
statusstring ("untested", "ok", "error", "needs_reauth")
last_ok_atstring (date-time), nullable
last_errorstring
tool_countintegerTools discovered on the last successful test.
tool_namesstring[]
granted_scopesstringOAuth scopes granted (space-separated).
token_expires_atstring (date-time), nullable
oauth_providerstring, nullableHost of the OAuth issuer, e.g. mcp.notion.com.
created_atstring (date-time)
updated_atstring (date-time)
userinteger
json
{
  "id": 5,
  "label": "GitHub",
  "slug": "github",
  "url": "https://api.githubcopilot.com/mcp/",
  "auth_type": "oauth",
  "auth_header_name": "",
  "has_secret": true,
  "enabled": true,
  "status": "ok",
  "last_ok_at": "2026-09-22T06:00:00Z",
  "last_error": "",
  "tool_count": 42,
  "tool_names": [
    "list_issues",
    "create_issue",
    "search_code"
  ],
  "granted_scopes": "repo read:user",
  "token_expires_at": "2026-09-22T14:00:00Z",
  "oauth_provider": "github.com",
  "created_at": "2026-09-01T09:00:00Z",
  "updated_at": "2026-09-22T06:00:00Z",
  "user": 42
}

Example

bash
curl -X PUT "https://api.example.com/mcp-servers/servers/<id>/" \
  -H "Authorization: Token $FINBLADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"enabled":false}'

DELETE /mcp-servers/servers/{id}/

Disconnect a server

Revokes OAuth tokens with the provider where possible, then deletes the row.

Auth: Session token

Path parameters

FieldTypeRequiredDescription
idintegeryes

Response 200 — Deleted.

FieldTypeDescription
messagestring
json
{
  "message": "OK"
}

Example

bash
curl -X DELETE "https://api.example.com/mcp-servers/servers/<id>/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

POST /mcp-servers/servers/{id}/test/

Test a saved server

Connects, lists tools and records the outcome on the server (status, tool_count, tool_names).

Auth: Session token · In the app: Connections → Test

Path parameters

FieldTypeRequiredDescription
idintegeryes

Response 200 — Probe result.

FieldTypeDescription
okboolean
errorstring
needs_reauthboolean
tool_countinteger
tool_namesstring[]
latency_msinteger
serverobjectAn external MCP (Model Context Protocol) tool server connected by the user. Credentials are write-only and never returned.
server.idinteger
server.labelstringDisplay name.
server.slugstringShort key the agent uses to name the server's tools.
server.urlstringThe server's MCP endpoint (HTTPS).
server.auth_typestring ("none", "bearer", "header", "oauth")
server.auth_header_namestringFor header auth (e.g. X-API-Key).
server.secretstringWrite-only token / API key for bearer and header auth.
server.has_secretboolean
server.enabledbooleanDisabled servers are kept but not offered to the agent.
server.statusstring ("untested", "ok", "error", "needs_reauth")
server.last_ok_atstring (date-time), nullable
server.last_errorstring
server.tool_countintegerTools discovered on the last successful test.
server.tool_namesstring[]
server.granted_scopesstringOAuth scopes granted (space-separated).
server.token_expires_atstring (date-time), nullable
server.oauth_providerstring, nullableHost of the OAuth issuer, e.g. mcp.notion.com.
server.created_atstring (date-time)
server.updated_atstring (date-time)
server.userinteger
json
{
  "ok": true,
  "error": "",
  "tool_count": 42,
  "tool_names": [
    "list_issues",
    "create_issue"
  ],
  "latency_ms": 310
}

Example

bash
curl -X POST "https://api.example.com/mcp-servers/servers/<id>/test/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

POST /mcp-servers/servers/test/

Test an unsaved configuration

Same probe, for the "Add" form before saving. Send the fields of a server; include id to reuse a saved server's stored secret.

Auth: Session token · In the app: Connections → Add → Test

Request body (application/json)

FieldTypeRequiredDescription
idintegerno
labelstringnoDisplay name.
slugstringnoShort key the agent uses to name the server's tools.
urlstringnoThe server's MCP endpoint (HTTPS).
auth_typestring ("none", "bearer", "header", "oauth")no
auth_header_namestringnoFor header auth (e.g. X-API-Key).
secretstringnoWrite-only token / API key for bearer and header auth.
has_secretbooleanno
enabledbooleannoDisabled servers are kept but not offered to the agent.
statusstring ("untested", "ok", "error", "needs_reauth")no
last_ok_atstring (date-time), nullableno
last_errorstringno
tool_countintegernoTools discovered on the last successful test.
tool_namesstring[]no
granted_scopesstringnoOAuth scopes granted (space-separated).
token_expires_atstring (date-time), nullableno
oauth_providerstring, nullablenoHost of the OAuth issuer, e.g. mcp.notion.com.
created_atstring (date-time)no
updated_atstring (date-time)no
userintegerno
json
{
  "id": 5,
  "label": "GitHub",
  "slug": "github",
  "url": "https://api.githubcopilot.com/mcp/",
  "auth_type": "oauth",
  "auth_header_name": "",
  "has_secret": true,
  "enabled": true,
  "status": "ok",
  "last_ok_at": "2026-09-22T06:00:00Z",
  "last_error": "",
  "tool_count": 42,
  "tool_names": [
    "list_issues",
    "create_issue",
    "search_code"
  ],
  "granted_scopes": "repo read:user",
  "token_expires_at": "2026-09-22T14:00:00Z",
  "oauth_provider": "github.com",
  "created_at": "2026-09-01T09:00:00Z",
  "updated_at": "2026-09-22T06:00:00Z",
  "user": 42
}

Response 200 — Probe result.

FieldTypeDescription
okboolean
errorstring
needs_reauthboolean
tool_countinteger
tool_namesstring[]
latency_msinteger
serverobjectAn external MCP (Model Context Protocol) tool server connected by the user. Credentials are write-only and never returned.
server.idinteger
server.labelstringDisplay name.
server.slugstringShort key the agent uses to name the server's tools.
server.urlstringThe server's MCP endpoint (HTTPS).
server.auth_typestring ("none", "bearer", "header", "oauth")
server.auth_header_namestringFor header auth (e.g. X-API-Key).
server.secretstringWrite-only token / API key for bearer and header auth.
server.has_secretboolean
server.enabledbooleanDisabled servers are kept but not offered to the agent.
server.statusstring ("untested", "ok", "error", "needs_reauth")
server.last_ok_atstring (date-time), nullable
server.last_errorstring
server.tool_countintegerTools discovered on the last successful test.
server.tool_namesstring[]
server.granted_scopesstringOAuth scopes granted (space-separated).
server.token_expires_atstring (date-time), nullable
server.oauth_providerstring, nullableHost of the OAuth issuer, e.g. mcp.notion.com.
server.created_atstring (date-time)
server.updated_atstring (date-time)
server.userinteger
json
{
  "ok": true,
  "error": "",
  "tool_count": 42,
  "tool_names": [
    "list_issues",
    "create_issue"
  ],
  "latency_ms": 310
}

Example

bash
curl -X POST "https://api.example.com/mcp-servers/servers/test/" \
  -H "Authorization: Token $FINBLADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"id":5,"label":"GitHub","slug":"github","url":"https://api.githubcopilot.com/mcp/","auth_type":"oauth","auth_header_name":"","has_secret":true,"enabled":true,"status":"ok","last_ok_at":"2026-09-22T06:00:00Z","last_error":"","tool_count":42,"tool_names":["list_issues","create_issue","search_code"],"granted_scopes":"repo read:user","token_expires_at":"2026-09-22T14:00:00Z","oauth_provider":"github.com","created_at":"2026-09-01T09:00:00Z","updated_at":"2026-09-22T06:00:00Z","user":42}'

POST /mcp-servers/servers/discover/

Does this server support sign-in?

Inspects the server's OAuth metadata. available: true means you can connect with auth_type: oauth; needs_admin means the provider requires a pre-registered client an administrator must configure.

Auth: Session token · In the app: Connections → Add (as you type the URL)

Request body (application/json)

FieldTypeRequiredDescription
urlstringyes
json
{
  "url": "https://mcp.notion.com/mcp"
}

Response 200 — Discovery result.

FieldTypeDescription
oauthobject
oauth.availableboolean
oauth.providerstring, nullable
oauth.scopesstring[]
oauth.default_scopesstring[]
oauth.dynamic_registrationboolean
oauth.needs_adminboolean
oauth.errorstring, nullable
json
{
  "oauth": {
    "available": true,
    "provider": "mcp.notion.com",
    "scopes": [],
    "default_scopes": [],
    "dynamic_registration": true,
    "needs_admin": false,
    "error": null
  }
}

Example

bash
curl -X POST "https://api.example.com/mcp-servers/servers/discover/" \
  -H "Authorization: Token $FINBLADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://mcp.notion.com/mcp"}'

POST /mcp-servers/servers/{id}/oauth/start/

Start sign-in for an OAuth server

Returns the provider's authorisation URL to open in a browser. After consent the provider redirects to the app's callback page, which posts code and state to oauth/callback/.

Auth: Session token · In the app: Connections → Sign in

Path parameters

FieldTypeRequiredDescription
idintegeryes

Request body (application/json, optional)

FieldTypeRequiredDescription
scopesstring[]noSubset of the discovered scopes to request.

Response 200 — Redirect the user to auth_url.

FieldTypeDescription
auth_urlstring (uri)
statestring
scopesstring[]
providerstring

Response 400 — The server does not support sign-in, or the provider refused.

json
{
  "detail": "Authentication credentials were not provided."
}

Example

bash
curl -X POST "https://api.example.com/mcp-servers/servers/<id>/oauth/start/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

POST /mcp-servers/oauth/callback/

Finish sign-in

Exchanges the code for tokens, stores them on the server and runs a test. Each state can be used once.

Auth: Session token · In the app: /connections-callback page

Request body (application/json)

FieldTypeRequiredDescription
codestringyes
statestringyes

Response 200 — Signed in; probe result with the updated server.

FieldTypeDescription
okboolean
errorstring
needs_reauthboolean
tool_countinteger
tool_namesstring[]
latency_msinteger
serverobjectAn external MCP (Model Context Protocol) tool server connected by the user. Credentials are write-only and never returned.
server.idinteger
server.labelstringDisplay name.
server.slugstringShort key the agent uses to name the server's tools.
server.urlstringThe server's MCP endpoint (HTTPS).
server.auth_typestring ("none", "bearer", "header", "oauth")
server.auth_header_namestringFor header auth (e.g. X-API-Key).
server.secretstringWrite-only token / API key for bearer and header auth.
server.has_secretboolean
server.enabledbooleanDisabled servers are kept but not offered to the agent.
server.statusstring ("untested", "ok", "error", "needs_reauth")
server.last_ok_atstring (date-time), nullable
server.last_errorstring
server.tool_countintegerTools discovered on the last successful test.
server.tool_namesstring[]
server.granted_scopesstringOAuth scopes granted (space-separated).
server.token_expires_atstring (date-time), nullable
server.oauth_providerstring, nullableHost of the OAuth issuer, e.g. mcp.notion.com.
server.created_atstring (date-time)
server.updated_atstring (date-time)
server.userinteger
json
{
  "ok": true,
  "error": "",
  "tool_count": 42,
  "tool_names": [
    "list_issues",
    "create_issue"
  ],
  "latency_ms": 310
}

Response 400 — Invalid, expired or already-used state; or the provider rejected the code (server is included so the UI can show its state).

json
{
  "detail": "Authentication credentials were not provided."
}

Example

bash
curl -X POST "https://api.example.com/mcp-servers/oauth/callback/" \
  -H "Authorization: Token $FINBLADE_TOKEN"

Finblade documentation