suparank 1.2.7 → 1.2.9

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.
Files changed (3) hide show
  1. package/README.md +6 -219
  2. package/bin/suparank.js +26 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,224 +1,11 @@
1
- # Suparank MCP
1
+ # Writer MCP
2
2
 
3
- AI-powered SEO content creation for your blog. Works with Claude Desktop, Cursor, and ChatGPT via the Model Context Protocol (MCP).
3
+ A Model Context Protocol (MCP) server for AI-powered writing assistance.
4
4
 
5
- ## Quick Start
5
+ ## Overview
6
6
 
7
- ```bash
8
- npx suparank
9
- ```
7
+ This project provides an MCP server that enables AI agents to assist with various writing tasks.
10
8
 
11
- Follow the setup wizard to connect your Suparank account.
9
+ ## Getting Started
12
10
 
13
- ## What is Suparank?
14
-
15
- Suparank is a SaaS platform that helps you create SEO-optimized blog content using AI. This MCP (Model Context Protocol) client connects your AI assistant (Claude, Cursor, ChatGPT) to the Suparank platform.
16
-
17
- **Features:**
18
- - Keyword research and SEO strategy
19
- - AI-powered content writing with your brand voice
20
- - Automatic image generation (fal.ai, wiro.ai, Gemini)
21
- - One-click publishing to WordPress and Ghost
22
- - Webhook integrations (Make, n8n, Zapier, Slack)
23
-
24
- ## Installation
25
-
26
- ### Option 1: npx (Recommended)
27
-
28
- No installation needed. Just run:
29
-
30
- ```bash
31
- npx suparank
32
- ```
33
-
34
- ### Option 2: Global Install
35
-
36
- ```bash
37
- npm install -g suparank
38
- suparank
39
- ```
40
-
41
- ## Setup
42
-
43
- 1. **Create a Suparank account** at [suparank.io](https://suparank.io)
44
-
45
- 2. **Create a project** in the dashboard
46
-
47
- 3. **Get your API key** from Settings > API Keys
48
-
49
- 4. **Run setup:**
50
- ```bash
51
- npx suparank setup
52
- ```
53
-
54
- 5. **Add to your AI client:**
55
-
56
- **Claude Desktop** (`~/.config/claude/claude_desktop_config.json`):
57
- ```json
58
- {
59
- "mcpServers": {
60
- "suparank": {
61
- "command": "npx",
62
- "args": ["suparank"]
63
- }
64
- }
65
- }
66
- ```
67
-
68
- **Cursor** (MCP settings):
69
- ```json
70
- {
71
- "mcpServers": {
72
- "suparank": {
73
- "command": "npx",
74
- "args": ["suparank"]
75
- }
76
- }
77
- }
78
- ```
79
-
80
- 6. **Start creating content!**
81
-
82
- Just tell your AI: "Create a blog post about [your topic]"
83
-
84
- ## Commands
85
-
86
- | Command | Description |
87
- |---------|-------------|
88
- | `npx suparank` | Run MCP server (or setup if first time) |
89
- | `npx suparank setup` | Run setup wizard |
90
- | `npx suparank credentials` | Configure local integrations |
91
- | `npx suparank test` | Test API connection |
92
- | `npx suparank session` | View current session state |
93
- | `npx suparank clear` | Clear session state |
94
- | `npx suparank help` | Show help |
95
-
96
- ## Local Integrations
97
-
98
- Configure local credentials for additional features:
99
-
100
- ```bash
101
- npx suparank credentials
102
- ```
103
-
104
- ### Image Generation
105
-
106
- Generate AI images for your blog posts:
107
-
108
- - **fal.ai** - Fast, high quality (recommended)
109
- - **wiro.ai** - Google Imagen via API
110
- - **Gemini** - Google AI directly
111
-
112
- ### WordPress Publishing
113
-
114
- Publish directly to your WordPress site:
115
-
116
- 1. Install the [Suparank Connector plugin](https://suparank.io/wordpress-plugin)
117
- 2. Get the secret key from plugin settings
118
- 3. Add to credentials
119
-
120
- ### Ghost CMS Publishing
121
-
122
- Publish directly to your Ghost blog:
123
-
124
- 1. Go to Ghost Admin > Settings > Integrations
125
- 2. Create a custom integration
126
- 3. Copy the Admin API key
127
- 4. Add to credentials
128
-
129
- ### Webhooks
130
-
131
- Send notifications when content is published:
132
-
133
- - Slack
134
- - Make.com
135
- - n8n
136
- - Zapier
137
-
138
- ## Configuration Files
139
-
140
- All configuration is stored in `~/.suparank/`:
141
-
142
- ```
143
- ~/.suparank/
144
- ├── config.json # API key and project settings
145
- ├── credentials.json # Local integrations (WordPress, Ghost, etc.)
146
- ├── session.json # Current workflow state
147
- └── content/ # Saved articles
148
- ```
149
-
150
- ## Available Tools
151
-
152
- When connected to your AI assistant, Suparank provides these tools:
153
-
154
- ### SEO Research
155
- - `keyword_research` - Keyword analysis and competitive research
156
- - `seo_strategy` - Create SEO strategy and content briefs
157
- - `topical_map` - Design pillar-cluster content architecture
158
- - `content_calendar` - Plan editorial calendar
159
-
160
- ### Content Creation
161
- - `content_write` - Write SEO-optimized articles
162
- - `image_prompt` - Create AI image generation prompts
163
- - `generate_image` - Generate images (requires credentials)
164
-
165
- ### SEO Optimization
166
- - `internal_links` - Develop internal linking strategy
167
- - `schema_generate` - Create JSON-LD structured data
168
- - `geo_optimize` - Optimize for AI search engines (GEO)
169
- - `quality_check` - Pre-publish quality assurance
170
-
171
- ### Workflow
172
- - `create_content` - Main entry point (orchestrates full workflow)
173
- - `save_content` - Save content to session
174
- - `publish_content` - Publish to configured CMS
175
- - `get_session` - View current session state
176
-
177
- ### Publishing
178
- - `publish_wordpress` - Direct WordPress publishing
179
- - `publish_ghost` - Direct Ghost CMS publishing
180
- - `send_webhook` - Send to automation platforms
181
-
182
- ## Example Workflow
183
-
184
- 1. **Tell your AI what you want:**
185
- ```
186
- "Create a blog post about React hooks best practices"
187
- ```
188
-
189
- 2. **Suparank will:**
190
- - Research keywords
191
- - Create content outline
192
- - Write the article (following your brand voice)
193
- - Generate cover image
194
- - Publish to your CMS
195
-
196
- 3. **Review and publish** from your CMS dashboard
197
-
198
- ## Troubleshooting
199
-
200
- ### "Connection failed"
201
-
202
- - Check your API key is valid
203
- - Ensure your project slug is correct
204
- - Verify internet connection
205
-
206
- ### "No credentials configured"
207
-
208
- Run `npx suparank credentials` to set up local integrations.
209
-
210
- ### MCP not connecting
211
-
212
- 1. Restart your AI client
213
- 2. Check the MCP config path is correct
214
- 3. Ensure Node.js 18+ is installed
215
-
216
- ## Support
217
-
218
- - **Documentation:** [suparank.io/docs](https://suparank.io/docs)
219
- - **Issues:** [GitHub Issues](https://github.com/Suparank/Suparank-MCP/issues)
220
- - **Email:** hello@suparank.io
221
-
222
- ## License
223
-
224
- MIT License - see [LICENSE](LICENSE) for details.
11
+ More documentation coming soon.
package/bin/suparank.js CHANGED
@@ -22,7 +22,7 @@ const CONFIG_FILE = path.join(SUPARANK_DIR, 'config.json')
22
22
  const CREDENTIALS_FILE = path.join(SUPARANK_DIR, 'credentials.json')
23
23
  const SESSION_FILE = path.join(SUPARANK_DIR, 'session.json')
24
24
 
25
- // Colors for terminal output
25
+ // Colors for terminal output (only used in interactive commands)
26
26
  const colors = {
27
27
  reset: '\x1b[0m',
28
28
  bright: '\x1b[1m',
@@ -34,14 +34,27 @@ const colors = {
34
34
  cyan: '\x1b[36m'
35
35
  }
36
36
 
37
+ // Check if running in MCP mode (no command argument = MCP server)
38
+ const isMCPMode = !process.argv[2] || !['setup', 'test', 'session', 'clear', 'help', '--help', '-h'].includes(process.argv[2])
39
+
37
40
  function log(message, color = 'reset') {
38
- console.log(`${colors[color]}${message}${colors.reset}`)
41
+ // In MCP mode, use stderr to avoid breaking JSON protocol
42
+ // In interactive mode (setup, test, etc), use stdout for user-friendly output
43
+ if (isMCPMode) {
44
+ console.error(`[suparank] ${message}`)
45
+ } else {
46
+ console.log(`${colors[color]}${message}${colors.reset}`)
47
+ }
39
48
  }
40
49
 
41
50
  function logHeader(message) {
42
- console.log()
43
- log(`=== ${message} ===`, 'bright')
44
- console.log()
51
+ if (isMCPMode) {
52
+ console.error(`[suparank] === ${message} ===`)
53
+ } else {
54
+ console.log()
55
+ log(`=== ${message} ===`, 'bright')
56
+ console.log()
57
+ }
45
58
  }
46
59
 
47
60
  function ensureDir() {
@@ -335,10 +348,9 @@ function runMCP() {
335
348
  const config = loadConfig()
336
349
 
337
350
  if (!config) {
338
- log('No configuration found. Running setup...', 'yellow')
339
- console.log()
340
- runSetup()
341
- return
351
+ // No config - exit with error (user needs to run setup first)
352
+ console.error('[suparank] No configuration found. Run: npx suparank setup')
353
+ process.exit(1)
342
354
  }
343
355
 
344
356
  // Find the MCP client script (modular version)
@@ -359,13 +371,15 @@ function runMCP() {
359
371
  }
360
372
 
361
373
  if (!mcpClientPath) {
362
- log('Error: mcp-client not found', 'red')
374
+ console.error('[suparank] Error: mcp-client not found')
363
375
  process.exit(1)
364
376
  }
365
377
 
366
378
  // Launch MCP client with config
379
+ // Use 'pipe' for stdin/stdout to properly handle MCP protocol
380
+ // stderr is inherited for logging
367
381
  const child = spawn('node', [mcpClientPath, config.project_slug, config.api_key], {
368
- stdio: 'inherit',
382
+ stdio: ['inherit', 'inherit', 'inherit'],
369
383
  env: {
370
384
  ...process.env,
371
385
  SUPARANK_API_URL: config.api_url
@@ -373,7 +387,7 @@ function runMCP() {
373
387
  })
374
388
 
375
389
  child.on('error', (err) => {
376
- console.error('Failed to start MCP client:', err.message)
390
+ console.error('[suparank] Failed to start MCP client:', err.message)
377
391
  process.exit(1)
378
392
  })
379
393
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suparank",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "AI-powered SEO content creation MCP - generate and publish optimized blog posts with your AI assistant",
5
5
  "type": "module",
6
6
  "bin": {