home / mcp / exercises mcp server

Exercises MCP Server

Provides access to the Exercises By Api Ninjas API through a standard MCP stdio server.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bach-ai-tools-exercises_by_api_ninjas": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "env": {
        "API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You can use this MCP server to access the Exercises By Api Ninjas API from your application. It exposes a simple stdio-based interface so you can run the server locally and forward API requests through your MCP client or platform.

How to use

You can connect to this MCP server in two practical ways. First, run it via the UVX runtime so it automatically handles installation and execution. Second, run it directly in development mode using Python if you prefer.

Using UVX (recommended): start the MCP server with the helper runtime so it will install and run the package for you. You can point UVX to the package and the entry point, then supply your API key via environment variables.

Running in development mode with Python: launch the server directly from source during development. This is useful if you are actively modifying the server code.

How to install

Prerequisites: you need Python installed on your system and a working internet connection.

Install the package from PyPI to get the MCP server ready for use and then run it.

pip install bach-exercises_by_api_ninjas

Optionally, you can install in editable mode if you are developing or contributing to the server.

pip install -e .

Start the MCP server using UVX (automatic install and run) or start directly with Python.

uvx --from bach-exercises_by_api_ninjas bach_exercises_by_api_ninjas
uvx --from bach-exercises_by_api_ninjas@latest bach_exercises_by_api_ninjas
python server.py

If you install the package and want to run it as a command after installation, use the following form where the command name uses underscores.

bach_exercises_by_api_ninjas

Additional configuration and usage notes

API access requires authentication. Supply your API key through an environment variable when running the MCP server.

export API_KEY="your_api_key_here"

Environment variables you may use when running the server include the API_KEY. The HOST and PORT values are optional and not required by default.

You can integrate this MCP server with cursor-based clients or Claude Desktop by providing the same environment variable in their MCP configurations.

Available tools and endpoints inline

Tools exposed by this MCP server include an endpoint that retrieves exercises from the Exercises API.

v1exercises — API Ninjas Exercises API endpoint. Returns up to 10 exercises matching given criteria.

Endpoint: GET /v1/exercises with optional filters like name, type, muscle, difficulty, and offset.

Notes on security and stability

Keep your API key secure. Do not expose it in client-side code or logs. Rotate keys if you suspect compromise.

If you deploy in a shared environment, ensure the API_KEY is provided securely to each MCP instance and scope access to required capabilities only.

Troubleshooting

If the MCP server fails to start, verify that Python is installed and the required package is accessible in your environment. Check that API_KEY is set in your runtime environment.

Available tools

v1exercises

API Ninjas Exercises API endpoint that returns up to 10 exercises matching given criteria via GET /v1/exercises