@mangerik/wordpress-mcp 0.1.0 → 0.1.2

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/docs/USAGE.md ADDED
@@ -0,0 +1,211 @@
1
+ # Usage Guide / Panduan Penggunaan
2
+
3
+ Real-world examples of what to ask your AI agent (Claude Desktop, Kiro, Cursor)
4
+ once `@mangerik/wordpress-mcp` is connected. Mix freely between Indonesian and
5
+ English — the LLM understands both.
6
+
7
+ > **Tip:** the agent doesn't need to know which tool to call. Just describe
8
+ > the outcome; it will pick the right tool(s) automatically.
9
+
10
+ ---
11
+
12
+ ## 📝 Content authoring
13
+
14
+ ### Draft a single post
15
+ > Buatkan draft post tentang **"Tips memilih hosting WordPress untuk pemula"**
16
+ > dengan tone informal, panjang ~800 kata, masuk kategori "Blog" dan tag
17
+ > "hosting", "wordpress", "tutorial". Status draft saja, jangan publish.
18
+
19
+ > Draft a 600-word post titled "Why your team should adopt MCP", tone =
20
+ > opinionated, status = draft, assign to category id 4.
21
+
22
+ ### Bulk drafts from a topic list
23
+ > Saya kasih 5 judul, buatkan draftnya semua sekaligus pakai batch:
24
+ > 1. Cara menulis meta description yang efektif
25
+ > 2. Perbedaan focus keyword dan meta keyword
26
+ > 3. SEO on-page vs off-page
27
+ > 4. Audit konten lama
28
+ > 5. Strategi internal linking
29
+ >
30
+ > Masing-masing ~500 kata, status draft, kategori "SEO".
31
+
32
+ ### Republish an old draft
33
+ > Cari semua post dengan status `draft` yang dibuat sebelum 2024-01-01,
34
+ > tampilkan judulnya, lalu tunggu konfirmasi saya sebelum publish.
35
+
36
+ ### Translate a page
37
+ > Page dengan id 142 isinya bahasa Inggris. Translate ke bahasa Indonesia,
38
+ > lalu **buat page baru** (jangan replace), status draft, parent-nya page
39
+ > 140. Pertahankan struktur HTML dan shortcode-nya.
40
+
41
+ ---
42
+
43
+ ## 🔍 Audit & cleanup
44
+
45
+ ### Find broken / orphan content
46
+ > Cek ada berapa post yang status-nya `pending` selama lebih dari 30 hari.
47
+ > Tampilkan id, title, dan author-nya dalam tabel.
48
+
49
+ ### Featured image audit
50
+ > Cari semua post yang **belum punya featured image**, batasi 50 post
51
+ > terbaru. Output: id, judul, slug.
52
+
53
+ ### Comment moderation
54
+ > Tampilkan 20 komentar terbaru yang status-nya `hold`. Tandai yang isinya
55
+ > spam (kata kunci: "buy now", "click here", URL berlebihan), lalu update
56
+ > status mereka jadi `spam`.
57
+
58
+ ---
59
+
60
+ ## 🛒 WooCommerce
61
+
62
+ ### Inventory check
63
+ > List semua produk WooCommerce dengan stok < 5. Format: SKU, nama, stok
64
+ > sekarang. Urut dari yang paling sedikit.
65
+
66
+ ### Bulk price update
67
+ > Naikkan harga semua produk di kategori "Aksesoris" sebesar 10%. Pakai
68
+ > batch endpoint biar cepat.
69
+
70
+ ### Daily sales summary
71
+ > Beri saya laporan penjualan minggu ini: total order, total revenue,
72
+ > top 5 produk terlaris. Pakai bahasa Indonesia.
73
+
74
+ ### Refund a single order
75
+ > Order #1532 perlu di-refund full karena pelanggan komplain. Cek dulu
76
+ > isinya, lalu lakukan refund dengan reason "customer requested".
77
+
78
+ ---
79
+
80
+ ## 📈 SEO
81
+
82
+ ### Yoast SEO meta for an article
83
+ > Saya pakai Yoast. Untuk post id 89:
84
+ > 1. Generate SEO title (max 60 char), meta description (≤155 char),
85
+ > focus keyword "MCP WordPress integration"
86
+ > 2. Set noindex = false, nofollow = false
87
+ > 3. Apply via `seo_set_meta`
88
+
89
+ ### Rank Math redirection
90
+ > Saya pindah dari `/old-blog/wordpress-mcp` ke `/blog/wordpress-mcp`.
91
+ > Buatkan rule redirection 301 lewat Rank Math.
92
+
93
+ ### SERP preview check
94
+ > Pakai Yoast `/yoast/v1/get_head` untuk URL https://mysite.com/blog/post-x
95
+ > dan tampilkan title, description, dan og:image yang bakal dilihat Google.
96
+
97
+ ---
98
+
99
+ ## 🧱 Block themes & design
100
+
101
+ ### Inspect templates
102
+ > List semua template aktif di tema `twentytwentyfour`. Ada berapa template
103
+ > part di header dan footer?
104
+
105
+ ### Edit a template part
106
+ > Buka template part `twentytwentyfour//footer` dan ganti copyright text
107
+ > dari "© 2024" jadi "© 2026 — All rights reserved by ACME". Sisa konten
108
+ > tetap apa adanya.
109
+
110
+ ### Pattern audit
111
+ > Tampilkan semua block patterns yang terdaftar di site ini, dikelompokkan
112
+ > per kategori.
113
+
114
+ ---
115
+
116
+ ## 👥 User management
117
+
118
+ ### Create an editor account
119
+ > Buatkan user baru dengan role "editor": username `siti`, email
120
+ > `siti@example.com`, password generate yang kuat, lalu kasih saya
121
+ > password-nya.
122
+
123
+ ### Reassign content sebelum hapus user
124
+ > User id 12 mau dihapus. Reassign semua post mereka ke user id 1, baru
125
+ > hapus.
126
+
127
+ ---
128
+
129
+ ## 🧰 Generic / custom post types
130
+
131
+ ### Discovery first
132
+ > Cek site ini punya CPT apa saja, dan taxonomy apa saja. Tampilkan
133
+ > sebagai dua tabel.
134
+
135
+ ### Work with a CPT
136
+ > Site ini punya CPT `portfolio` (saya cek dari `wp_get_post_types`).
137
+ > List 20 portfolio terbaru pakai `wp_list_items` dengan
138
+ > route `wp/v2/portfolio`.
139
+
140
+ ### Custom field via meta
141
+ > Update post id 55, set custom field (sudah register `show_in_rest`):
142
+ > `_views_count` = 1500
143
+ > `_featured_position` = 2
144
+
145
+ ---
146
+
147
+ ## 📦 Batch operations
148
+
149
+ ### Multiple writes in one round-trip
150
+ > Pakai `wp_batch` untuk:
151
+ > 1. Update post 100 (status → publish)
152
+ > 2. Update post 101 (status → publish)
153
+ > 3. Buat 1 comment baru di post 100 dengan content "Selamat membaca!"
154
+ >
155
+ > Mode validasi: `require-all-validate`. Kalau salah satu gagal, batal semua.
156
+
157
+ ### Discover the limit first
158
+ > Berapa max requests yang server WP saya support per batch? Cek pakai
159
+ > `wp_batch_options`.
160
+
161
+ ---
162
+
163
+ ## 🌐 Multisite (jika plugin terpasang)
164
+
165
+ ### Onboard new subsite
166
+ > Tambahkan subsite baru: domain `clientx.example.com`, path `/`,
167
+ > title "Client X", network 1.
168
+
169
+ ### Audit all sites
170
+ > List semua sites di network ini. Tampilkan blog id, domain, path, dan
171
+ > tanggal registrasi.
172
+
173
+ ---
174
+
175
+ ## 🔐 JWT mode (kalau auth = jwt)
176
+
177
+ > Cek apakah token JWT saya masih valid. Pakai `wp_jwt_validate`.
178
+
179
+ ---
180
+
181
+ ## 💡 Tips agar agent kerja efisien
182
+
183
+ 1. **Mulai dengan `wp_site_info`** kalau site-nya belum kamu kenal — agent
184
+ akan tahu plugin apa saja yang aktif lewat field `namespaces`.
185
+ 2. **Pakai `_fields`** untuk list panjang, mis. `_fields=id,title,slug`,
186
+ biar context window LLM tidak cepat penuh.
187
+ 3. **Untuk update post**, minta agent panggil dengan `context=edit` dulu
188
+ biar dapat raw content (bukan HTML yang sudah difilter).
189
+ 4. **Operasi destruktif (delete, force=true)** sebaiknya selalu minta
190
+ konfirmasi: "tampilkan dulu apa yang mau dihapus, baru hapus setelah
191
+ saya bilang ya".
192
+ 5. **Untuk pekerjaan massal (>10 item)**, minta agent pakai `wp_batch`
193
+ atau loop dengan paginasi.
194
+ 6. **Kalau muncul error `rest_forbidden`** untuk meta, biasanya field-nya
195
+ belum register dengan `show_in_rest` di functions.php. Bilang ke
196
+ developer site untuk register pakai `register_post_meta()`.
197
+
198
+ ---
199
+
200
+ ## ❓ Common errors / Error yang sering muncul
201
+
202
+ | Pesan | Penyebab | Solusi |
203
+ |------|----------|--------|
204
+ | `rest_cannot_create` (401) | Application Password salah | Buat ulang di WP Admin → Profile, **jangan hilangkan spasi** |
205
+ | `rest_no_route` (404) | Endpoint plugin tidak ada | Plugin belum terpasang / tidak expose REST |
206
+ | `rest_forbidden` (403) | User tidak punya capability | Login pakai user dengan role yang tepat |
207
+ | `jwt_token_fetch_failed` | `JWT_AUTH_SECRET_KEY` belum diset | Edit `wp-config.php`, tambahkan constant |
208
+ | `rest_post_invalid_meta_key` | `meta` belum register | Pakai `register_post_meta()` dengan `show_in_rest=true` |
209
+ | `woocommerce_rest_authentication_error` | WC consumer key salah | Generate ulang di WC Settings → Advanced → REST API |
210
+ | Tool not found | MCP server belum reconnect | Reconnect MCP server di Kiro / Claude Desktop |
211
+ | `Unable to upload file` | File terlalu besar | Cek `upload_max_filesize` di server, atau pakai chunked upload |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mangerik/wordpress-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "MCP Server for WordPress REST API — connect AI agents to WordPress (posts, pages, media, users, custom post types, WooCommerce, Yoast / Rank Math, block themes, multisite, batch).",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -10,9 +10,11 @@
10
10
  "files": [
11
11
  "dist/**/*.js",
12
12
  "dist/**/*.d.ts",
13
+ "docs/**/*.md",
13
14
  "README.md",
14
15
  "LICENSE",
15
16
  "CHANGELOG.md",
17
+ "SECURITY.md",
16
18
  ".env.example"
17
19
  ],
18
20
  "scripts": {
@@ -22,7 +24,8 @@
22
24
  "watch": "tsc --watch",
23
25
  "typecheck": "tsc --noEmit",
24
26
  "smoke": "node scripts/smoke-test.mjs",
25
- "prepublishOnly": "npm run typecheck && npm run build && npm run smoke"
27
+ "docs": "npm run build && node scripts/gen-tools-doc.mjs",
28
+ "prepublishOnly": "npm run typecheck && npm run build && npm run smoke && npm run docs"
26
29
  },
27
30
  "dependencies": {
28
31
  "@modelcontextprotocol/sdk": "^1.0.0",
@@ -52,13 +55,13 @@
52
55
  "kiro",
53
56
  "llm"
54
57
  ],
55
- "homepage": "https://github.com/mangerik/wordpress-mcp#readme",
58
+ "homepage": "https://github.com/mangerik/WordPress-MCP#readme",
56
59
  "repository": {
57
60
  "type": "git",
58
- "url": "git+https://github.com/mangerik/wordpress-mcp.git"
61
+ "url": "git+https://github.com/mangerik/WordPress-MCP.git"
59
62
  },
60
63
  "bugs": {
61
- "url": "https://github.com/mangerik/wordpress-mcp/issues"
64
+ "url": "https://github.com/mangerik/WordPress-MCP/issues"
62
65
  },
63
66
  "publishConfig": {
64
67
  "access": "public"