Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.crewship.ai/llms.txt

Use this file to discover all available pages before exploring further.

Crewship uses a three-tier integration model: workspace-level MCP servers cascade down to crews, which cascade down to agent bindings. Each level can override or extend the configuration. All integration endpoints require authentication and workspace context.

Workspace Integrations

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

List Workspace Integrations

GET /api/v1/integrations?workspace_id={workspaceId}
Response: 200 OK
[
  {
    "id": "int_abc",
    "workspace_id": "ws_123",
    "name": "github-mcp",
    "display_name": "GitHub MCP Server",
    "transport": "stdio",
    "endpoint": null,
    "command": "npx",
    "args_json": "[\"-y\", \"@modelcontextprotocol/server-github\"]",
    "env_json": "{\"GITHUB_TOKEN\": \"{{credential:github-token}}\"}",
    "config_json": null,
    "icon": "github",
    "enabled": true,
    "created_at": "2024-01-15T10:00:00Z",
    "updated_at": "2024-01-15T10:00:00Z",
    "agent_binding_count": 5,
    "crew_server_count": 2
  }
]

Response Fields

FieldTypeDescription
idstringIntegration ID
workspace_idstringWorkspace ID
namestringInternal name
display_namestringHuman-readable name
transportstringTransport type (validated set: streamable-http or stdio)
endpointstring?Server endpoint URL (required when transport is streamable-http)
commandstring?Command to execute (required when transport is stdio)
args_jsonstring?JSON array of command arguments
env_jsonstring?JSON object of environment variables
config_jsonstring?Additional configuration JSON
iconstring?Display icon name
enabledbooleanWhether the integration is active
agent_binding_countintegerNumber of agent bindings
crew_server_countintegerNumber of crew-level servers

Create Workspace Integration

POST /api/v1/integrations?workspace_id={workspaceId}
Auth: OWNER or ADMIN role Request Body:
FieldTypeRequiredDefaultDescription
namestringYesInternal name
display_namestringNonameDisplay name (defaults to name when omitted)
transportstringNo"streamable-http"streamable-http or stdio
endpointstringConditionalnullRequired when transport is streamable-http
commandstringConditionalnullRequired when transport is stdio
args_jsonstringNonullJSON array of arguments
env_jsonstringNonullJSON object of env vars
config_jsonstringNonullAdditional config JSON
iconstringNonullDisplay icon
{
  "name": "github-mcp",
  "display_name": "GitHub MCP Server",
  "transport": "stdio",
  "command": "npx",
  "args_json": "[\"-y\", \"@modelcontextprotocol/server-github\"]",
  "env_json": "{\"GITHUB_TOKEN\": \"{{credential:github-token}}\"}"
}
Response: 201 Created — integration object (enabled defaults to true).
StatusCondition
400Missing name, invalid transport, or endpoint/command missing for the chosen transport
403Insufficient role
409Integration with this name already exists

Get Workspace Integration

GET /api/v1/integrations/{integrationId}?workspace_id={workspaceId}
Response: 200 OK

Update Workspace Integration

PATCH /api/v1/integrations/{integrationId}?workspace_id={workspaceId}
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

DELETE /api/v1/integrations/{integrationId}?workspace_id={workspaceId}
Cascade-deletes agent bindings, crew-level overrides, and finally the workspace server, all in one transaction. Auth: OWNER or ADMIN role Response: 200 OK
{ "status": "deleted" }
StatusCondition
404Integration not found

Test Workspace Integration

POST /api/v1/integrations/{integrationId}/test?workspace_id={workspaceId}
Tests the MCP server connection. For stdio transport the test is skipped (servers can only be probed inside a container at runtime); for streamable-http an MCP initialize handshake is attempted via an SSRF-safe HTTP client. Response: 200 OK
{
  "status": "ok",
  "message": "Connected to MCP server",
  "server_info": { "name": "github-mcp", "version": "1.2.3" }
}
FieldDescription
statusOne of ok, error, auth_required, skipped
messageOptional human-readable description
server_infoOptional raw initialize response from the server
StatusCondition
404Integration not found

All Crew Integrations

GET /api/v1/integrations/crews?workspace_id={workspaceId}
Cross-crew overview of all crew-level integration bindings. Response: 200 OK — array of crew integration objects.

Crew Integrations

List Crew Integrations

GET /api/v1/crews/{crewId}/integrations?workspace_id={workspaceId}
Response: 200 OK — array of crew MCP server bindings.

Create Crew Integration

POST /api/v1/crews/{crewId}/integrations?workspace_id={workspaceId}
Auth: OWNER, ADMIN, or MANAGER role Request Body:
FieldTypeRequiredDefaultDescription
workspace_mcp_server_idstringNonullLink to an existing workspace integration (must be in same workspace)
namestringYesInternal name
display_namestringNonameDisplay name
transportstringNo"streamable-http"streamable-http or stdio
endpointstringConditionalnullRequired when transport is streamable-http
commandstringConditionalnullRequired when transport is stdio
args_jsonstringNonullJSON array of arguments
env_jsonstringNonullJSON object of env vars
config_jsonstringNonullAdditional config JSON
iconstringNonullDisplay icon
Response: 201 Created — crew MCP server object.
StatusCondition
400Missing name, invalid transport, missing endpoint/command for transport, or referenced workspace integration not in same workspace
404Crew not found
409Integration with this name already exists in this crew

Update Crew Integration

PATCH /api/v1/crews/{crewId}/integrations/{integrationId}?workspace_id={workspaceId}
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.
StatusCondition
400Invalid transport, or endpoint/command missing for new transport
404Crew integration not found

Delete Crew Integration

DELETE /api/v1/crews/{crewId}/integrations/{integrationId}?workspace_id={workspaceId}
Cascade-deletes agent bindings and any OAuth credentials that were auto-created for this integration (only when no other binding still references them). Auth: OWNER or ADMIN role Response: 200 OK
{ "status": "deleted" }
StatusCondition
404Crew integration not found

Test Crew Integration

POST /api/v1/crews/{crewId}/integrations/{integrationId}/test?workspace_id={workspaceId}
Same probe semantics as the workspace test endpoint. Response: 200 OK{ status, message?, server_info? } (see Test Workspace Integration).
StatusCondition
404Crew or integration not found

Agent MCP Bindings

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

List Agent Bindings

GET /api/v1/agents/{agentId}/integrations?workspace_id={workspaceId}
Response: 200 OK — array of agent MCP binding objects.

Create Agent Binding

POST /api/v1/agents/{agentId}/integrations?workspace_id={workspaceId}
Auth: OWNER, ADMIN, or MANAGER role Request Body:
FieldTypeRequiredDefaultDescription
mcp_server_idstringYesID of the MCP server to bind
mcp_server_scopestringYesworkspace or crew
credential_idstringNonullWorkspace credential to attach for auth
cred_typestringNo"bearer"bearer, api_key, or basic
cred_headerstringNonullCustom header name (used when cred_type is api_key)
env_var_namestringNonullEnv var name for stdio credential injection
enabledbooleanNotrueWhether the binding is active
config_override_jsonstringNonullPer-binding config override JSON
Response: 201 Created — binding object.
StatusCondition
400Missing/invalid mcp_server_id, mcp_server_scope, cred_type, or referenced integration/credential not in this workspace
404Agent not found
409Agent already has a binding for this integration

Update Agent Binding

PATCH /api/v1/agents/{agentId}/integrations/{integrationId}?workspace_id={workspaceId}
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
{ "status": "updated" }
StatusCondition
400Invalid cred_type, credential not in this workspace, or no fields to update
404Agent binding not found

Delete Agent Binding

DELETE /api/v1/agents/{agentId}/integrations/{integrationId}?workspace_id={workspaceId}
Auth: OWNER, ADMIN, or MANAGER role Response: 200 OK
{ "status": "deleted" }
StatusCondition
404Agent binding not found

Resolve Agent Integrations

GET /api/v1/agents/{agentId}/integrations/resolved?workspace_id={workspaceId}
Returns the effective set of MCP servers for an agent after cascading workspace, crew, and agent-level configurations. Includes resolved credentials. Response: 200 OK — array of resolved integration objects.

OAuth Flow

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

List OAuth Providers

GET /api/v1/oauth/providers
Returns available OAuth provider configurations. Auth: Session or CLI token (no workspace context needed) Response: 200 OK

Initiate OAuth Flow

POST /api/v1/oauth/initiate?workspace_id={workspaceId}
Starts the OAuth authorization flow by generating an authorization URL. Auth: Session or CLI token + workspace membership Response: 200 OK — includes the authorization URL to redirect the user to.

OAuth Callback

GET /api/v1/oauth/callback?code={code}&state={state}
Handles the OAuth callback from the provider. No authentication required — uses the state token for validation.

Exchange Token

POST /api/v1/oauth/exchange?workspace_id={workspaceId}
Exchanges an authorization code for access and refresh tokens. Response: 200 OK

Loopback

POST /api/v1/oauth/loopback?workspace_id={workspaceId}
Handles loopback redirect for local OAuth flows. Response: 200 OK

Discover OAuth Endpoints

POST /api/v1/oauth/discover
Discovers OAuth endpoints from an OpenID Connect discovery document or well-known URL. Auth: Session or CLI token (no workspace context needed) Response: 200 OK — discovered endpoints.

Auto-Connect Integration

POST /api/v1/oauth/auto-connect?workspace_id={workspaceId}
Automatically creates an integration from an OAuth connection. Response: 200 OK

MCP Registry

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

List Registry Entries

GET /api/v1/mcp-registry
Auth: Session or CLI token (no workspace context needed) Response: 200 OK — array of registry entries.

Search Registry

GET /api/v1/mcp-registry/search?q={query}
Auth: Session or CLI token Response: 200 OK — matching registry entries.

Sync Registry

POST /api/v1/mcp-registry/sync?workspace_id={workspaceId}
Triggers a manual sync of the MCP registry. Auth: Session or CLI token + workspace membership Response: 200 OK