feat(toggl): add self-hostable HTTP transport - #36
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a self-hostable HTTP transport alongside the existing stdio MCP server, hardens some error handling/privacy defaults, and expands tests/docs to cover the new deployment mode. In the broader codebase, it extends the existing Toggl MCP server from a local CLI-focused tool into a deployable HTTP service while also changing timeline privacy behavior.
Changes:
- Add Streamable HTTP serving with
/mcpand/health, plus Docker and GHCR build workflow support for self-hosting. - Sanitize MCP/Toggl error payloads and add broader MCP/HTTP smoke tests.
- Change timeline title handling to redact by default, introduce
title_mode, and document self-hosting/privacy behavior.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
vitest.config.ts |
Expands coverage collection to all src/**/*.ts and adds minimum thresholds. |
tests/toggl-api.test.ts |
Adds regression coverage for sanitized auth error handling. |
tests/timeline.test.ts |
Verifies new default-redaction and title_mode timeline behavior. |
tests/stdio-smoke.test.ts |
Updates stdio smoke expectations for the new timeline schema defaults. |
tests/mcp-server.test.ts |
Adds in-memory MCP server tests for schema, error payloads, cache tools, and timeline privacy. |
tests/http-smoke.test.ts |
Adds end-to-end smoke coverage for the new HTTP transport and /health endpoint. |
tests/cache-manager.test.ts |
Minor formatting-only test change. |
src/toggl-api.ts |
Reworks 4xx/Timeline errors into structured sanitized TogglAPIErrors. |
src/timeline.ts |
Introduces title_mode and flips timeline title redaction to default-on. |
src/index.ts |
Refactors server creation, adds HTTP transport, error sanitization, and updated tool schema/help text. |
README.md |
Documents new privacy defaults, self-hosting, Docker/PaaS usage, and config variables. |
Dockerfile |
Adds container image for HTTP deployment. |
.github/workflows/docker-build.yml |
Adds Docker build/publish workflow for GHCR releases. |
.dockerignore |
Excludes build, git, and local artifacts from Docker context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f6df1b6 to
b631c46
Compare
|
Refreshed this branch onto current Local verification from the rebased branch:
I could not run the local Docker smoke because Docker is not running on this machine (missing I also compared #50 while refreshing this: the important pieces from that review path are already covered here (per-request server/transport, structured JSON-RPC errors, auth, CORS opt-in, and cache warm-up memoization). I did not add the literal |
* feat(toggl): add workspace user reporting Refreshes PR #46 on top of feat/self-host-streamable-http. Adds privacy-safe workspace user lookup and optional uid report filtering through Toggl Reports API v3. Co-authored-by: Vincent Ardern <vincent@charityaccounts.co.nz> * fix: address review feedback for workspace users and header casing --------- Co-authored-by: Vincent Ardern <vincent@charityaccounts.co.nz> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Summary
Breaking Changes
title_mode: "raw"orredact_titles: false.MCP_HTTP_AUTH_TOKENunless explicitly running unauthenticated loopback-only development mode. stdio remains the default transport.Test Plan
Related Issues