Migrate from Composio
Move an agent from Composio to AgentKit: map Composio users, auth configs and tools to AgentKit, move your users, and update your tool calls.
Use this page if your agent uses Composio today. It covers what’s specific to Composio: how its concepts map to AgentKit, how to move your users, and how your tool calls change. The steps every migration shares, such as setting up Scalekit and creating connections, are in Migrate to AgentKit.
How Composio maps to AgentKit
Section titled “How Composio maps to AgentKit”| Composio | AgentKit |
|---|---|
User ID (user_id) | Identifier: your app’s ID for the user, passed on each call |
| Auth config | Connection: one per app, with its auth type, scopes and OAuth app |
| Connected account | Connected account: one per user and connection |
| Toolkit | Connector, such as Gmail or Slack |
Tool, such as GMAIL_FETCH_EMAILS | Tool, such as gmail_fetch_mails |
Session (composio.create(...)) | No session to create: each call names the user with identifier |
| Session MCP URL | Virtual MCP server with a session token per agent run |
| Proxy Execute | actions.request() through the Scalekit proxy |
Move your users
Section titled “Move your users”Composio’s connected-account API redacts stored tokens, for both Composio-managed and custom auth configs. See Composio’s authentication docs. So plan for each user to authorize again: send them an authorization link for each app they use, as in Option A. If Composio support exports tokens for an auth config that used your own OAuth app, you can import them instead.
- Create a connection in Scalekit for each Composio auth config your agent uses. If the auth config used your own OAuth app, you can use the same app in Scalekit, so users see the same consent screen. See Bring your own OAuth app.
- For each user, get an authorization link for each app they connected in Composio, and send it to them. Use the same user ID you passed to Composio as the
identifier.
# The Composio user IDs and the Scalekit connections each one needsusers = {"user_123": ["gmail", "slack"]}
for identifier, connection_names in users.items(): for connection_name in connection_names: link = actions.get_authorization_link( connection_name=connection_name, identifier=identifier ).link print(identifier, connection_name, link) # send this to the user// The Composio user IDs and the Scalekit connections each one needsconst users: Record<string, string[]> = { user_123: ['gmail', 'slack'] };
for (const [identifier, connectionNames] of Object.entries(users)) { for (const connectionName of connectionNames) { const { link } = await actions.getAuthorizationLink({ connectionName, identifier }); console.log(identifier, connectionName, link); // send this to the user }}These blocks reuse the client from Set up Scalekit. To find which apps a user connected, list their connected accounts in Composio with composio.connected_accounts.list(user_ids=[...]).
For an app that uses an API key, bearer token or basic auth, you can skip the link: if you still hold the user’s key, import it instead.
Move your agent code
Section titled “Move your agent code”List and execute tools
Section titled “List and execute tools”Before (Composio):
session = composio.create(user_id="user_123")tools = session.tools() # all tools the user is authorized forAfter (Scalekit):
tools_response, _ = scalekit_client.actions.tools.list_scoped_tools( identifier="user_123", # Required: list every connection whose tools the agent should see filter={"connection_names": ["gmail"]}, page_size=100, # up to 100 tools per page; pass next_page_token back as page_token for more)
result = actions.execute_tool( tool_name="gmail_fetch_mails", identifier="user_123", connection_name="gmail", tool_input={"query": "is:unread", "max_results": 5},)print(result.data)Before (Composio):
const session = await composio.create('user_123');const tools = await session.tools(); // all tools the user is authorized forAfter (Scalekit):
const { tools } = await scalekit.tools.listScopedTools('user_123', { // Required: list every connection whose tools the agent should see filter: { connectionNames: ['gmail'] }, pageSize: 100, // up to 100 tools per page; pass nextPageToken back as pageToken for more});
const result = await actions.executeTool({ toolName: 'gmail_fetch_mails', identifier: 'user_123', connector: 'gmail', toolInput: { query: 'is:unread', max_results: 5 },});console.log(result.data);Pass identifier and the connection name on every executeTool call: connection_name in Python, connector in Node.js.
Tool names
Section titled “Tool names”Composio names tools in upper case, {TOOLKIT}_{ACTION}. AgentKit tool names are lower case, and the action part can differ. Find each tool’s exact name and input in the connector catalog. For example:
| Composio tool | AgentKit tool |
|---|---|
GMAIL_FETCH_EMAILS | gmail_fetch_mails |
SLACK_SEND_MESSAGE | slack_send_message |
GITHUB_CREATE_ISSUE | github_issue_create |
NOTION_CREATE_PAGE | notion_page_create |
Proxy Execute
Section titled “Proxy Execute”Calls you made with Composio’s Proxy Execute go through the Scalekit proxy with actions.request(), which adds the user’s credentials:
response = actions.request( connection_name="gmail", identifier="user_123", method="GET", path="/gmail/v1/users/me/messages",)const response = await actions.request({ connectionName: 'gmail', identifier: 'user_123', method: 'GET', path: '/gmail/v1/users/me/messages',});If your agent connected to a Composio session’s MCP URL, create a Virtual MCP server with the same connections and tools. It has one static URL for all users; mint a session token for the user before each agent run and pass it as a bearer token.
API reference
The endpoints this page's code calls, with every field and the SDK method for each: