From 15daa36ab5fd6c4b7ac348ba8e4ec99b87e51561 Mon Sep 17 00:00:00 2001 From: genewoo Date: Tue, 17 Jun 2025 12:55:44 +0800 Subject: [PATCH 1/2] Add CLI entrypoint --- README.md | 9 ++++++++- pyproject.toml | 3 +++ src/hrm/__main__.py | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/hrm/__main__.py diff --git a/README.md b/README.md index 7e7eede..3b0047b 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,14 @@ The following environment variables are used: ## Run the server ```bash -uv run src/hcm/server.py +uv run src/hrm/server.py +``` + +After installing from PyPI you can also run the server directly using +`uvx`: + +```bash +uvx ble-hrm-server ``` ## Run the tests diff --git a/pyproject.toml b/pyproject.toml index 0101113..11e1bc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,9 @@ dependencies = [ "qiniu>=7.16.0", ] +[project.scripts] +ble-hrm-server = "hrm.__main__:main" + [tool.uv] dev-dependencies = [ "pytest>=8.0.0", diff --git a/src/hrm/__main__.py b/src/hrm/__main__.py new file mode 100644 index 0000000..ba62899 --- /dev/null +++ b/src/hrm/__main__.py @@ -0,0 +1,19 @@ +"""Command line entry point for ble-hrm-server.""" + +from __future__ import annotations + +from pathlib import Path +import sys + +from fastmcp.cli.run import run_command + +from . import server + + +def main() -> None: + """Run the bundled MCP server.""" + run_command(str(Path(server.__file__).resolve()), server_args=sys.argv[1:]) + + +if __name__ == "__main__": + main() From 50353d4a6a2cfeba9fd69c5426189c75240940e0 Mon Sep 17 00:00:00 2001 From: genewoo Date: Tue, 17 Jun 2025 12:59:47 +0800 Subject: [PATCH 2/2] Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 11e1bc5..4924178 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ble-hrm-server" -version = "0.1.0" +version = "0.2.0" description = "A MCP server, which serve as a BLE heart rate monitoring to connect with a HRM device." readme = "README.md" requires-python = ">=3.10,<3.14"