Support npx

This commit is contained in:
Fanyang Meng
2025-04-20 16:03:11 -04:00
parent 4ae189429b
commit 38c7ce34e3
3 changed files with 17 additions and 7 deletions

View File

@@ -19,11 +19,9 @@ To use this with MCP clients, for instance, Claude Desktop, add the following to
```json ```json
{ {
"mcpServers": { "mcpServers": {
"ghost-mcp-ts": { "ghost-mcp": {
"command": "node", "command": "npx",
"args": [ "args": ["-y", "@fanyangmeng/ghost-mcp"],
"ABSOLUTE_PATH_TO_GHOST_MCP_SERVER/build/server.js",
],
"env": { "env": {
"GHOST_API_URL": "https://yourblog.com", "GHOST_API_URL": "https://yourblog.com",
"GHOST_ADMIN_API_KEY": "your_admin_api_key", "GHOST_ADMIN_API_KEY": "your_admin_api_key",

View File

@@ -1,13 +1,23 @@
{ {
"name": "@fanyangmeng/ghost-mcp", "name": "@fanyangmeng/ghost-mcp",
"version": "0.0.1", "version": "0.1.0",
"description": "MCP server for using the Ghost API", "description": "MCP server for using the Ghost API",
"main": "index.js", "main": "build/server.js",
"bin": {
"ghost-mcp": "build/server.js"
},
"files": [
"build/"
],
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"start": "node build/server.js", "start": "node build/server.js",
"prepare": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"publishConfig": {
"access": "public"
},
"keywords": [], "keywords": [],
"author": "Fanyang Meng (https://mfydev.link)", "author": "Fanyang Meng (https://mfydev.link)",
"license": "ISC", "license": "ISC",

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env node
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js"; import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { ghostApiClient } from './ghostApi'; // Import the initialized Ghost API client import { ghostApiClient } from './ghostApi'; // Import the initialized Ghost API client