@junis/ghost-mcp 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ## ‼️ Important Notice: Python to TypeScript Migration
4
4
  I've completely rewritten the Ghost MCP Server from Python to TypeScript in this v0.1.0 release. This major change brings several benefits:
5
5
 
6
- - Simplified installation: Now available as an NPM package (@fanyangmeng/ghost-mcp)
6
+ - Simplified installation: Now available as an NPM package (@junis/ghost-mcp)
7
7
  - Improved reliability: Uses the official @tryghost/admin-api client instead of custom implementation
8
8
  - Better maintainability: TypeScript provides type safety and better code organization
9
9
  - Streamlined configuration: Simple environment variable setup
@@ -40,7 +40,7 @@ To use this with MCP clients, for instance, Claude Desktop, add the following to
40
40
  "mcpServers": {
41
41
  "ghost-mcp": {
42
42
  "command": "npx",
43
- "args": ["-y", "@fanyangmeng/ghost-mcp"],
43
+ "args": ["-y", "@junis/ghost-mcp"],
44
44
  "env": {
45
45
  "GHOST_API_URL": "https://yourblog.com",
46
46
  "GHOST_ADMIN_API_KEY": "your_admin_api_key",
package/build/server.js CHANGED
@@ -44,6 +44,8 @@ const roles_1 = require("./tools/roles");
44
44
  (0, roles_1.registerRoleTools)(server);
45
45
  const webhooks_1 = require("./tools/webhooks");
46
46
  (0, webhooks_1.registerWebhookTools)(server);
47
+ const upload_1 = require("./tools/upload");
48
+ (0, upload_1.registerUploadTools)(server);
47
49
  const prompts_1 = require("./prompts");
48
50
  (0, prompts_1.registerPrompts)(server);
49
51
  // Set up and connect to the standard I/O transport
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerUploadTools = registerUploadTools;
4
+ // src/tools/upload.ts
5
+ const zod_1 = require("zod");
6
+ const ghostApi_1 = require("../ghostApi");
7
+ const imageUploadParams = {
8
+ file: zod_1.z.string().describe("Absolute path to the image file"),
9
+ purpose: zod_1.z.string().optional().describe("Purpose of the image (default: 'image')"),
10
+ ref: zod_1.z.string().optional().describe("Reference string returned in the response"),
11
+ };
12
+ const mediaUploadParams = {
13
+ file: zod_1.z.string().describe("Absolute path to the audio/video file"),
14
+ thumbnail: zod_1.z.string().optional().describe("Absolute path to a thumbnail image for the media"),
15
+ purpose: zod_1.z.string().optional().describe("Purpose of the media"),
16
+ };
17
+ const fileUploadParams = {
18
+ file: zod_1.z.string().describe("Absolute path to the file"),
19
+ ref: zod_1.z.string().optional().describe("Reference string returned in the response"),
20
+ };
21
+ function registerUploadTools(server) {
22
+ // Upload image
23
+ server.tool("images_upload", "Upload an image to Ghost (jpg, jpeg, png, gif, svg, svgz, ico, webp). Returns the CDN URL.", imageUploadParams, async (args, _extra) => {
24
+ const result = await ghostApi_1.ghostApiClient.images.upload(args);
25
+ return {
26
+ content: [
27
+ {
28
+ type: "text",
29
+ text: JSON.stringify(result, null, 2),
30
+ },
31
+ ],
32
+ };
33
+ });
34
+ // Upload media (audio/video)
35
+ server.tool("media_upload", "Upload audio/video to Ghost (mp4, webm, ogv, mp3, wav, ogg, m4a). Returns the CDN URL.", mediaUploadParams, async (args, _extra) => {
36
+ const result = await ghostApi_1.ghostApiClient.media.upload(args);
37
+ return {
38
+ content: [
39
+ {
40
+ type: "text",
41
+ text: JSON.stringify(result, null, 2),
42
+ },
43
+ ],
44
+ };
45
+ });
46
+ // Upload file
47
+ server.tool("files_upload", "Upload a file to Ghost (pdf, docx, xlsx, csv, epub, zip, etc. 50+ formats). Returns the CDN URL.", fileUploadParams, async (args, _extra) => {
48
+ const result = await ghostApi_1.ghostApiClient.files.upload(args);
49
+ return {
50
+ content: [
51
+ {
52
+ type: "text",
53
+ text: JSON.stringify(result, null, 2),
54
+ },
55
+ ],
56
+ };
57
+ });
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junis/ghost-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "MCP server for using the Ghost API",
5
5
  "main": "build/server.js",
6
6
  "bin": {