Pierre (Fitness Data) MCP server

Unifies fitness data from multiple providers like Strava and Fitbit, enabling retrieval of activities, athlete profiles, and performance statistics through OAuth2 authentication with automatic token refresh.
Back to servers
Setup instructions
Provider
jfarcand
Release date
Jun 10, 2025
Stats
8 stars

Pierre Fitness API is an open-source multi-protocol server that provides secure access to fitness data from providers like Strava and Fitbit. It's designed to connect fitness data to AI assistants and applications through the Model Context Protocol (MCP), Agent-to-Agent (A2A) Protocol, and REST APIs, enabling intelligent analysis with context from location, weather, and performance data.

Installation Options

Local Installation

To install and run the Pierre MCP server locally:

# Clone the repository
git clone https://github.com/Async-IO/pierre_mcp_server.git
cd pierre_mcp_server

# Build the server
cargo build --release

# Run the server
cargo run --bin pierre-mcp-server

Docker Installation

For a containerized deployment:

# Using the provided script with environment variables
./docker-compose-with-envrc.sh up

Environment Configuration

Before running the server, you'll need to configure environment variables for OAuth integration with fitness providers. These settings are essential for connecting to services like Strava and Fitbit.

Integration with AI Assistants

Claude, ChatGPT, and Other MCP Clients

To integrate with AI assistants supporting the MCP protocol:

// For Claude Desktop (~/.claude/claude_desktop_config.json)
{
  "mcpServers": {
    "pierre-fitness": {
      "command": "/path/to/pierre-mcp-server",
      "args": ["--single-tenant", "--port", "8080"]
    }
  }
}

A2A Protocol Integration

For developers integrating with the A2A protocol:

# 1. Register your A2A client
curl -X POST http://localhost:8081/a2a/clients \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Fitness App",
    "description": "AI fitness coach",
    "capabilities": ["fitness-data-analysis"],
    "contact_email": "[email protected]"
  }'

# 2. Authenticate client
curl -X POST http://localhost:8081/a2a/auth \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "your_client_id",
    "client_secret": "your_client_secret",
    "scopes": ["read", "write"]
  }'

# 3. Execute fitness tools (requires user JWT token)
curl -X POST http://localhost:8081/a2a/execute \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer USER_JWT_TOKEN" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools.execute",
    "params": {
      "tool_name": "get_activities",
      "parameters": {"provider": "strava", "limit": 10}
    },
    "id": 1
  }'

Usage Examples

Connecting to Fitness Providers

After starting the server, you'll need to connect to your fitness data provider:

  1. Visit the OAuth URL provided by Pierre after startup
  2. Authorize access to your fitness data (Strava, Fitbit, etc.)
  3. The server will store your authentication tokens securely

Querying Fitness Data

Once connected, you can analyze your fitness data through various queries:

Running Analysis Examples

  • Analyze your longest run of the year with location context
  • Track pace trends over time
  • Examine terrain impact on performance

Cross-Training Analysis

  • Compare cycling vs running performance
  • Analyze heart rate zones across different activities
  • Track consistency in cross-training activities

Location and Weather Intelligence

  • Identify where you perform best
  • Analyze how weather affects your performance
  • Get insights on seasonal patterns in your training

Using with AI Assistants

With Claude, ChatGPT, or other MCP-compatible assistants, you can ask natural language questions about your fitness data:

  • "What was my average pace for runs last month?"
  • "Compare my cycling performance between summer and winter"
  • "How close am I to my 1000km running goal for the year?"
  • "Analyze my latest marathon with weather and elevation context"

Server Configuration

Single-Tenant Mode

For personal use, you can run the server in single-tenant mode:

cargo run --bin pierre-mcp-server -- --single-tenant --port 8080

Multi-Tenant Mode

For supporting multiple users (default mode):

cargo run --bin pierre-mcp-server -- --port 8080

Database Options

The server supports both SQLite (default) and PostgreSQL:

# SQLite (default)
cargo run --bin pierre-mcp-server -- --database-url sqlite://pierre.db

# PostgreSQL
cargo run --bin pierre-mcp-server -- --database-url postgres://user:password@localhost/pierre

Security Features

The Pierre MCP Server includes comprehensive security features:

  • JWT-based authentication
  • OAuth2 with PKCE for provider connections
  • Encrypted storage of sensitive data
  • Rate limiting to prevent abuse
  • User isolation in multi-tenant mode

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "pierre-fitness" '{"command":"pierre-mcp-server","args":["--single-tenant","--port","8080"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "pierre-fitness": {
            "command": "pierre-mcp-server",
            "args": [
                "--single-tenant",
                "--port",
                "8080"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "pierre-fitness": {
            "command": "pierre-mcp-server",
            "args": [
                "--single-tenant",
                "--port",
                "8080"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later