8.8 KiB
8.8 KiB
Active Context: PDF Reader MCP Server (Guidelines Alignment)
1. Current Focus
Project alignment and documentation according to Sylph Lab Playbook guidelines are complete. CI workflow fixed (formatting, publish step, Dockerfile, parallelization, pre-commit hook), Test Analytics integrated, and Git history corrected multiple times. Dockerfile updated to use LTS Node. Version bumped to 0.3.16 and pushed successfully.
2. Recent Changes (Chronological Summary)
- Cloned
filesystem-mcpas a base. - Updated
package.json(name, version, description). - Implemented initial PDF tools using
pdf-parse. - Removed unused filesystem handlers.
- Added URL support to
pdf-parsebased tools. - Consolidated tools into a single
read_pdfhandler. - Switched PDF Library: Uninstalled
pdf-parse, installedpdfjs-dist. - Rewrote the
read_pdfhandler (src/handlers/readPdf.ts) to usepdfjs-dist. - Updated
README.mdand Memory Bank files to reflect the switch topdfjs-distand the consolidated tool. - Added Multiple Source Support & Per-Source Pages: Modified
read_pdfhandler and schema to accept an array ofsources. Moved the optionalpagesparameter into each source object. - Created
CHANGELOG.mdandLICENSE. - Updated
.github/workflows/publish.ymlinitially. - Guidelines Alignment (Initial):
- Removed sponsorship information (
.github/FUNDING.yml,README.mdbadges). - Updated
package.jsonscripts (lint,format,validate, addedtest:watch, etc.) and removed unused dependencies. - Verified
tsconfig.json,eslint.config.js,.prettierrc.cjs,vitest.config.tsalignment. - Updated
.gitignore. - Refactored GitHub Actions workflow to
.github/workflows/ci.yml. - Added tests (~95% coverage).
- Updated Project Identity (
sylphlabscope).
- Removed sponsorship information (
- Guidelines Alignment (Configuration Deep Dive):
- Updated
package.jsonwith missing metadata, dev dependencies (husky,lint-staged,commitlint,typedoc,standard-version), scripts (start,typecheck,prepare,benchmark,release,clean,docs:api,prepublishOnly), andfilesarray. - Updated
tsconfig.jsonwith missing compiler options and refinedexcludearray. - Updated
eslint.config.jsto enablestylisticTypeChecked, enforce stricter rules (no-unused-vars,no-explicit-anytoerror), and add missing recommended rules. - Created
.github/dependabot.ymlfor automated dependency updates. - Updated
.github/workflows/ci.ymlto use fixed Action versions and add Coveralls integration. - Set up Git Hooks using Husky (
pre-commitwithlint-staged,commit-msgwithcommitlint) and createdcommitlint.config.cjs.
- Updated
- Benchmarking & Documentation:
- Created initial benchmark file, fixed TS errors, and successfully ran benchmarks (
pnpm run benchmark) after user providedtest/fixtures/sample.pdf. - Updated
docs/performance/index.mdwith benchmark setup and initial results.
- Created initial benchmark file, fixed TS errors, and successfully ran benchmarks (
- API Doc Generation:
- Initially encountered persistent TypeDoc v0.28.1 initialization error with Node.js script.
- Resolved: Changed
docs:apiscript inpackage.jsonto directly call TypeDoc CLI (typedoc --entryPoints ...). Successfully generated API docs.
- Documentation Finalization:
- Reviewed and updated
README.md,docs/guide/getting-started.md, and VitePress config (docs/.vitepress/config.mts) based on guidelines.
- Reviewed and updated
- Code Commit: Committed and pushed all recent changes.
- CI Fixes & Enhancements:
- Fixed Prettier formatting issues identified by CI.
- Fixed ESLint errors/warnings (
no-undef,no-unused-vars,no-unsafe-call,require-await, unused eslint-disable) identified by CI. - Deleted unused
scripts/generate-api-docs.mjsfile. - Fixed
pnpm publisherror: Added--no-git-checksflag to the publish command in.github/workflows/ci.ymlto resolveERR_PNPM_GIT_UNCLEANerror during tag-triggered publish jobs. - Integrated Codecov Test Analytics: Updated
package.jsonto generate JUnit XML test reports and addedcodecov/test-results-action@v1to.github/workflows/ci.ymlto upload them. - Added
test-report.junit.xmlto.gitignore.
- Switched Coverage Tool: Updated
.github/workflows/ci.ymlto replace Coveralls with Codecov based on user feedback. Added Codecov badge toREADME.md. - Version Bump & CI Saga (0.3.11 -> 0.3.16):
- Initial Goal (0.3.11): Fix CI publish error (
--no-git-checks), integrate Test Analytics, add.gitignoreentry. - Problem 1: Incorrect Git history manipulation led to pushing an incomplete
v0.3.11. - Problem 2: Force push/re-push of corrected
v0.3.11/v0.3.12/v0.3.13/v0.3.14tags didn't trigger workflow or failed on CI checks. - Problem 3: CI failed on
check-formatdue to unformattedci.yml/CHANGELOG.md(not caught by pre-commit hook initially). - Problem 4: Further Git history confusion led to incorrect version bumps (
0.3.13,0.3.14,0.3.15) and tag creation issues due to unstaged changes and leftover local tags. - Problem 5: Docker build failed due to incorrect lockfile and missing
pnpminstall inDockerfile. - Problem 6: Workflow parallelization changes were not committed before attempting a release.
- Problem 7:
publish-npmjob failed due to missing dependencies forprepublishOnlyscript. - Problem 8:
pre-commithook was runningpnpm testinstead ofpnpm lint-staged. - Problem 9: Docker build failed again due to
huskycommand not found duringpnpm prune. - Problem 10: Dockerfile was using hardcoded
node:20-alpineinstead ofnode:lts-alpine. - Final Resolution: Reset history multiple times, applied fixes sequentially (formatting
fe7eda1, Dockerfile pnpm installc202fd4, parallelizationa569b62, pre-commit/npm-publish fixe96680c, Dockerfile prune fix02f3f91, Dockerfile LTS50f9bdd), ensured clean working directory, ranstandard-versionsuccessfully to createv0.3.16commit and tag, pushedmainand tagv0.3.16.- Fixed
package.jsonPaths: Correctedbin,files, andstartscript paths frombuild/todist/to align withtsconfig.jsonoutput directory and resolve executable error.- Committed & Pushed Fix: Committed (
ab1100d) and pushed thepackage.jsonpath fix tomain. - Version Bump & Push: Bumped version to
0.3.17usingstandard-version(commitbb9d2e5) and pushed the commit and tagv0.3.17tomain.
- Committed & Pushed Fix: Committed (
- Fixed
- Initial Goal (0.3.11): Fix CI publish error (
3. Next Steps
- Build Completed: Project successfully built (
pnpm run build). - GitHub Actions Status:
- Pushed commit
c150022(CI run14298157760passed format/lint/test checks, but failed at Codecov upload due to missingCODECOV_TOKEN). - Pushed tag
v0.3.10(Triggered publish/release workflow - status needed verification). - Pushed tag
v0.3.16. Publish/release workflow triggered. Status needs verification.
- Pushed commit
- Runtime Testing (Blocked): Requires user interaction with
@modelcontextprotocol/inspectoror a live agent. Skipping for now. - Documentation Finalization (Mostly Complete):
- API docs generated.
- Main pages reviewed/updated.
- Codecov badge added (requires manual token update in
README.md). - Remaining: Add complex features (PWA, share buttons, roadmap page) if requested.
- Release Preparation:
CHANGELOG.mdupdated for0.3.10.- Project is ready for final review. Requires Codecov token configuration and verification of the
v0.3.16publish/release workflow.
4. Active Decisions & Considerations
- Switched to pnpm: Changed package manager from npm to pnpm.
- Using
pdfjs-distas the core PDF library. - Adopted the handler definition pattern from
filesystem-mcp. - Consolidated tools into a single
read_pdfhandler. - Aligned project configuration with Guidelines.
- Accepted ~95% test coverage.
- No Sponsorship: Project will not include sponsorship links or files.
- Using TypeDoc CLI for API Doc Generation: Bypassed script initialization issues.
- Switched to Codecov: Replaced Coveralls with Codecov for coverage reporting. Test Analytics integration added.
- Codecov Token Required: CI is currently blocked on Codecov upload (coverage and test results) due to missing
CODECOV_TOKENsecret in GitHub repository settings. This needs to be added by the user. - Version bumped to
0.3.17. - Publish Workflow: Parallelized. Modified to bypass Git checks during
pnpm publish. Docker build fixed (pnpm install, prune ignore scripts, LTS node). Dependencies installed before publish. Verification pending on thev0.3.17workflow run. - CI Workflow: Added Codecov Test Analytics upload step. Formatting fixed. Parallelized publish steps.
- Pre-commit Hook: Fixed to run
lint-staged.