Skip to content

Add historical expenses and interactive MCP App reports - #1

Merged
vokshirg merged 4 commits into
mainfrom
feature/labor-costs-mcp-app
Oct 15, 2026
Merged

vokshirg merged 4 commits into
mainfrom
feature/labor-costs-mcp-app

Conversation

@vokshirg

@vokshirg vokshirg commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Bump the MCP package to 1.2.0 and add the PineCode Solidtime 0.21.1 expense API: effective-dated member/project rates, private settings, entry details, grouped reports and dual-currency CSV/PDF exports.
  • Add read-only discovery tools for members, currencies, organization and project details; use personal memberships at startup rather than the first page of organization members.
  • Add a standard MCP App resource and interactive inline report with dates, currency, project/task subgrouping, pagination and host-mediated downloads. Plain text and structured JSON remain available to non-UI hosts.
  • Keep phone reports compact: bounded scroll regions, collapsed entry details, 20-entry default pages, and responsive group rows with original/report currencies. The chart displays billable hours without converting exact money strings to floats.
  • Correct upstream array filter names and use the actual billing currency and ISO minor-unit precision instead of hard-coded EUR/cents.

Safety and Compatibility

  • Default read-only mode exposes 18 tools. Six expense mutation tools require explicit write mode, and the Solidtime API still enforces Owner/Admin and own-data visibility. The widget contains no mutation controls.
  • All API requests stay pinned to the configured HTTPS origin; redirects are refused. The widget has no token, direct API access, external assets, analytics or network origins in its CSP.
  • Exports remain session-only memory resources, capped at 8 MiB per file and five files, with ten-minute access expiry. No public download URLs or files on disk are created by MCP.
  • Expense tools require the private Solidtime extension; standard tools remain usable with upstream Solidtime.
  • Node 20+ and compatible pinned MCP Apps 1.x/SDK 1.x dependencies. No npm release, merge or automatic production deploy.

Initial Verification (1.1.0)

  • 13 tests passed, including default read-only safety, origin/redirect protection, exact expense strings, real query names, hidden writes, zero rates, export resource access and binary size/type limits.
  • Type check, build, lint and formatting passed. Production dependency audit: 0 vulnerabilities.
  • GitHub CI passed on Node 20, 22 and 24 for head 3e7a5fd899631a8d0a844f530472538649c9a90b (run).
  • The existing Keychain launcher successfully started version 1.1.0, exposed 17 read-only tools and the UI resource, and read the real production organization and expense APIs without logging private values. Solidtime 0.21.1 revision b26a098854d4ad66ec2f299eb7abffc4b47b6060 is deployed under separate explicit approval.
  • Fresh stdio MCP verification against production passed personal project/task reports, original/historically converted currencies, own-member filtering, all-five-member grouping and private CSV/PDF generation/resource reads. Historical quote backfills run in the production worker; missing quotes are explicitly incomplete until loaded.
  • Temporary Ruby browser QA against a synthetic sandbox host passed the MCP Apps initialization handshake, currency changes, employee/subgroup-filter preservation, pagination and host download requests, with no JavaScript exceptions. At 390 px phone width, the report is 594 px tall with no horizontal overflow or reserved blank tail.
  • Fixed two browser-discovered issues: bundle replacement must preserve literal $&, and refresh must not depend on HTML form submission inside a sandbox without allow-forms.
  • Actual inline rendering in the current Codex connection still requires its server restart. The user cannot reconnect it right now; this is a host-connection limitation, not a missing UI resource or production API. Local sandbox/protocol QA is not represented as a completed native Codex-host smoke test.

Visual Evidence

Synthetic USD/RUB report, captured by a temporary Ruby script. Desktop and phone layouts are embedded below.

Desktop project/task report with original, report/payment currencies, weighted FX and billable hours:
MCP payment report, desktop

Compact phone layout with collapsed entry details:
MCP payment report, phone

Payment Currency Follow-up (1.2.0)

Exact revision 2604f13708ac0055b89056aab84d0375f9df33c9. No npm publication, merge or production rollout.

  • Add employee payment estimates and earned-amount weighted daily FX to the inline summary, groups/subgroups and entries while preserving exact API decimal strings. Original, report and payment currency remain independent.
  • Display missing payment FX independently; older extensions show payment data as unavailable rather than inventing a payment currency. The widget remains read-only, with the same no-network CSP, token isolation and host-mediated downloads.
  • Add scoped current personal expense-rate discovery and an explicitly write-mode-only member payment-currency setting. Solidtime enforces Owner/Admin and own-member access. Unset/null preserves native rate currencies; settings affect reporting views, not actual settlements or rate history.
  • Omit unset optional filters before calling the host: MCP Apps transport can otherwise turn undefined into null, which the real server correctly rejects. Employee and subgroup filters survive currency changes.
  • Keep the phone summary in two columns, payment/weighted FX readable, bounded group scrolling and entry details collapsed. The screenshots above are refreshed to this revision using a temporary Ruby script and synthetic data only.

Follow-up Verification

  • 16 tests passed: exact API payment strings/weighted FX, scoped rate endpoint, hidden/validated currency writes, existing origin/redirect/token/read-only safeguards and export limits.
  • Type check, build, lint and formatting passed. Runtime dependency audit: 0 vulnerabilities.
  • GitHub CI passed on Node 20, 22 and 24 for this head (run).
  • Ruby/Ferrum synthetic sandbox host: real MCP Apps initialization; 18.00 USD / 1560.00 RUB / 86.66666667 weighted FX; display-currency changes preserve RUB payment, member/subgroup filters and omit null filters; pagination, host download, missing-FX state and older-extension fallback passed without JavaScript exceptions.
  • At phone width 390 px the report and host iframe are both 643 px tall, with no horizontal overflow or reserved empty tail. Entry details remain collapsed by default. Desktop and phone inline previews are embedded above.
  • Built local dist for the existing launcher. The current Codex MCP connection has not been restarted; native host rendering of 1.2.0 is not claimed. Its new payment fields also require deploying the corresponding Solidtime revision under separate explicit approval.

Detailed Employee PDF (1.3.0)

  • Add read-only solidtime_export_employee_report with required membership UUID and inclusive date_from / date_to; support optional project/client/task/tag/billable filters.
  • Use the private PineCode /labor-costs/employee-report endpoint: Overview time/pie charts and Project > Description breakdown, with original earnings, salary-currency payment estimate and historical earned-amount weighted FX in the header. The time section includes completed work; earnings include only billable work.
  • Reuse session-local export resources: UUID links, ten-minute expiry, at most five 8 MiB files, no public URL or filesystem writes. Validate PDF MIME type/signature; preserve API authorization errors without leaking response bodies or tokens. No automatic Telegram send.
  • Document member resolution, tool arguments, resources/read base64 bytes and an explicitly authorized downstream document workflow. Requires the corresponding Solidtime endpoint from https://github.com/pinecode/solidtime/pull/5; an older deployment returns 404 rather than a customer-billing substitute.
  • Bump package/protocol version to 1.3.0. Existing widget/export contracts remain intact.

Verification: 20 tests passed, including real MCP client/server protocol, filter mapping, read-only availability, private resource download, malformed input/PDF rejection, 403 redaction, eviction, expiry and cross-session isolation. Build/typecheck, ESLint and formatting passed. The local build was updated; the running Codex connection was not restarted, and Solidtime production was not deployed.

Hosted CI for b2f270539514492890da8e3e75d8e77654b6a9c5: Node 20, 22 and 24 passed (run).

@vokshirg
vokshirg merged commit 8d24f24 into main Oct 15, 2026
3 checks passed
@vokshirg

Copy link
Copy Markdown
Member Author

Merge and production integration verified

Merged the approved head b2f270539514492890da8e3e75d8e77654b6a9c5 into main as 8d24f241d0d12a23573bada85b4002d46072a684. The local installed build is 1.3.0 and its tree matches the merged main tree. Both PR CI and post-merge CI passed (Node 20/22/24): https://github.com/pinecode/solidtime-mcp-server/actions/runs/38781640690 .

The approved Solidtime revision is now deployed on tracker.pine-code.com. A real stdio protocol smoke through the installed Keychain launcher verified initialization at version 1.3.0, discovery of 19 read-only tools, employee PDF export for an inclusive date range, resources/list, and resources/read with valid PDF bytes. No token, payroll values or PDF was published here.

The active Codex connection has not been restarted: native app control is unavailable and the CLI has no per-server restart command. The user was asked to restart only Solidtime MCP in Settings so the current chat discovers the new PDF tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant