Manage an agent's MCP connectors through the API: browse and manage MCP connectors, enable/disable them on an agent, and complete OAuth connections to external services. Use when wiring an agent to external MCP servers and tools.
Auth & conventions
- Base URL:
https://api.iblai.app - Header:
Authorization: Api-Token $IBLAI_API_KEYon every request. - Path vars:
{org}=$IBLAI_ORG,{username}=$IBLAI_USERNAME,{mentor}= the agent's unique id (e.g.d17dc729-60fd-4363-81a0-f67d9318b03e). - Not connected yet? Run
/iblai-loginfirst to populateIBLAI_ORG,IBLAI_USERNAME, andIBLAI_API_KEY.
Reads
- GET
…/users/{username}/mcp-servers/?include_global=true&mentor_unique_id={mentor}&is_featured={true|false}&page={n}&page_size=12&search={q}&transport={…}— connector lists. - GET
…/mentors/{mentor}/settings/— activemcp_servers. - GET
…/users/{username}/mcp-server-connections/— OAuth connection state. - GET
https://api.iblai.app/dm/api/ai-account/connected-services/orgs/{org}/users/{username}/— connected OAuth services. - GET
…/connected-services/orgs/{org}/users/{username}/{provider}/{service}/— start OAuth (returnsauth_url).
Writes
- POST
…/users/{username}/mcp-servers/— create a connector (JSON, ormultipart/form-datawith image):{ "name": "string (required)", "url": "string (required)", "transport": "sse|websocket|streamable_http (required)", "auth_type": "none|token|oauth2 (required)", "description": "string", "credentials": "string", "auth_scope": "user|mentor|tenant", "mentor": "uuid|null", "image": "File" } - PUT
…/mcp-servers/{id}/— edit a connector. - DELETE
…/mcp-servers/{id}/— delete a connector (no body). Destructive — confirm with the user first. - PUT
…/mentors/{mentor}/settings/— enable / disable a connector on the agent:{ "mcp_servers": "number[]", "tool_slugs": "string[]", "can_use_tools": "boolean" } - POST
…/users/{username}/mcp-server-connections/— finalize an OAuth connection:{ "server": "number (required)", "scope": "user|mentor|tenant (required)", "auth_type": "oauth2 (required)", "connected_service": "number (required)", "user": "string", "mentor": "uuid" } - DELETE
…/connected-services/orgs/{org}/users/{username}/{id}/— disconnect an OAuth service (no body). Destructive — confirm with the user first.
Example
Create an SSE connector with no auth and enable it on the agent:
curl -X POST \
"https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-servers/" \
-H "Authorization: Api-Token $IBLAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Weather MCP",
"url": "https://mcp.example.com/sse",
"transport": "sse",
"auth_type": "none",
"mentor": "'"$MENTOR"'"
}'
Notes
- The connector list is paged (
page_size=12); usesearchandtransportto narrow results, andinclude_global=trueto surface org-wide connectors. - Enabling a connector is a toggle through
settings/— send the fullmcp_serversarray of connector ids you want active on the agent. - OAuth is two steps: GET the connected-services start endpoint for an
auth_url, let the user complete it, then POSTmcp-server-connections/with the resultingconnected_service. auth_scope/scope(user|mentor|tenant) controls who the connection applies to —useris per-user,mentoris agent-wide,tenantis org-wide.