https://linen.dev logo
Include auth `?connected_account_id=<connect_accou...
# 🖥│support-forum
e
When I poll
https://backend.composio.dev/api/v3/mcp/servers
I get the following response:
Copy code
[
  {
    id: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    name: 'server-923467',
    auth_config_ids: [ 'ac_xxxxx-xx-xx-x' ],
    managed_auth_via_composio: true,
    allowed_tools: [],
    mcp_url: 'https://mcp.composio.dev/composio/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?transport=sse',
    toolkits: [ 'googledocs' ],
    commands: {
      cursor: 'npx @composio/mcp@latest setup "https://mcp.composio.dev/composio/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?transport=sse" --client cursor',
      claude: 'npx @composio/mcp@latest setup "https://mcp.composio.dev/composio/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?transport=sse" --client claude',
      windsurf: 'npx @composio/mcp@latest setup "https://mcp.composio.dev/composio/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?transport=sse" --client windsurf'
    },
    updated_at: '2025-07-23T05:02:04.007Z',
    created_at: '2025-07-23T05:02:04.007Z'
  }
]
But in the
mcp_url
property, I want something like this
Copy code
https://mcp.composio.dev/composio/server/<some_id>/mcp?connected_account_id=<connect_account_id>
This
?connected_account_id=<connect_account_id>
is not currently attached in the
mcp_url
when I fetch it using the API. Could you please fix it? Without it my MCP can't run in a
streamable_http
manner in an authenticated manner
c
The query params like
connected_account_id
,
user_id
and
include_helper_actions=true
are meant to be appended to the Url post creation to specify the user or help the Client in Auth flow. You can get the MCP Url and append any one of these for each user/connected account. Quick heads up: We have depreciated "**sse",** you have to remove the
transport=sse
query parameter and use /mcp instead.
e
Yes I took care of the
transport=sse
param. Could you tell me how can I get the
connected_account_id
after programmatically creating a connection? This is my current code for
create_user_connection.js
Copy code
async function setupIntegration(userId, integrationId) {
    const toolset = new OpenAIToolSet({ apiKey: apiKey });

    const integration = await toolset.integrations.get({ integrationId: integrationId });
    const expectedInputFields = await toolset.integrations.getRequiredParams({
        integrationId: integrationId,
    });

    // initiate the connection
    const connectedAccountInitiate = await toolset.connectedAccounts.initiate({
        integrationId: integrationId,
        entityId: userId,
        redirectUri: "https://useoven.com" // TODO: change this to the redirect uri of the integration screen
    });
    console.log(connectedAccountInitiate.redirectUrl);
    return connectedAccountInitiate.redirectUrl;
}
c
It appears you’re using the v1/v2 SDK. We recommend migrating to v3. Here are the docs: Additionally, v1/v2 uses UUID instead of nanoId. For context, nanoId starts with ac_xxxx. —For the current snippet, you can use the Integration UUID to connect and retrieve the connectedAccount Id in the payload. I’ve attached an image for your reference. https://cdn.discordapp.com/attachments/1397444989742485584/1397457941614956634/Screenshot_2025-07-23_at_11.26.02.png?ex=6881cba0&is=68807a20&hm=74c809547acdee9507ead43eb2e91ecb42732bc4a0c22a2df95dbaebc93d04d2&
Here is the migration guide that you can refer: Let me know if you need help with migration!