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.
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
For a containerized deployment:
# Using the provided script with environment variables
./docker-compose-with-envrc.sh up
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.
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"]
}
}
}
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
}'
After starting the server, you'll need to connect to your fitness data provider:
Once connected, you can analyze your fitness data through various queries:
With Claude, ChatGPT, or other MCP-compatible assistants, you can ask natural language questions about your fitness data:
For personal use, you can run the server in single-tenant mode:
cargo run --bin pierre-mcp-server -- --single-tenant --port 8080
For supporting multiple users (default mode):
cargo run --bin pierre-mcp-server -- --port 8080
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
The Pierre MCP Server includes comprehensive security features:
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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