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..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" @@ -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()