Why am I Encountering an Expired Token Error in Developer Mode Even with a Newly Created Token on the MCP Server Integration?

This topic was automatically generated from Slack. You can find the original thread here.

Hello , Im in developer mode integrating the mcp server in my app but i encountered a expired token error even it is just newly created. I even generate a token in the documentation and use the connect link.

If you enable development mode we should surface additional information to help you debug

So what shall I do?

I tried to generate token in this like Managed Auth Quickstart - Pipedream and use the connect link provided but still has a token expired issue

Can you try setting the environment to development instead of production? We should return additional information to help you debug.

Im already using development

{
“success”: true,
“token”: “ctok_4981d6dae5048d7f04783da2619ccb3f”,
“connect_link_url”: “Pipedream Connect”,
“expires_at”: 1768557612441,
“environment”: “development”
}

Or do i need to create here?

one question here, do you mean that in the connect link url, the user should be using a querystring parameter environment set to development ? I mean such as in

Pipedream Connect
My reasoning is that since for accessing Connect via the SDK developers specify this parameter, according to the documentation:

const client = new PipedreamClient({
  projectEnvironment: "production",
  externalUserId,
  tokenCallback: async () => {
    const res = await fetch("/api/connect-token", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ external_user_id: externalUserId }),
    });

Similarly the connect link url would support that projectEnvironment or environment via querystring parameter.

The connect link url example from the documentation you linked doesn’t explicitly specify this parameter.

you are missing the app slug from the connect link URL: Connect Link - Pipedream

no, the environment is defined when you initialize the SDK client, it’s not passed in the Connect Link URL.

Did this fixed the issue? I’m also facing the same