mcp-ghost-optimized
v1.1.0
Published
MCP server for Ghost CMS with optimized field projection - reduces token usage by 90-98%
Maintainers
Readme
MCP Ghost Optimized
Serveur MCP pour Ghost CMS avec field projection pour réduire la consommation de tokens de 90-98%.
Pourquoi ce MCP ?
Le MCP officiel @fanyangmeng/ghost-mcp retourne ~14K tokens par appel. Ce MCP optimisé retourne ~200-1500 tokens selon le mode choisi.
Installation
Via Claude Code CLI
# Installation globale
claude mcp add ghost-optimized -e GHOST_URL=https://votre-blog.ghost.io -e GHOST_ADMIN_API_KEY=id:secret -- npx -y mcp-ghost-optimized
# Installation dans un projet spécifique
claude mcp add ghost-optimized -s project -e GHOST_URL=https://votre-blog.ghost.io -e GHOST_ADMIN_API_KEY=id:secret -- npx -y mcp-ghost-optimizedLe nom
ghost-optimizedévite les conflits si vous avez déjà un MCP Ghost installé.
Via .mcp.json (manuel)
Ajouter dans votre .mcp.json :
{
"mcpServers": {
"ghost-optimized": {
"command": "npx",
"args": ["-y", "mcp-ghost-optimized"],
"env": {
"GHOST_URL": "https://votre-blog.ghost.io",
"GHOST_ADMIN_API_KEY": "id:secret"
}
}
}
}Installation locale
git clone https://github.com/Mathunterix/mcp-ghost-perso.git
cd mcp-ghost-perso
npm install
npm run buildPuis dans .mcp.json :
{
"mcpServers": {
"ghost-optimized": {
"command": "node",
"args": ["/chemin/vers/mcp-ghost-perso/dist/index.js"],
"env": {
"GHOST_URL": "https://votre-blog.ghost.io",
"GHOST_ADMIN_API_KEY": "id:secret"
}
}
}
}Configuration
Variables d'environnement
| Variable | Obligatoire | Description |
|----------|-------------|-------------|
| GHOST_URL | Oui | URL de votre blog Ghost |
| GHOST_ADMIN_API_KEY | Oui | Clé API Admin (format id:secret) |
| GHOST_DEFAULT_TEMPLATE | Non | Template par défaut pour les nouveaux posts |
Tools disponibles
Posts
| Tool | Description |
|------|-------------|
| posts_browse | Liste les posts avec modes minimal, compact, standard |
| posts_read | Lit un post avec modes metadata, content, full |
| posts_add | Crée un post (supporte HTML via ?source=html) |
| posts_edit | Modifie un post (gère auto updated_at) |
| posts_delete | Supprime un post (requiert confirm: true + title) |
Tags
| Tool | Description |
|------|-------------|
| tags_browse | Liste les tags avec modes minimal, standard |
| tags_read | Lit un tag par ID ou slug |
Images
| Tool | Description |
|------|-------------|
| images_upload | Upload une image depuis file_path ou url |
Exemples d'utilisation
Lister les posts publiés
posts_browse(status: "published", mode: "compact", limit: 10)Filtrer par tag (NQL)
posts_browse(filter: "tag:finance+status:published")Créer un post avec HTML
posts_add(
title: "Mon article",
html: "<p>Contenu de l'article</p>",
status: "draft",
tags: ["tech", "tutorial"]
)Uploader une image
# Depuis un fichier local
images_upload(file_path: "/tmp/image.jpg")
# Depuis une URL
images_upload(url: "https://example.com/image.jpg", filename: "image.jpg")Supprimer un post
posts_delete(id: "xxx", title: "Titre du post", confirm: true)Modes de réponse
posts_browse
| Mode | Tokens/post | Champs |
|------|-------------|--------|
| minimal | ~15 | id, title, slug, status |
| compact | ~50 | + published_at, updated_at |
| standard | ~150 | + tags, excerpt, reading_time |
posts_read
| Mode | Tokens | Champs |
|------|--------|--------|
| metadata | ~200 | Métadonnées sans contenu |
| content | ~500-2000 | + plaintext (HTML converti) |
| full | ~500-3000 | + HTML brut |
Développement
npm run dev # Watch mode
npm run build # Compile TypeScriptStructure
src/
├── index.ts # Entry point (stdio transport)
├── server.ts # Définition des tools MCP
├── api/
│ ├── auth.ts # Génération JWT
│ └── client.ts # Client HTTP avec field projection
└── utils/
├── fields.ts # Presets de champs par mode
└── html.ts # Conversion HTML → plaintextLicence
MIT
