Skip to content

feat: pages CRUD, images upload, browse summaries, posts_meta, and Node v26 fix#22

Open
DevlinLiles wants to merge 9 commits into
MFYDev:mainfrom
DevlinLiles:main
Open

feat: pages CRUD, images upload, browse summaries, posts_meta, and Node v26 fix#22
DevlinLiles wants to merge 9 commits into
MFYDev:mainfrom
DevlinLiles:main

Conversation

@DevlinLiles

Copy link
Copy Markdown

Summary

  • Adds full pages CRUD (browse, read, add, edit, delete) mirroring the posts API
  • Adds images upload tool so feature images and inline images can be uploaded directly to Ghost before use in posts/pages
  • Adds browse summaries and compact tool descriptions across all resources to reduce token overhead in agentic workflows
  • Adds posts_meta tool that returns full post metadata by id: uuid, url, preview_url (draft preview at /p/{uuid}/), full tags and authors via include=, and all SEO/OG/Twitter fields — without returning body content
  • Adds uuid to POST_READ_FIELDS and PAGE_READ_FIELDS so posts_read / pages_read return it
  • Replaces @tryghost/admin-api with a custom Axios-based client to fix a crash on Node v26 (the upstream package uses node-fetch internals incompatible with v26)
  • Extracts shared respond.ts utilities (textResult, browseEnvelope, toConfirmation, pickFields) to eliminate duplication across all tool handlers
  • Adds a macOS install script (install.sh) that wires the MCP server into Claude Desktop config automatically

Test plan

  • posts_meta returns uuid, url, preview_url, tags, and authors for a draft and a published post
  • pages_browse, pages_read, pages_add, pages_edit, pages_delete work end-to-end
  • images_upload returns a usable Ghost URL that can be set as feature_image
  • Server starts cleanly on Node v26 (no crash from @tryghost/admin-api)
  • All existing post/tag/member/user tools still function correctly

Adds pages_browse, pages_read, pages_add, pages_edit, pages_delete mirroring
the posts tool set, plus images_upload for uploading local image files to Ghost.
Installs prerequisites (Homebrew, Node.js), builds from source, collects
Ghost credentials interactively, and registers the MCP server in ~/.claude.json.
Preserves all existing Claude Code config on upsert; idempotent on re-run.
All *_browse tools now return lightweight summary projections instead of
full objects, reducing token usage when listing. Added descriptive strings
to each tool registration so the model knows what fields to expect and
when to use *_read for full detail. Summaries extracted into src/utils/summaries.ts.
Replace manual ~/.claude.json editing with the official Claude Code CLI
(claude mcp add --scope user). Removes any existing ghost-mcp entry first
so re-runs are idempotent, and adds a check that the claude CLI is present
before attempting registration.
…tall

Remove ghost-mcp from ~/Library/Application Support/Claude/claude_desktop_config.json
if present, so stale entries (e.g. pointing at @tryghost/mcp-server) don't
conflict. Also sweep all three claude mcp scopes (user/local/project) before
re-registering to ensure a clean slate on any machine.
Installer now upserts the ghost-mcp entry into claude_desktop_config.json
instead of only removing it. Uses the absolute path to the node binary so
Claude Desktop (which launches with a minimal env) can resolve the executable
without relying on PATH.
…rash

The buffer-equal-constant-time transitive dep (via admin-api → jsonwebtoken
→ jwa) references Buffer.SlowBuffer, which Node.js v26 removed, causing an
immediate crash on require.

Replace with a custom GhostAdminClient that signs JWTs using Node's built-in
crypto.createHmac (HS256) and makes REST calls via axios. Removes @tryghost/
admin-api and the stale @types/axios shim entirely — no new dependencies added.
Adds a posts_meta tool that returns full metadata for a post by id without
body content — includes uuid, computed preview_url (/p/{uuid}/), live url,
full tags and authors via include=, and all SEO/OG/Twitter fields. Also
adds uuid to POST_READ_FIELDS and PAGE_READ_FIELDS so posts_read returns it,
and introduces the respond.ts utility module used across all tool handlers.
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