seo-intel 1.5.25 → 1.5.26
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/CHANGELOG.md +12 -0
- package/mcp/server.js +129 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.26 (2026-05-16)
|
|
4
|
+
|
|
5
|
+
### New — MCP server (`seo-intel-mcp`)
|
|
6
|
+
- SEO Intel now ships a Model Context Protocol server. Any MCP-capable AI host (Claude Code, Cursor, Cline, Continue, Zed) can call seo-intel's local SQLite intelligence as native tools — no API keys to manage, no remote servers to host, all data stays on your machine.
|
|
7
|
+
- Install for Claude Code: `claude mcp add seo-intel "npx seo-intel-mcp"`
|
|
8
|
+
- Stdio transport — the host spawns the server as a subprocess; zero infrastructure.
|
|
9
|
+
- Tools shipped in this release:
|
|
10
|
+
- `list_projects` (**free**) — every configured project on this machine + crawled page count
|
|
11
|
+
- `get_intel(project, for?)` — wraps `seo-intel intel`. `for=raw` is free; `for=audit|blog|competitor` require an SEO Intel Solo license. When unlicensed, returns a clean MCP error with the upgrade message instead of silent failure.
|
|
12
|
+
- Both tools return structured JSON the agent's LLM can chain — e.g. an agent can call `list_projects` then `get_intel(project=X, for=raw)` and analyse the raw inventory with its own flagship model, no extra prompting needed.
|
|
13
|
+
- New dependency: `@modelcontextprotocol/sdk ^1.29.0`.
|
|
14
|
+
|
|
3
15
|
## 1.5.25 (2026-05-16)
|
|
4
16
|
|
|
5
17
|
### New — `seo-intel intel <project>` — canonical agent-facing entry point
|
package/mcp/server.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* seo-intel MCP server — stdio transport.
|
|
4
|
+
*
|
|
5
|
+
* Run as a subprocess by an MCP-capable host (Claude Code, Cursor, Cline,
|
|
6
|
+
* Continue, Zed, etc.). Exposes seo-intel's local SQLite intelligence to
|
|
7
|
+
* the host's LLM as native tools.
|
|
8
|
+
*
|
|
9
|
+
* Install for Claude Code:
|
|
10
|
+
* claude mcp add seo-intel "npx seo-intel-mcp"
|
|
11
|
+
*
|
|
12
|
+
* Tools (v1.5.26):
|
|
13
|
+
* list_projects — free — projects on this machine + page counts
|
|
14
|
+
* get_intel — free `raw` slice / paid `audit|blog|competitor` slices
|
|
15
|
+
*
|
|
16
|
+
* IMPORTANT: stdout is reserved for JSON-RPC messages. All logging here goes
|
|
17
|
+
* to stderr. Never use console.log in this file.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
21
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
22
|
+
import * as z from 'zod/v4';
|
|
23
|
+
import { readFileSync, readdirSync, existsSync } from 'fs';
|
|
24
|
+
import { dirname, join } from 'path';
|
|
25
|
+
import { fileURLToPath } from 'url';
|
|
26
|
+
|
|
27
|
+
import { getDb } from '../db/db.js';
|
|
28
|
+
import { getIntel, INTEL_SLICES, FREE_SLICES } from '../lib/intel.js';
|
|
29
|
+
import { isPro } from '../lib/license.js';
|
|
30
|
+
|
|
31
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
32
|
+
const ROOT = join(__dirname, '..');
|
|
33
|
+
const VERSION = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8')).version;
|
|
34
|
+
const CONFIG_DIR = join(ROOT, 'config');
|
|
35
|
+
|
|
36
|
+
const server = new McpServer({ name: 'seo-intel', version: VERSION });
|
|
37
|
+
|
|
38
|
+
function listConfigProjects() {
|
|
39
|
+
if (!existsSync(CONFIG_DIR)) return [];
|
|
40
|
+
return readdirSync(CONFIG_DIR)
|
|
41
|
+
.filter(f => f.endsWith('.json') && f !== 'example.json' && !f.startsWith('setup'))
|
|
42
|
+
.map(f => {
|
|
43
|
+
try {
|
|
44
|
+
const c = JSON.parse(readFileSync(join(CONFIG_DIR, f), 'utf8'));
|
|
45
|
+
return { project: c.project || f.replace('.json', ''), target: c.target?.domain || null };
|
|
46
|
+
} catch { return null; }
|
|
47
|
+
})
|
|
48
|
+
.filter(Boolean);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ── Tool: list_projects (free) ────────────────────────────────────────────
|
|
52
|
+
server.registerTool(
|
|
53
|
+
'list_projects',
|
|
54
|
+
{
|
|
55
|
+
description: 'List all SEO Intel projects configured on this machine, each with its target domain and crawled page count. Use this first to discover which projects are available before calling get_intel. Free tier — no license required.',
|
|
56
|
+
},
|
|
57
|
+
async () => {
|
|
58
|
+
const db = getDb();
|
|
59
|
+
const configs = listConfigProjects();
|
|
60
|
+
const out = configs.map(c => {
|
|
61
|
+
const row = db.prepare(
|
|
62
|
+
'SELECT COUNT(*) AS n FROM pages p JOIN domains d ON d.id=p.domain_id WHERE d.project=?'
|
|
63
|
+
).get(c.project);
|
|
64
|
+
return { ...c, pages: row?.n || 0 };
|
|
65
|
+
});
|
|
66
|
+
return {
|
|
67
|
+
content: [{ type: 'text', text: JSON.stringify(out, null, 2) }],
|
|
68
|
+
structuredContent: { projects: out },
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
// ── Tool: get_intel (free raw / paid others) ──────────────────────────────
|
|
74
|
+
server.registerTool(
|
|
75
|
+
'get_intel',
|
|
76
|
+
{
|
|
77
|
+
description: [
|
|
78
|
+
'Get structured project intelligence as a JSON envelope ready for AI agent consumption.',
|
|
79
|
+
'',
|
|
80
|
+
'Slices:',
|
|
81
|
+
' raw (FREE) page/keyword/heading/schema/sitemap inventory per domain',
|
|
82
|
+
' audit (paid) citability scores + active insights ledger',
|
|
83
|
+
' blog (paid) keyword gaps + long tails + drafting hints',
|
|
84
|
+
' competitor (paid) competitor summary + keyword matrix + positioning',
|
|
85
|
+
'',
|
|
86
|
+
'Paid slices require an SEO Intel Solo license (set SEO_INTEL_LICENSE in env, or activate via the CLI). When unlicensed, the tool returns a clear upgrade message — no silent failure.',
|
|
87
|
+
'',
|
|
88
|
+
'Output envelope: { project, for, tier, generated_at, seo_intel_version, data }.',
|
|
89
|
+
].join('\n'),
|
|
90
|
+
inputSchema: {
|
|
91
|
+
project: z.string().describe('Project slug. Call list_projects first to discover available projects.'),
|
|
92
|
+
for: z.enum(INTEL_SLICES).optional().describe('Slice — defaults to "raw" (free).'),
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
async ({ project, for: slice = 'raw' }) => {
|
|
96
|
+
if (!FREE_SLICES.includes(slice) && !isPro()) {
|
|
97
|
+
const msg = `The "${slice}" slice requires SEO Intel Solo (€19.99/mo). Free tier supports: ${FREE_SLICES.join(', ')}. Activate at https://ukkometa.fi/en/seo-intel/ — set SEO_INTEL_LICENSE=SI-xxxx-xxxx-xxxx-xxxx in your env.`;
|
|
98
|
+
return {
|
|
99
|
+
content: [{ type: 'text', text: msg }],
|
|
100
|
+
isError: true,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
const db = getDb();
|
|
105
|
+
const envelope = getIntel(db, project, { for: slice });
|
|
106
|
+
return {
|
|
107
|
+
content: [{ type: 'text', text: JSON.stringify(envelope, null, 2) }],
|
|
108
|
+
structuredContent: envelope,
|
|
109
|
+
};
|
|
110
|
+
} catch (err) {
|
|
111
|
+
return {
|
|
112
|
+
content: [{ type: 'text', text: `seo-intel error: ${err.message}` }],
|
|
113
|
+
isError: true,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
async function main() {
|
|
120
|
+
const transport = new StdioServerTransport();
|
|
121
|
+
await server.connect(transport);
|
|
122
|
+
// stderr is fine; the host typically surfaces this in its MCP logs panel.
|
|
123
|
+
console.error(`[seo-intel-mcp] v${VERSION} ready on stdio. Tools: list_projects, get_intel.`);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
main().catch(err => {
|
|
127
|
+
console.error('[seo-intel-mcp] fatal:', err);
|
|
128
|
+
process.exit(1);
|
|
129
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "seo-intel",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.26",
|
|
4
4
|
"description": "Local Ahrefs-style SEO competitor intelligence. Crawl → SQLite → cloud analysis.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"local-first"
|
|
21
21
|
],
|
|
22
22
|
"bin": {
|
|
23
|
-
"seo-intel": "cli.js"
|
|
23
|
+
"seo-intel": "cli.js",
|
|
24
|
+
"seo-intel-mcp": "mcp/server.js"
|
|
24
25
|
},
|
|
25
26
|
"exports": {
|
|
26
27
|
".": "./cli.js",
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
"analysis/",
|
|
66
67
|
"extractor/",
|
|
67
68
|
"exports/",
|
|
69
|
+
"mcp/",
|
|
68
70
|
"reports/generate-html.js",
|
|
69
71
|
"reports/generate-site-graph.js",
|
|
70
72
|
"reports/gsc-loader.js",
|
|
@@ -87,6 +89,7 @@
|
|
|
87
89
|
"postinstall": "echo '\\n SEO Intel installed.\\n Run: seo-intel setup\\n Or: seo-intel serve (opens dashboard)\\n'"
|
|
88
90
|
},
|
|
89
91
|
"dependencies": {
|
|
92
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
90
93
|
"chalk": "^5.3.0",
|
|
91
94
|
"commander": "^12.0.0",
|
|
92
95
|
"dotenv": "^16.4.5",
|