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
{
"mcpServers": {
"ghost-mcp-ts": {
"command": "node",
"args": [
"ABSOLUTE_PATH_TO_GHOST_MCP_SERVER/build/server.js",
],
"ghost-mcp": {
"command": "npx",
"args": ["-y", "@fanyangmeng/ghost-mcp"],
"env": {
"GHOST_API_URL": "https://yourblog.com",
"GHOST_ADMIN_API_KEY": "your_admin_api_key",

View File

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

View File

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