Skip to main content
Integrations connect agents to external tools through MCP (Model Context Protocol) servers. Crewship uses a three-tier model: workspace-level MCP servers cascade down to crews, which cascade down to agent bindings, and each level can override or extend the configuration. Servers can be defined directly, discovered from the MCP registry, and authenticated with stored credentials or a full OAuth 2.0 flow.
All integration endpoints require authentication. Workspace-scoped routes also require workspace context; OAuth provider/discovery routes and MCP registry list/search routes do not. Individual sections call out additional role requirements and the unauthenticated OAuth callback.

Endpoints

Endpoint contract

Each endpoint below has Auth, Request, Response, and Status details. Workspace routes require a session or CLI token plus membership; OAuth provider/discovery and registry list/search routes explicitly do not. Requests and responses are JSON unless noted. Workspace reads return 200, creates 201, deletes use the status stated by the endpoint, and registry sync returns 202. The shared failures are 401 unauthenticated, 403 denied workspace/role, 400 invalid JSON or fields, 404 missing or foreign resource, 409 conflict, and 500/503 for handler or unavailable-backend failures. The route gates and handler branches are verified in internal/api/router_orchestration.go, internal/api/mcp_*.go, and internal/api/oauth*.go. Auth: The endpoint-specific role or capability is authoritative; otherwise the route requires an authenticated workspace member. Request: Query parameters and JSON bodies are shown immediately under each operation. Read and delete operations have no body unless stated. Response: Successful responses are the JSON object/array described under the operation; connection tests return { "status", "message?", "server_info?" }. Status: In addition to the success status, invalid input is 400, denied access is 403, a missing resource is 404, and backend/provider failures are 500 or 503 as noted by the operation.

Managed Integrations (Composio)

Read-only inventory of the Composio managed-integration provider. See the Integrations guide for the object model. Requires COMPOSIO_API_KEY on the server; when unset the endpoint returns enabled: false with empty lists rather than an error.

Composio Inventory

Returns the connector catalog (auth configs) and every connected account grouped by Composio user_id. Gated on workspace read. This is an operator view; agents are scoped to a single user_id and never receive the full list. Response: 200 OK
CLI: crewship integration composio inventory.

Composio Toolkits

Proxies the Composio app catalog (1000+ connectable apps). search, category, and limit (max 100, default 40) are optional server-side filters. Read-gated; returns enabled: false when the provider is unconfigured. Response: 200 OK
CLI: crewship integration composio toolkits [--search] [--category] [--limit].

Composio Tools

Lists the tools a single toolkit exposes (e.g. github has 846, gmail 61). toolkit is required (400 otherwise). search and limit (max 100, default 40) are optional server-side filters. Read-gated; returns enabled: false when the provider is unconfigured. Response: 200 OK
CLI: crewship integration composio tools <toolkit> [--search] [--limit].

Composio Triggers

Lists the available trigger types — event subscriptions a toolkit exposes (e.g. GMAIL_NEW_MESSAGE, GITHUB_PR_OPENED). toolkit, search, and limit (max 100, default 40) are optional server-side filters. Read-gated; returns enabled: false when the provider is unconfigured. Response: 200 OK
CLI: crewship integration composio triggers types [--toolkit] [--search] [--limit].

Composio Active Triggers

Lists the live trigger instances in the project across all users. Read-gated; returns enabled: false when the provider is unconfigured. Response: 200 OK
CLI: crewship integration composio triggers active.

Composio Create Trigger

Creates (or re-enables) a trigger instance for a Composio user. OWNER/ADMIN only. Returns 400 if slug or user_id is empty, or if the provider is unconfigured. Request body:
Response: 200 OK
CLI: crewship integration composio triggers enable <slug> --user <id>.

Composio Connect

Starts an OAuth Connect Link for an app and user. Requires workspace manage (OWNER/ADMIN). Finds the toolkit’s auth config (creating a managed one on demand if none exists), then creates a Composio Connect Link for the given user. Request body:
Returns 400 if either field is empty, or if Composio is unconfigured. Response: 200 OK
The end-user opens redirect_url to authorize. Returns 502 on an upstream Composio failure. CLI: crewship integration composio connect <toolkit> --user <id>.

Composio Settings

Manage the per-workspace Composio API key from the app instead of the server env. The key is validated against Composio before being stored encrypted (AES-GCM). The effective key is resolved per request: the workspace key first, then the server COMPOSIO_API_KEY env fallback. The key is never returned by any endpoint.
GET (read) returns the status; PUT/DELETE require workspace manage (OWNER/ADMIN). PUT body: { "api_key": "ak_…", "label": "" }. The Composio host is server-controlled via the COMPOSIO_BASE_URL env var, not via this API. Response (GET / PUT / DELETE): 200 OK
A PUT with an invalid key returns 400 (Composio rejected it). CLI: crewship integration composio key {show,set,remove}.

Composio Default Connector

Inspect / provision the workspace-wide default connector. When the server flag COMPOSIO_DEFAULT_CONNECTOR is ON, every agent without an explicit per-agent binding inherits this connector (full access to all the workspace’s connected apps), and legacy non-Composio MCP servers are turned off at resolve time (not deleted). See the Integrations guide.
GET (read) reports state; PUT requires workspace manage (OWNER/ADMIN). PUT body is optional: { "user_id": "<id>" } pins the default Composio user; omit it to auto-derive the user when exactly one is connected. PUT errors 400 when zero users are connected (“connect an account first”) or when multiple users exist (pin one). Re-running is idempotent and refreshes the connector’s app set. Response (GET / PUT): 200 OK
CLI: crewship integration composio default {show,set,enable}.

Composio Agent Binding

Grant an agent per-app, tool-scoped access to a Composio user’s connected apps. For each granted app the binding provisions one tool-scoped Composio MCP server and persists the rows the runtime resolver reads — a per-(agent, app) workspace MCP server pointing at the per-user Composio MCP URL, a workspace credential holding the Composio API key, and an agent MCP binding joining them (cred_type: api_key, cred_header: x-api-key). No resolver change is needed: the sidecar injects the x-api-key header on the streamable-http request. Each app carries a mode that maps to the MCP server’s allowed_tools:
GET (read) lists the agent’s per-app Composio bindings; POST/DELETE require workspace manage (OWNER/ADMIN). POST body:
user_id is required (the Composio user the agent is scoped to). The legacy shape { "user_id": "…", "toolkits": ["gmail"] } is still accepted — each toolkit becomes an app at full. When neither apps nor toolkits is given, every connected app is bound at full. Re-binding replaces the agent’s app set: apps no longer present are removed (their server row + binding deleted). read/custom with an empty resolved tool set returns 400. DELETE with ?toolkit=<slug> removes one app; without it, removes all the agent’s Composio apps. Response (POST): 200 OK
Response (GET): 200 OK
POST returns 404 for an unknown/foreign agent and 400 when Composio is unconfigured or no apps resolve. CLI: crewship integration composio {bind,unbind,bindings} <agent> --user <id> [--app toolkit[:mode[:t1,t2]]]….

Composio Connected-Account Management

Lifecycle operations on an existing connected account. The accountId is the Composio account id surfaced by the inventory endpoint. All three require workspace manage (OWNER/ADMIN) and return 400 when Composio is unconfigured.
  • revoke — de-authorizes the account at the provider. Its credentials are invalidated upstream; the user must re-connect before it can be used again.
  • refresh — refreshes the account’s credentials (e.g. exchanging a refresh token for a new access token).
  • delete — permanently removes the connected account at the provider.
Response: 204 No Content on success; 502 when Composio returns an error. CLI: crewship integration composio account {revoke,refresh,remove} <account-id>.

Workspace Integrations

Workspace-level MCP server definitions available to all crews and agents.

List Workspace Integrations

Auth: Authenticated workspace member (workspace_id is required). Request: No body. Response: 200 OK

Response Fields

Create Workspace Integration

Auth: OWNER or ADMIN role Request Body:
Response: 201 Created — integration object (enabled defaults to true).

Get Workspace Integration

Auth: Authenticated workspace member (workspace_id is required). Request: No body. Response: 200 OK

Update Workspace Integration

Auth: OWNER or ADMIN role All fields optional: display_name, transport, endpoint, command, args_json, env_json, config_json, icon, enabled. Response: 200 OK

Delete Workspace Integration

Cascade-deletes agent bindings, crew-level overrides, and finally the workspace server, all in one transaction.
This cascades: every agent binding and crew-level override of the integration is removed alongside the workspace server, in a single transaction.
Auth: OWNER or ADMIN role Response: 200 OK

Test Workspace Integration

Auth: Authenticated member with the create capability (the route’s roleCreate gate); workspace context is required. Request: No body. Tests the MCP server connection. For stdio transport the server is not actually launched (that only happens inside a container at runtime) — instead the config is statically validated (the command must tokenize to a single executable — a full launch line that splits into more than one token is rejected, while a quoted path containing spaces is fine; args_json must be a valid JSON string array), returning status: "ok" when well-formed or status: "error" otherwise. Tokenizing is quote-aware, matching the CLI/UI split rules (see the MCP guide). For streamable-http (also http/sse) an MCP initialize handshake is attempted via an SSRF-safe HTTP client (private/loopback IPs blocked). Response: 200 OK

Crew Integrations

Crew-level MCP bindings — either standalone servers or overrides linked to a workspace integration. This tier also carries per-tool enable/disable state.

All Crew Integrations

Auth: Authenticated workspace member (workspace_id is required). Request: No body. Cross-crew overview of all crew-level integration bindings. Response: 200 OK — array of crew integration objects.

List Crew Integrations

Auth: Authenticated workspace member (workspace_id is required). Request: No body. Response: 200 OK — array of crew MCP server bindings.

Create Crew Integration

Auth: OWNER, ADMIN, or MANAGER role Request Body: Response: 201 Created — crew MCP server object.

Update Crew Integration

Auth: OWNER or ADMIN role All fields optional: display_name, transport, endpoint, command, args_json, env_json, config_json, icon, enabled. Changing transport re-validates against the merged final endpoint/command. Response: 200 OK — updated crew integration object.

Delete Crew Integration

Cascade-deletes agent bindings and any OAuth credentials that were auto-created for this integration (only when no other binding still references them).
This cascades: agent bindings are removed, and OAuth credentials auto-created for this integration are deleted too — but only when no other binding still references them.
Auth: OWNER or ADMIN role Response: 200 OK

Test Crew Integration

Auth: Authenticated member with the create capability; workspace context is required. Request: No body. Same probe semantics as the workspace test endpoint. Response: 200 OK{ status, message?, server_info? } (see Test Workspace Integration).

List Crew Integration Tools

Returns the recorded per-tool enable/disable bindings for the crew’s MCP server (mcp_tool_bindings). Only tools that have been toggled or seen via Refresh have a row; a tool with no row is treated as enabled by default. This endpoint does not contact the MCP server. Response: 200 OK — a JSON array of tool-binding objects (no wrapper).

Update Crew Integration Tool

Upsert a single tool’s binding for this crew. If no row exists for the tool it is materialised (a fresh row defaults to enabled = true). Wraps the crewship integration tool enable/disable CLI subcommands. Auth: OWNER or ADMIN role (canRole(role, "manage")) Request Body: provide at least one of the following fields.
Response: 200 OK — the upserted tool-binding object (same shape as the List entries).

Refresh Crew Integration Tools

Reconcile the mcp_tool_bindings rows for this crew server against a tool list supplied in the request body (typically posted by the frontend after a successful test-connection round-trip). The server does not contact the MCP server itself: new tools are inserted enabled = true, existing tools have their description refreshed but their enabled state left untouched, and tools absent from the payload are left in place (never auto-revoked). An empty list is a no-op. Auth: OWNER or ADMIN role (canRole(role, "manage")) Request Body:
Response: 200 OK
total is the number of entries in the request tools array.

Agent MCP Bindings

Agent bindings link MCP servers (workspace or crew level) to specific agents, optionally with credential overrides.

List Agent Bindings

Auth: Authenticated workspace member (workspace_id is required). Request: No body. Response: 200 OK — array of agent MCP binding objects.

Create Agent Binding

Auth: OWNER, ADMIN, or MANAGER role Request Body: Response: 201 Created — binding object.

Update Agent Binding

Auth: OWNER, ADMIN, or MANAGER role All fields optional: credential_id (empty string clears), cred_type, cred_header, env_var_name (empty string clears), enabled, config_override_json. Response: 200 OK

Delete Agent Binding

Auth: OWNER, ADMIN, or MANAGER role Response: 200 OK

Resolve Agent Integrations

Returns the effective set of enabled MCP servers for an agent after cascading workspace and crew servers and applying the agent’s bindings. Credential IDs and names may be present, but secret values are never returned. The response is a JSON array; a missing agent returns 404.
Auth: authenticated workspace member. Request: No body. workspace_id is required; the agent must belong to that workspace. Response: 200 OK — a JSON array. The array is empty when the agent has no effective enabled integrations. endpoint, command, args_json, env_json, config_json, icon, credential_id, and credential_name are nullable; credential values and other secret material are never returned.

MCP Tool Call Audit

Returns the workspace’s MCP tool-invocation audit trail — one row per tool call an agent made through an MCP server — newest first, capped at 200 rows (internal/api/mcp_audit.go:69). Use the filters to scope to a single agent, server, status, or time window. Auth: authenticated workspace member (authed + workspace context — internal/api/router_orchestration.go:416). workspace_id is required (internal/api/mcp_audit.go:38). Query Parameters: Response: 200 OK — a JSON array (empty [] when nothing matches — internal/api/mcp_audit.go:96-99).

OAuth Flow

OAuth 2.0 flow for connecting external services (GitHub, Slack, Google, etc.) and storing tokens as credentials.

List OAuth Providers

Returns available OAuth provider configurations. Auth: Session or CLI token (no workspace context needed) Response: 200 OK Request: No body.

Initiate OAuth Flow

Starts the OAuth authorization flow by generating an authorization URL. Auth: MANAGER+ role, or a member with the credential.create capability. Request Body:
redirect_uri is optional; when omitted, Crewship uses its backend callback. Response: 200 OK

OAuth Callback

Handles the OAuth callback from the provider.
No authentication required — this endpoint uses the state token for validation instead.
Request: code and state query parameters are required; error may be returned by the provider. Response: 200 OK is an HTML success page that closes the authorization window. It is not a JSON endpoint.

Exchange Token

Exchanges an authorization code for access and refresh tokens. Auth: MANAGER+ role, or a member with the credential.create capability. Request Body: credential_id and code are required; redirect_uri, code_verifier, and state are optional. When state is supplied without a code_verifier, the server recovers the stored PKCE verifier.
Response: 200 OK{ "status": "ok", "credential_id": "cred_oauth" }.

Loopback

Handles loopback redirect for local OAuth flows. Auth: MANAGER+ role, or a member with the credential.create capability. Request Body: { "credential_id": "cred_oauth" }. Response: 200 OK

Discover OAuth Endpoints

Discovers OAuth endpoints from an OpenID Connect discovery document or well-known URL. Auth: Session or CLI token (no workspace context needed) Request Body: { "mcp_url": "https://mcp.example.com" }. Response: 200 OK{ "auth_url", "token_url", "registration_endpoint?", "scopes?", "supports_pkce", "supports_dcr" }.

Auto-Connect Integration

Automatically creates an integration from an OAuth connection. Auth: OWNER or ADMIN role. Request Body:
mcp_url is required; server_name defaults to mcp-server and provider_hint is optional. With dynamic client registration, the response is { "status": "authorize", "auth_url": "...", "credential_id": "..." }. When client registration is unavailable it returns 200 with status: "needs_client_id", auth_url, token_url, scopes, and a message so the caller can collect a client ID.

MCP Registry

Public registry of MCP server definitions for easy discovery and installation.

List Registry Entries

Auth: Session or CLI token (no workspace context needed) Request: no body. Response: {servers, total, limit, offset}. Query Parameters: limit (default 50, max 200), offset (default 0), trust_tier (anthropic, crewship, or community), and featured (true/false/1/0). Response: 200 OK

Search Registry

Auth: Session or CLI token Request: no body. Response: {servers, total, limit, offset, query}. Query Parameters: q, plus the same limit, offset, trust_tier, and featured filters as List. An empty q behaves like List. Response: 200 OK{ "servers": [], "total": 0, "limit": 50, "offset": 0, "query": "github" }.

Sync Registry

Triggers a manual sync of the MCP registry. Auth: OWNER or ADMIN role on the workspace. Request: no body. Response: JSON status envelope below. Response: 202 Accepted{ "status": "sync_started", "message": "..." }. Manual sync is limited to once per hour; a request during the cooldown returns 429.