Skip to main content
Glama
mclarkson

Blood Pressure Tool

by mclarkson
README.md
# Blood Pressure Tool

This repository contains a simple MCP server for managing blood pressure
readings in Open WebUI, or other tools that can use MCP. It allows users to
create, read, update, and delete blood pressure records.

![Open WebUI Screenshot](docs/OWUI_scrnshot.png)

## Installation

### Database Setup

Before using `bptool`, set up the postgresql database, for example:

```bash
psql -h dbserver -U dbadmin bptool_db <create_schema.sql
```

### Install bptool MCP server

To work with Open WebUI, `bptool` needs to be started by `mcpo`:

```bash
git clone https://github.com/mclarkson/bptool.git
cd bptool
cp env.sample .env
# Edit .env with database details
uvx --with psycopg2-binary --with . mcpo --port 8000 -- python -m bptool.api
```

### Running locally

```bash
# Ensure `.env` is correct and in the current directory
python -m venv venv
. venv/bin/activate
pip install -e .
mcpo --port 8000 -- python -m bptool.api
```

### Install bptool command line tool

```bash
pip install -e .
```

## Usage

### Command Line Interface

```bash
# Help
bptool -h

# Create a reading
bptool create --systolic 120 --diastolic 80 --notes "Feeling well"

# Read recent readings
bptool read --limit 5
```

### Open WebUI

* Admin Panel -> Settings -> External Tools -> Add Connection
* Type = 'OpenAPI'
* URL = 'http://<IP_or_name_of_host>:8000'
* Auth = 'Bearer'
  * To match mcpo `--api-key` setting, or none if not set.

## TODO

* Add code for saving data as the user, not default_user.
* ~~Add the prompt.~~