Configuration

Authentication

All requests to Terra AI Interface through our MCP require these HTTP headers:

  • dev-id: YOUR_DEV_ID

  • x-api-key: YOUR_API_KEY

These are your Terra API credentials, they are the same as other Terra API calls.

MCP client configuration

Connect through Terra's API via the following URL: https://access.tryterra.co/api/v2/mcp. For MCP-compatible clients (e.g., Claude Desktop, Cursor), configure:

Claude Desktop example

Navigate to your Claude Desktop config file, and add:

{
  "mcpServers": {
    "terra": {
      "url": "https://access.tryterra.co/api/v2/mcp",
      "headers": {
        "dev-id": "YOUR_DEV_ID",
        "x-api-key": "YOUR_API_KEY"
      }
    }
  }
}

Available tools

Once connected, you can use:

  1. get_sleep_data

  • Parameters: user_id, fields (list of field names), optional where (filter conditions)

  • Example: Get sleep duration, light sleep, HRV data for a user

  1. get_activity_data

  • Parameters: user_id, fields (list of field names), optional where (filter conditions)

  • Example: Get workout data for a user

  1. get_daily_data

  • Parameters: user_id, fields (list of field names), optional where (filter conditions)

  • Example: Get heart rate data and calories for a user

  1. get_body_data

  • Parameters: user_id, fields (list of field names), optional where (filter conditions)

  • Example: Get body measurement data for a user

  1. get_nutrition_data

  • Parameters: user_id, fields (list of field names), optional where (filter conditions)

  • Example: Get macros data for a user

  1. get_menstruation_data

  • Parameters: user_id, fields (list of field names), optional where (filter conditions)

  • Example: Get period cycle data for a user

Example usage:

Next steps

After setting up Terra's AI Interface, explore Terra's data models to understand the variety of health data available through Terra API.

Last updated

Was this helpful?