# Manual MCP Setup

Use this approach when `mcp-remote` is not available — for example in headless environments, CI pipelines, or custom agent frameworks.

## Fetch a Token

```bash
export MCP_TOKEN=$(curl -s --request POST \
  --url https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{
    "client_id": "'$TESSER_API_KEY'",
    "client_secret": "'$TESSER_API_SECRET'",
    "audience": "https://sandbox.tesserx.co",
    "grant_type": "client_credentials"
  }' | python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")
```

This requires `TESSER_API_KEY` and `TESSER_API_SECRET` set in your environment or `.env` file.

## IDE Configuration

Configure your IDE with a static token. This works with any IDE that supports MCP URL-type servers:

```jsonc
{
  "mcpServers": {
    "tesser-payments": {
      "type": "url",
      "url": "https://sandbox.tesserx.co/v1/mcp",
      "headers": {
        "Authorization": "Bearer $MCP_TOKEN"
      }
    }
  }
}
```

Set `MCP_TOKEN` in your shell **before** launching the IDE.

## Token Helper Script

The Tesser repo includes a helper script that reads credentials from `.env` and outputs a fresh token:

```bash
export MCP_TOKEN=$(bash scripts/mcp-token.sh)
```

## Token Expiry

Tokens expire after approximately 24 hours. When a token expires, MCP tool calls will fail with a 401 error. You will need to re-run the token fetch command and restart your IDE session.

For automatic token refresh, use [mcp-remote](/agentic/mcp-integration) instead.
