Skip to content

Mastra Studio Local - Add API / Auth headers with server adapters #12371

@daneatmastra

Description

@daneatmastra

This issue was created from Discord post 1465765097627582548:

Open in Discord

There's some work in another thread (https://discord.com/channels/1309558646228779139/1464378964863615239) which adds necessary options (api route prefix) for making local studio work when using server adapters.

mastra studio --port 8080 --server-port 3000 --server-prefix /mastra

This is somewhat of a follow up. I think we would likely need to pass auth information as well?

For example we have a Hono api and mastra endpoints are exposed via /mastra prefix. We also have machine key API auth protecting these routes.

When running locally and pointing towards our local server, we could just do a workaround of bypassing auth on local, though I'm wondering more about what to do if say I wanted to run the local studio but pointed at some hosted preview url we already have setup.

I'm still getting familiar with Mastra but I don't know if the built in auth middleware is helpful here.

In Mastra Cloud, there is a spot to put request headers (as well as add/edit the server url), though I think something is preventing this from showing when running Mastra studio locally. I saw it flash for a second but then it just went right to the dashboard with 'No agents found'. (This might be a separate issue)

Let me know if anything is unclear here. Appreciate it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AuthenticationCLIIssues regarding Mastra CLI commands: Build, Dev, Start etcGeneral SupportMastra CloudIssues with using Mastra CloudMastra ServerIssues related to the Mastra Server or its handlersWorkflowsAll things Mastra Workflows and different execution engines.discordFor issues created from Discord discussions.effort:mediumimpact:mediumtrio-wp

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions