suparank 1.2.6 → 1.2.7

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.
@@ -1,8 +1,24 @@
1
1
  {
2
+ "wordpress": {
3
+ "site_url": "https://your-site.com",
4
+ "secret_key": "YOUR_KEY_FROM_SUPARANK_CONNECTOR_PLUGIN"
5
+ },
6
+
7
+ "ghost": {
8
+ "api_url": "https://your-site.ghost.io",
9
+ "admin_api_key": "your-key-id:your-secret-in-hex"
10
+ },
11
+
2
12
  "image_provider": "fal",
3
13
 
4
14
  "fal": {
5
- "api_key": "your-fal-api-key"
15
+ "api_key": "your-fal-api-key",
16
+ "model": "fal-ai/flux-pro/v1.1"
17
+ },
18
+
19
+ "gemini": {
20
+ "api_key": "your-google-api-key",
21
+ "model": "gemini-2.0-flash-preview-image-generation"
6
22
  },
7
23
 
8
24
  "wiro": {
@@ -11,24 +27,26 @@
11
27
  "model": "google/nano-banana-pro"
12
28
  },
13
29
 
14
- "gemini": {
15
- "api_key": "your-google-ai-api-key"
16
- },
17
-
18
- "wordpress": {
19
- "site_url": "https://your-site.com",
20
- "secret_key": "from-suparank-connector-plugin"
30
+ "webhooks": {
31
+ "default_url": "https://your-default-webhook.com/endpoint",
32
+ "make_url": "https://hook.eu1.make.com/xxxxx",
33
+ "n8n_url": "https://your-n8n.com/webhook/xxxxx",
34
+ "zapier_url": "https://hooks.zapier.com/hooks/catch/xxxxx",
35
+ "slack_url": "https://hooks.slack.com/services/T00/B00/xxxxx"
21
36
  },
22
37
 
23
- "ghost": {
24
- "api_url": "https://your-ghost-site.com",
25
- "admin_api_key": "your-admin-api-key"
26
- },
38
+ "external_mcps": [
39
+ {
40
+ "name": "seo-research-mcp",
41
+ "description": "Provides real keyword data from SEO APIs",
42
+ "available_tools": ["get_keyword_data", "analyze_serp", "get_backlinks"]
43
+ }
44
+ ],
27
45
 
28
- "webhooks": {
29
- "slack_url": "https://hooks.slack.com/services/xxx",
30
- "make_url": "https://hook.make.com/xxx",
31
- "n8n_url": "https://your-n8n.com/webhook/xxx",
32
- "zapier_url": "https://hooks.zapier.com/xxx"
33
- }
46
+ "tool_instructions": [
47
+ {
48
+ "tool_name": "keyword_research",
49
+ "composition_hints": "For accurate search volume data, use seo-research-mcp's get_keyword_data tool."
50
+ }
51
+ ]
34
52
  }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Suparank MCP - Action Tool Handler
3
+ *
4
+ * Dispatches action tools that run locally using credentials
5
+ */
6
+
7
+ import {
8
+ executeImageGeneration,
9
+ executeWordPressPublish,
10
+ executeGhostPublish,
11
+ executeSendWebhook
12
+ } from '../publishers/index.js'
13
+
14
+ /**
15
+ * Execute an action tool locally using credentials
16
+ * @param {string} toolName - Name of the action tool
17
+ * @param {object} args - Tool arguments
18
+ * @returns {Promise<object>} MCP response
19
+ */
20
+ export async function executeActionTool(toolName, args) {
21
+ switch (toolName) {
22
+ case 'generate_image':
23
+ return await executeImageGeneration(args)
24
+ case 'publish_wordpress':
25
+ return await executeWordPressPublish(args)
26
+ case 'publish_ghost':
27
+ return await executeGhostPublish(args)
28
+ case 'send_webhook':
29
+ return await executeSendWebhook(args)
30
+ default:
31
+ throw new Error(`Unknown action tool: ${toolName}`)
32
+ }
33
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Suparank MCP - Backend Tool Handler
3
+ *
4
+ * Executes tools via the Suparank API backend
5
+ */
6
+
7
+ import { log } from '../utils/logging.js'
8
+ import { apiUrl, apiKey, projectSlug } from '../config.js'
9
+
10
+ /**
11
+ * Call a tool on the Suparank backend API
12
+ * @param {string} toolName - Name of the tool to execute
13
+ * @param {object} args - Tool arguments
14
+ * @returns {Promise<object>} Tool result from backend
15
+ */
16
+ export async function callBackendTool(toolName, args) {
17
+ try {
18
+ const response = await fetch(`${apiUrl}/tools/${projectSlug}/${toolName}`, {
19
+ method: 'POST',
20
+ headers: {
21
+ 'Authorization': `Bearer ${apiKey}`,
22
+ 'Content-Type': 'application/json'
23
+ },
24
+ body: JSON.stringify({ arguments: args })
25
+ })
26
+
27
+ if (!response.ok) {
28
+ const error = await response.text()
29
+
30
+ if (response.status === 401) {
31
+ throw new Error(`Invalid or expired API key. Please create a new one in the dashboard.`)
32
+ }
33
+
34
+ throw new Error(`Tool execution failed: ${error}`)
35
+ }
36
+
37
+ const result = await response.json()
38
+ return result
39
+ } catch (error) {
40
+ log('Error calling tool:', error.message)
41
+ throw error
42
+ }
43
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Suparank MCP - Handlers Module
3
+ *
4
+ * Re-exports all tool handlers
5
+ */
6
+
7
+ export { callBackendTool } from './backend.js'
8
+ export { executeActionTool } from './action.js'
9
+ export { executeOrchestratorTool } from './orchestrator.js'