Machine-to-Machine (M2M) Authentication

Overview

Lightcast MCP supports two authentication methods for software that runs without user interaction:

  • OAuth Client Credentials (M2M): Recommended for AI agents, backend services, automation workflows, and enterprise integrations.
  • API Keys: Use only when your software or AI gateway does not support OAuth.

If you use an AI assistant that supports OAuth sign-in, authenticate through your browser instead. See Security.

Endpoint

All clients connect to the same Lightcast MCP endpoint, regardless of the authentication method.

https://mcp.ai.api.lightcast.io 

OAuth Client Credentials

OAuth 2.0 Client Credentials is the recommended authentication method for machine-to-machine communication.

Authentication Flow

Authenticating with Lightcast MCP consists of two steps:

  1. Request an access token using your client credentials and organization ID.
  2. Include the access token in the Authorization header of every MCP request.
flowchart TD
    A["Your Application"]
    B["OAuth Token Endpoint"]
    C["OAuth Access Token (JWT)"]
    D["Lightcast MCP Server"]
    E["MCP Tool Execution"]

    A -->|"Client ID, Client Secret, Organization ID"| B
    B -->|"Validate Credentials"| C
    C -->|"Authorization: Bearer token"| D
    D --> E

Get Client Credentials

Lightcast creates one or more clients for your organization. Each client must belong to an existing organization.

Lightcast provides the following credentials and configuration details:

ParameterDescription
Client IDIdentifier for your application.
Client SecretConfidential credential used to authenticate your application.

Use the following configuration values when requesting an access token:

ParameterValue
OAuth Token Endpointhttps://lightcast-ai.us.auth0.com/oauth/token
Audiencehttps://mcp.ai.api.lightcast.io/
Grant Typeclient_credentials

Store your client credentials in a secure secret manager. Never expose your client secret in source code, client-side applications, or version control.

Request an Access Token

Exchange your client ID and client secret for an access token. Include your organization ID in the organization field.

The client must be assigned to the specified organization for an access token to be issued.

A request that specifies an organization that does not exist or is not associated with the client returns HTTP 400 with the invalid_request error.

curl --request POST \
  --url https://lightcast-ai.us.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "audience": "https://mcp.ai.api.lightcast.io/",
    "grant_type": "client_credentials",
    "organization": "YOUR_ORGANIZATION_ID"
  }'

Call the MCP Server

Include the access token in the Authorization header of every MCP request.

Once authenticated, your application can discover and invoke the MCP tools available under your organization's plan.

POST /
Host: mcp.ai.api.lightcast.io
Authorization: Bearer <access_token>
Content-Type: application/json

Token Lifecycle

Access tokens are short-lived. Cache and reuse the access token until it expires, then request a new token.

PropertyValue
Token TypeJWT bearer token
Token Lifetime1 hour
Refresh TokenNot issued
Renewal StrategyRequest a new access token
flowchart TD
    A[Application Starts] --> B[Request Access Token]
    B --> C[Cache Access Token]
    C --> D{Token Expired?}
    D -->|No| E[Call MCP Server]
    D -->|Yes| B
    E --> D

Rotate or Retire Credentials

Rotating a client secret immediately invalidates the previous secret. Previously issued access tokens remain valid until they expire.

To rotate credentials without downtime:

  1. Create a replacement client.
  2. Update your software to use the new client credentials.
  3. Delete the original client.

API Keys

API keys are not recommended. Use an API key only when your software or AI gateway cannot use OAuth, such as a gateway that supports only fixed authentication headers.

API keys do not expire. Use OAuth client credentials whenever your software supports OAuth.

How API Keys Work

Each API key belongs to one client within an existing organization. Lightcast MCP validates the key on every request.

The key provides access to the tools and datasets available under your organization's plan.

All requests made using the same API key count toward the usage of that client. Use a separate API key for each gateway or application.

Get an API Key

Lightcast creates an API key for your organization and displays it only once.

Store the key immediately in a secure secret manager. If you lose the key, contact your Lightcast representative to request a new one.

Call the MCP Server

Send the API key in the x-api-key header of every MCP request.

Use the same Lightcast MCP endpoint as OAuth clients.

POST /
Host: mcp.ai.api.lightcast.io
x-api-key: YOUR_API_KEY
Content-Type: application/json

Rotate or Remove an API Key

To replace an API key without downtime:

  1. Contact your Lightcast representative to request a new API key.
  2. Update your software to use the new key.
  3. Ask your Lightcast representative to delete the original key.

The original key remains valid until it is deleted. Removing a client immediately invalidates its API key.

An organization can have up to 50 active API key clients.

API Key Security

  • Store API keys in a secure secret manager.
  • Never include API keys in source code, URLs, or shared files.
  • Rotate API keys according to your organization's security policies.
  • Replace an API key whenever someone who had access to it leaves your organization.

Did this page help you?