npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

btrainr-mcp

v1.0.1

Published

Model Context Protocol (MCP) server for the Btrainr coaching platform

Downloads

27

Readme

Btrainr MCP Server

An implementation of the Model Context Protocol (MCP) for the Btrainr coaching platform. This server exposes Btrainr functionalities as tools that can be used by LLMs (Claude, Cursor, OpenAI, etc.) to manage clients, leads, check-ins, and communications.

Features

  • MCP Standard Compliant: Implements the Model Context Protocol over standard I/O (Stdio) by default, with optional SSE support.
  • Type-Safe Tools: All tools are defined with Zod schemas for robust validation.
  • Built-in Safety Gates: Write operations (create_lead, update_lead, send_message, add_client_tag, create_client_note) require explicit confirmation (confirm: true) and support dry runs (dry_run: true).
  • Client & Lead Management: Query and update clients, check-ins, notes, and leads directly from your AI assistant.
  • Interactive Chat CLI: Built-in CLI chat client to test tools interactively using OpenAI models.

Quick Start (with npx)

You can run the Btrainr MCP server directly without cloning or manually building:

npx -y btrainr-mcp

Claude Desktop Configuration

Add the following to your claude_desktop_config.json (located at %APPDATA%\Claude\claude_desktop_config.json on Windows, or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "btrainr": {
      "command": "npx",
      "args": ["-y", "btrainr-mcp"],
      "env": {
        "BTRAINR_API_KEY": "your_btrainr_api_key_here",
        "BTRAINR_API_URL": "https://btrainr.com/api"
      }
    }
  }
}

Cursor Configuration

Add to your .cursor/mcp.json or Cursor MCP settings:

{
  "mcpServers": {
    "btrainr": {
      "command": "npx",
      "args": ["-y", "btrainr-mcp"],
      "env": {
        "BTRAINR_API_KEY": "your_btrainr_api_key_here",
        "BTRAINR_API_URL": "https://btrainr.com/api"
      }
    }
  }
}

Architecture

Architecture


Local Installation & Development

1. Clone & Install Dependencies

git clone https://gitlab.com/Bcoder24/btrainr-mcp.git
cd btrainr-mcp
npm install

2. Configure Environment

Copy .env.example to .env and fill in your credentials:

cp .env.example .env
BTRAINR_API_KEY=your_btrainr_api_key_here
BTRAINR_API_URL=https://btrainr.com/api
PORT=3000
OPENAI_API_KEY=sk-your-openai-api-key-here # Only needed for scripts/chat.ts

3. Build

npm run build

4. Run MCP Server

  • Stdio Mode (Default):
    npm start
  • SSE Mode (HTTP):
    node dist/server.js --sse --port 3000

5. Interactive Chat CLI

Test your MCP tools using an interactive conversational agent powered by OpenAI:

npm run chat

Available Tools

Client Tools

  • list_clients: Lists clients in the workspace. Supports filtering by status (active, inactive, pending) and pagination (limit, skip).
  • get_client_profile: Retrieves detailed profile information for a client by ID.
  • get_client_checkins: Fetches recent check-in history for a client.
  • add_client_tag: Adds a tag (e.g. 'vip', 'injury') to a client. Requires confirm: true.
  • send_message: Sends a message to a client. Requires confirm: true.
  • create_client_note: Creates a private note for a client. Requires confirm: true.

Lead Tools

  • list_leads: Lists leads in the current workspace with pagination and status filters.
  • get_lead: Gets detailed profile for a specific lead by ID.
  • create_lead: Creates a new lead with contact information (name, email, phone). Requires confirm: true.
  • update_lead: Updates lead details (name, email, phone). Requires confirm: true.

Safety Gates on Write Actions

Every modifying action inherits the safety schema:

  • confirm (boolean): Must be true to execute the mutation. If omitted or false, the operation is blocked.
  • dry_run (boolean, optional): Simulates the execution without committing changes.
  • reason (string, optional): Audit rationale recorded in service logs.

Publishing to npm

To publish this package to npm:

  1. Log in to your npm account:
    npm login
  2. Verify packaging contents:
    npm pack --dry-run
  3. Publish:
    npm publish --access public

License

ISC © Btrainr