Skip to main content

Bearer Auth

Authenticate with Bearer tokens
Bearer tokens are the simplest way to authenticate to protected APIs and MCP servers. They work well for API keys, service accounts, and other non-interactive workflows.

With Dedalus SDK (DAuth)

If you’re using the Dedalus runner / marketplace, you typically declare a Connection schema (what secrets you need) and then bind it to real values at runtime.

Step 1: Define a connection

Step 2: Bind credentials

Step 3: Pass to your runner

Step 4: Environment variables

auth_header_format reference

auth_header_format controls how the server formats the Authorization header when calling external APIs through dispatch. The format string must include {api_key}. When to omit auth_header_format:
  • APIs that authenticate via query params or request body
  • APIs with custom auth mechanisms (not a standard auth header)
How to find the right format:
  • Check the external API’s auth docs
  • Look at the API’s 401 response for hints
  • Most modern APIs use Bearer {api_key}

When to use

Bearer tokens work well for:
  • API keys and service tokens
  • Service-to-service calls
  • CI/CD pipelines
  • Backend integrations
Use OAuth instead for:
  • User-facing apps
  • Delegated access (“act on behalf of a user”)
  • Consent flows and refresh tokens

Standalone dedalus_mcp client

If you’re connecting directly to an MCP server that expects a Bearer token, pass BearerAuth into MCPClient.connect(...):
This sends:
Last modified on August 9, 2026