feat: MCP server, Bambu Cloud task sync & display name fix (#7)

* added mcp initial trail files

* timestamp use your local django timezone

* added bambu cloud task sync with correct endpoint other than py cloud api

* back fill and relink print name using cloud if there is

* use correct bump-version
This commit is contained in:
RunLit
2026-03-29 23:15:59 +11:00
committed by GitHub
parent 9a91b14593
commit fa90ef11b6
20 changed files with 1761 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Bambu-Run MCP Server
After=network.target
[Service]
Type=exec
WorkingDirectory={{REPO_DIR}}
EnvironmentFile={{REPO_DIR}}/.env
Environment=DJANGO_SETTINGS_MODULE=standalone.settings
ExecStart={{VENV_DIR}}/bin/python standalone/manage.py bambu_mcp_server --transport sse --host 0.0.0.0 --port 8808
Restart=on-failure
RestartSec=10
[Install]
WantedBy=default.target

View File

@@ -8,6 +8,12 @@ VENV_DIR="$REPO_DIR/.venv"
MANAGE="$VENV_DIR/bin/python $REPO_DIR/standalone/manage.py"
SERVICES="bambu-run-web.service bambu-run-collector.service"
# Include MCP service if installed
SERVICE_DIR="$HOME/.config/systemd/user"
if [ -f "$SERVICE_DIR/bambu-run-mcp.service" ]; then
SERVICES="$SERVICES bambu-run-mcp.service"
fi
case "${1:-help}" in
start)
systemctl --user start $SERVICES
@@ -25,14 +31,22 @@ case "${1:-help}" in
systemctl --user status $SERVICES --no-pager
;;
logs)
journalctl --user -u bambu-run-web -u bambu-run-collector -f --no-hostname
JOURNAL_UNITS="-u bambu-run-web -u bambu-run-collector"
if [ -f "$SERVICE_DIR/bambu-run-mcp.service" ]; then
JOURNAL_UNITS="$JOURNAL_UNITS -u bambu-run-mcp"
fi
journalctl --user $JOURNAL_UNITS -f --no-hostname
;;
update)
echo "Pulling latest code..."
cd "$REPO_DIR" && git pull
echo "Installing dependencies..."
"$VENV_DIR/bin/pip" install --quiet ".[standalone]"
EXTRAS="standalone"
if [ -f "$SERVICE_DIR/bambu-run-mcp.service" ]; then
EXTRAS="standalone,mcp"
fi
"$VENV_DIR/bin/pip" install --quiet ".[$EXTRAS]"
echo "Running migrations..."
$MANAGE migrate --noinput