We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bcherrington/activitywatch-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
# Title: Code Inspection Cleanup and Test Coverage
Date: 2025-10-11-2153
Author: AI Agent
Related:
Tags: general
## Summary
- Removed duplicated stdio server logic by delegating to the shared factory and tightened config/schema parity.
- Addressed IntelliJ inspection findings (unused exports, redundant awaits, doc TS warnings) and added regression coverage.
- Documented applied rules: `.augment/rules/preferences.md`, `.augment/rules/documentation.md`.
## Changes
- Refactored `src/index.ts` to bootstrap via `createMCPServer`, eliminating duplicated tool metadata.
- Brought `src/http-server.ts` in line with the stdio entrypoint by delegating diagnostics to the transport layer while reusing the shared server factory. Sessions now reuse a single MCP server instance via `getSharedServer()` to avoid repeated bootstrap work.
- Added resource-usage telemetry (memory/CPU/handle snapshots) and an `/admin/reload-server` hook that drains sessions, resets the pooled MCP server, and optionally retargets `AW_URL`.
- Batched ActivityWatch queries inside `QueryService`, merging per-bucket requests (including canonical flows) into single script executions to cut HTTP round-trips. Period summary breakdowns now reuse a single event/AFK fetch and aggregate slices locally.
- Updated `config/user-preferences.schema.json` and added `tests/unit/config/user-preferences.test.ts` to keep the sample config validated.
- Cleared inspection warnings by adjusting services (`period-summary`, `unified-activity`), utilities (`filters`, `intervals`), and TypeScript types.
- Introduced new unit tests covering helper exports (`utils/filters`, `configurable-title-parser`, capabilities/category/query services, mock client).
- Added `@ts-nocheck` markers to `docs/WINDOW_TITLE_PARSING.md` snippets to silence false-positive JSAnnotator errors.
## Impact
- No breaking API changes; stdio and HTTP entrypoints now share the same server bootstrap path. HTTP sessions pool a shared server instance to minimise re-initialisation costs and now expose lightweight operations telemetry.
- Query-heavy tools now issue one ActivityWatch request per type instead of per bucket, reducing load on AW servers and improving latency.
- Improved reliability of schema/config alignment and helper utilities through automated tests.
- Documentation lints no longer surface blocking IDE errors.
## Validation
- Automated: `npm run test:unit`
## Follow-ups / TODOs
- Extend QueryService coverage to AFK-filtered scenarios and add transport-specific integration smoke tests.
## Links
- src/index.ts
- src/http-server.ts
- src/services/query.ts
- tests/unit/config/user-preferences.test.ts
- docs/WINDOW_TITLE_PARSING.md