Development¶
This page explains how to set up a working copy, run the checks that CI runs, and build this documentation.
Requirements¶
Clone the repository¶
Git LFS stores these files:
the model weights,
src/backlog_mcp/model/*.safetensors;the tokenizer,
src/backlog_mcp/model/tokenizer.json;the vendored JavaScript of the console,
src/backlog_mcp/static/vendor/*.jsand*.mjs.
The tests read these files. Without them, a clone holds small pointer files, and the semantic search tests fail. Install Git LFS before you clone, then fetch the files:
git lfs install
git clone https://github.com/mosquito/backlog-mcp.git
cd backlog-mcp
git lfs pull
git lfs ls-files lists the LFS files of the working copy.
Install the dependencies¶
make sync
make sync runs uv sync --all-groups. It installs the package and the dev and docs
dependency groups into .venv.
Run the checks¶
make runs the linters, the type checker and the tests:
make
It is the same as make lint types test. The targets run these commands:
Target |
Command |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
Removes the tool caches, coverage data and |
make coverage runs the full test suite and prints the lines that the tests do not cover.
What CI runs¶
The tests workflow in .github/workflows/tests.yml runs on every push and pull request. Run
the same commands locally before you push.
The test job runs:
uv sync --all-groups
node --test tests/webui_client.mjs tests/webui_credentials.mjs tests/webui_agent_config.mjs
uv run ruff format --check src tests
uv run ruff check src tests
uv run mypy src
uv run pytest -v --cov=backlog_mcp --cov-report=term-missing
The docs job builds this site:
uv sync --all-groups
make -C docs html
docs/Makefile runs Sphinx with -W, so a warning fails the build: a broken link or a
malformed page. The site is written to docs/_build/html. make docs in the repository root
runs the same target. Give other Sphinx options with SPHINXOPTS, for example
make -C docs html SPHINXOPTS=.
On the master branch, the publish job deploys the site to GitHub Pages after both jobs
pass.
Where the tests live¶
pytest collects tests from tests/, as set by testpaths in pyproject.toml.
The pages of this site and README.md hold no tests. tests/test_docs.py reads them and
checks that each backlog command, each option and each BACKLOG_MCP_* variable that they
name exists in the help of the command line. Run it after you change a page or an option:
uv run pytest tests/test_docs.py
pytest runs in the asyncio_mode = "auto" mode of pytest-asyncio, so an async def test
needs no marker.
The console tests in tests/webui_*.mjs use the Node.js test runner and need no browser.
tests/webui_agent_config.mjs calls uv run python, so run make sync first. The
scripts in tests/browser/ drive a real browser with Playwright. CI does not run them.
Run a local server¶
make serve
make serve runs uv run backlog mcp --protocol=http --http-listen=127.0.0.1 --http-port=3009. The server uses your default database. Open the console at
http://127.0.0.1:3009/console.
Build the Docker image¶
make docker-build
The target builds the Dockerfile for linux/amd64 and tags the image backlog-mcp:local.
Set DOCKER_IMAGE to use another tag:
make docker-build DOCKER_IMAGE=backlog-mcp:dev