home / mcp / fitness mcp server

Fitness MCP Server

MCP Server generated by mcp.ag2.ai

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ag2-mcp-servers-fitness-api": {
      "command": "python",
      "args": [
        "mcp_server/main.py",
        "stdio"
      ],
      "env": {
        "CONFIG": "{...}",
        "SECURITY": "YOUR_API_KEY",
        "CONFIG_PATH": "mcp_server/mcp_config.json"
      }
    }
  }
}

You run an MCP (Model Context Protocol) Server that connects to a predefined OpenAPI endpoint to expose a structured, adaptive model context interface. This server helps you test, explore, and integrate the Google Fitness API schema by providing a consistent, MCP-compliant way to interact with its data and actions from your clients.

How to use

Start the server in stdio mode to run locally and interact with clients via standard input/output. From there, you connect your MCP client to the server and perform requests that align with the exposed model context actions. You can configure security and runtime options through environment variables to suit development, testing, or production needs.

How to install

Prerequisites: Python 3.9+ and a working Python toolchain (pip and uv). Prepare your environment with the following steps.

1. Install Python dependencies locally.

pip install -e ".[dev]"

2. Alternatively, install using uv for editable mode.

uv pip install --editable ".[dev]"

3. Run basic linting, formatting, and tests to ensure a clean environment.

ruff check
ruff format
./scripts/static-analysis.sh
./scripts/test.sh

4. Start the MCP server in stdio mode.

python mcp_server/main.py stdio

Configuration and environment

You can configure the server using environment variables. The following are supported and commonly used in development and testing.

- CONFIG_PATH: Path to a JSON configuration file (for example, mcp_server/mcp_config.json).

- CONFIG: A JSON string containing the configuration.

- SECURITY: Environment variables containing security parameters (for example, API keys).

Available tools

lint

Run linting and formatting checks with ruff to ensure code quality and consistency.

format

Automatically format code using ruff format to maintain style guidelines.

static-analysis

Perform static analysis (type checking with mypy, security checks with bandit, semantic checks with semgrep) to identify issues early.

tests

Run tests with pytest to verify functionality and generate coverage reports.

precommit

Use pre-commit hooks to automatically run checks before commits.

build-publish

Build and publish artifacts using Hatch when preparing releases.