feat(mcp): add yt mcp service install/uninstall systemd user service #90

Merged
Claude-Run merged 1 commit from feat/YT-35-mcp-service-install into main 2026-07-03 14:25:24 +02:00
Member

Adds a service subcommand group to yt mcp that manages yt mcp serve as a per-user systemd service, mirroring fj mcp service. install writes ~/.config/systemd/user/youtrack-mcp.service running yt mcp serve, plus a 0600 ~/.config/youtrack-cli/mcp.env, then daemon-reload and (unless --no-start) enable --now. It requires the values yt mcp serve cannot generate (--public-base-url, --hub-issuer, --hub-client-id, and a YouTrack base URL via --youtrack-base-url or $YOUTRACK_BASE_URL), generates the two 32-byte YOUTRACK_MCP_MASTER_KEY / YOUTRACK_MCP_SESSION_KEY keys (reusing stored values on re-run so keys are not rotated), and prints generated secrets once to stderr. uninstall is idempotent, removes the unit, reloads, and deletes mcp.env only with --purge.

The real bodies are #[cfg(target_os = "linux")]; every other target compiles a stub returning a clear "Linux-only" error. Pure helpers (addr / database-url resolution, env-file and unit-file rendering, key generation, key reuse) are platform-agnostic and unit-tested. rand / base64 are optional deps gated behind the default-on mcp feature so the slim --no-default-features build stays lean.

#YT-35

Adds a `service` subcommand group to `yt mcp` that manages `yt mcp serve` as a per-user systemd service, mirroring `fj mcp service`. `install` writes `~/.config/systemd/user/youtrack-mcp.service` running `yt mcp serve`, plus a 0600 `~/.config/youtrack-cli/mcp.env`, then `daemon-reload` and (unless `--no-start`) `enable --now`. It requires the values `yt mcp serve` cannot generate (`--public-base-url`, `--hub-issuer`, `--hub-client-id`, and a YouTrack base URL via `--youtrack-base-url` or `$YOUTRACK_BASE_URL`), generates the two 32-byte `YOUTRACK_MCP_MASTER_KEY` / `YOUTRACK_MCP_SESSION_KEY` keys (reusing stored values on re-run so keys are not rotated), and prints generated secrets once to stderr. `uninstall` is idempotent, removes the unit, reloads, and deletes `mcp.env` only with `--purge`. The real bodies are `#[cfg(target_os = "linux")]`; every other target compiles a stub returning a clear "Linux-only" error. Pure helpers (addr / database-url resolution, env-file and unit-file rendering, key generation, key reuse) are platform-agnostic and unit-tested. `rand` / `base64` are optional deps gated behind the default-on `mcp` feature so the slim `--no-default-features` build stays lean. #YT-35
feat(mcp): add yt mcp service install/uninstall systemd user service
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 58s
Create release / Create release from merged PR (pull_request) Has been skipped
d59623466a
Adds a `service` subcommand group to `yt mcp` that manages `yt mcp serve` as a per-user systemd service, mirroring `fj mcp service`. `install` writes `~/.config/systemd/user/youtrack-mcp.service` running `yt mcp serve`, plus a 0600 `~/.config/youtrack-cli/mcp.env`, then `daemon-reload` and (unless `--no-start`) `enable --now`. It requires the values `yt mcp serve` cannot generate (`--public-base-url`, `--hub-issuer`, `--hub-client-id`, and a YouTrack base URL via `--youtrack-base-url` or `$YOUTRACK_BASE_URL`), generates the two 32-byte `YOUTRACK_MCP_MASTER_KEY` / `YOUTRACK_MCP_SESSION_KEY` keys (reusing stored values on re-run so keys are not rotated), and prints generated secrets once to stderr. `uninstall` is idempotent, removes the unit, reloads, and deletes `mcp.env` only with `--purge`.

The real bodies are `#[cfg(target_os = "linux")]`; every other target compiles a stub returning a clear "Linux-only" error. Pure helpers (addr / database-url resolution, env-file and unit-file rendering, key generation, key reuse) are platform-agnostic and unit-tested. `rand` / `base64` are optional deps gated behind the default-on `mcp` feature so the slim `--no-default-features` build stays lean.

#YT-35
Claude-Run deleted branch feat/YT-35-mcp-service-install 2026-07-03 14:25:24 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pandoras-box/youtrack-cli!90
No description provided.