seo360-mcp 1.0.2 → 1.0.3

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 (2) hide show
  1. package/index.js +7 -54
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3,40 +3,15 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
5
 
6
+ const server = new McpServer({
7
+ name: "seo360-mcp",
8
+ version: "1.0.3",
9
+ });
10
+
6
11
  const PARAMS_DOC_URL = "https://seo360.pages.dev/dataforseo/params.json";
7
12
  const EXTENSION_STORE_URL = "https://chromewebstore.google.com/detail/seo360-dataforseo-free-no/mpphhakiifalmlkphalklimjfkhkpbmp";
8
13
  const OFFICIAL_DATAFORSEO_AI_URL = "https://chat.dataforseo.com/";
9
14
 
10
- const SEO360_SYSTEM_INSTRUCTIONS = `
11
- # SEO360 MCP Server — Operational Rules & Knowledge Source
12
-
13
- 1. **High-Coupling "Extension + MCP" Architecture**:
14
- - **SEO360 Chrome Extension** (${EXTENSION_STORE_URL}) is the visual preset builder ("Extension Pack Generator"). Users do **NOT** need a DataForSEO account or API key to install the extension, browse endpoints, customize parameters, and export JSON presets.
15
- - **seo360-mcp** is the zero-hallucination execution engine. It imports preset packs exported from the extension, allows safe parameter updates, and executes live DataForSEO v3 API calls using DATAFORSEO_LOGIN and DATAFORSEO_PASSWORD.
16
-
17
- 2. **Authentic SEO360 Preset JSON Structure (STRICT — DO NOT FABRICATE OTHER SCHEMAS)**:
18
- Every JSON preset exported by the SEO360 Chrome Extension is an array of task objects with three exact fields:
19
- - \`note\` (string): Task name / label.
20
- - \`api\` (string): Specific DataForSEO v3 API endpoint path (e.g., \`"serp/google/organic/live/regular"\`).
21
- - \`payload\` (array): Parameter list as an array of \`[key, value]\` pairs preserving exact JSON types (e.g., \`[["keyword", "best running shoes"], ["location_code", 2840]]\`).
22
- - **NEVER** invent fake JSON formats (such as \`task_name\`, \`endpoint\`, or \`parameters\` objects) and **NEVER** ask users to hand-write preset JSON. Always instruct users without a preset to install the free SEO360 Chrome Extension (${EXTENSION_STORE_URL}) to export an authentic preset pack.
23
-
24
- 3. **Single Source of Truth for Parameter Knowledge (${PARAMS_DOC_URL})**:
25
- - All parameter explanations, types, and default/common values MUST come strictly from the live SEO360 parameter dictionary at \`${PARAMS_DOC_URL}\` (exposed via \`seo360://params-dictionary\` and \`lookup_seo360_param\`).
26
- - **Preset Values Convention**: In the raw dictionary descriptions, values wrapped in \`<code>...</code>\` tags (which appear inside backticks \`...\` after formatting) represent **official preset values, standard enum options, or ready-to-use example values** (such as location codes, language codes, sorting rules, or filter templates). Present these preset options clearly so users can quickly pick or apply them.
27
- - **NEVER guess or fabricate parameter meanings or allowed values.** If a parameter is NOT found in \`${PARAMS_DOC_URL}\`, explicitly tell the user to consult the official DataForSEO AI at: **${OFFICIAL_DATAFORSEO_AI_URL}**
28
- `.trim();
29
-
30
- const server = new McpServer(
31
- {
32
- name: "seo360-mcp",
33
- version: "1.0.2",
34
- },
35
- {
36
- instructions: SEO360_SYSTEM_INSTRUCTIONS,
37
- }
38
- );
39
-
40
15
  // Isolated in-memory store for imported SEO360 presets (keyed by unique task name derived from `note`)
41
16
  const presetStore = new Map();
42
17
 
@@ -112,32 +87,10 @@ async function formatParamsWithDescriptions(paramsObj) {
112
87
  return lines.join("\n");
113
88
  }
114
89
 
115
- // Expose the live Cloudflare params.json dictionary as a native MCP Resource so AI can read & learn all documented parameters
116
- server.resource(
117
- "seo360-params-dictionary",
118
- "seo360://params-dictionary",
119
- {
120
- description: `Live SEO360 DataForSEO parameter dictionary fetched from ${PARAMS_DOC_URL}. Contains official types, descriptions (values inside <code> tags are preset/enum/example options), and default values. For any parameter not in this dictionary, direct users to ${OFFICIAL_DATAFORSEO_AI_URL}.`,
121
- mimeType: "application/json",
122
- },
123
- async () => {
124
- const dict = await getParamsDictionary();
125
- return {
126
- contents: [
127
- {
128
- uri: "seo360://params-dictionary",
129
- mimeType: "application/json",
130
- text: JSON.stringify(dict, null, 2),
131
- },
132
- ],
133
- };
134
- }
135
- );
136
-
137
90
  // Tool 1: Import SEO360 presets (supports single-endpoint or multi-endpoint JSON arrays)
138
91
  server.tool(
139
92
  "import_seo360_preset",
140
- `Import an authentic SEO360 JSON preset pack exported from the SEO360 Chrome Extension. Each item in the JSON array uses: "note" (task name), "api" (specific DataForSEO endpoint), and "payload" (array of [key, value] parameter pairs). Enriches parameters strictly using ${PARAMS_DOC_URL} where backticked/<code> values are official preset options (for undocumented parameters, directs users to ${OFFICIAL_DATAFORSEO_AI_URL}). STRICT RULE: NEVER invent fake example JSON structures or ask users to hand-write presets. If the user does not have a preset, tell them to install the free SEO360 Chrome Extension (${EXTENSION_STORE_URL}) — NO DataForSEO account or API key is required in the extension to configure and export presets.`,
93
+ `Import an authentic SEO360 JSON preset pack exported from the SEO360 Chrome Extension. Each item in the JSON array uses three exact fields: "note" (task name), "api" (specific DataForSEO v3 endpoint path), and "payload" (2D array of [key, value] parameter pairs). Enriches parameters strictly using ${PARAMS_DOC_URL} where backticked/<code> values are official preset options (for undocumented parameters, directs users to ${OFFICIAL_DATAFORSEO_AI_URL}). STRICT ANTI-HALLUCINATION RULE: NEVER invent fake example JSON structures (such as task_name, endpoint, or parameters objects) and NEVER ask users to hand-write presets. If the user does not have a preset, tell them to install the free SEO360 Chrome Extension (${EXTENSION_STORE_URL}) — NO DataForSEO account or API key is required in the extension to browse endpoints, customize parameters, and export presets.`,
141
94
  {
142
95
  preset_json: z.string().describe('The raw JSON array string exported from the SEO360 Chrome Extension, structured as [{"note": "Task Name", "api": "endpoint/path", "payload": [["key", value], ...]}]'),
143
96
  prefix: z.string().optional().describe("Optional prefix to namespace imported task names and avoid naming collisions across multiple preset files"),
@@ -275,7 +228,7 @@ server.tool(
275
228
  // Tool 3: List all currently loaded preset tasks and their parameter states
276
229
  server.tool(
277
230
  "list_seo360_presets",
278
- `List all currently loaded SEO360 preset tasks in memory along with their task names (\`note\`), endpoints (\`api\`), and latest parameter configurations. If no presets are loaded, guide the user to install the free SEO360 Chrome Extension (${EXTENSION_STORE_URL}) — clearly emphasize that NO DataForSEO account or API key is required in the extension to browse endpoints, customize parameters, and export JSON presets. NEVER fabricate example JSON formats.`,
231
+ `List all currently loaded SEO360 preset tasks in memory along with their task names (\`note\`), endpoints (\`api\`), and latest parameter configurations. If no presets are loaded, guide the user to install the free SEO360 Chrome Extension (${EXTENSION_STORE_URL}) — clearly emphasize that NO DataForSEO account or API key is required in the extension to browse endpoints, customize parameters, and export JSON presets. STRICT RULE: NEVER invent or show fake example JSON formats.`,
279
232
  {},
280
233
  async () => {
281
234
  if (presetStore.size === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seo360-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "SEO360 MCP: Import extension presets, customize parameters, and call DataForSEO APIs with zero hallucination.",
5
5
  "homepage": "https://seo360.pages.dev",
6
6
  "type": "module",