你會建立什麼
這篇教學會示範如何把 Cursor 接上 SEO/GEO data,但不把你的 editor 變成不安全的 publishing robot。初學者安全模式是:先用 exports,再建立 normalized files,第三步才是 read-only MCP;只有 approved opportunity report 出來後,才做 page edits。
你會建立:
.cursor/
rules/
seo-geo-data-policy.mdc
seo-geo/
exports/
gsc/
bing/
ga4/
ai-visibility/
snapshots/
reports/
scripts/
normalize-seo-geo-data.mjs
mcp-seo-data-server.mjs
圖說:資料 connector 只提供決策 context,不應自動發布、提交 URL 或修改 production files。
用 data 來輔助 decision。不要讓 data connectors 自動 publish pages、submit URLs、change analytics settings 或 edit production files。
步驟 1:建立 data safety 的 Cursor rule
建立 folders:
mkdir -p .cursor/rules seo-geo/exports/gsc seo-geo/exports/bing seo-geo/exports/ga4 seo-geo/exports/ai-visibility seo-geo/snapshots seo-geo/reports scripts
建立 project rule:
cat > .cursor/rules/seo-geo-data-policy.mdc <<'EOF2'
---
description: SEO/GEO data access and edit safety
globs:
- "seo-geo/**"
- "scripts/**"
- "src/**"
- "app/**"
- "pages/**"
alwaysApply: false
---
For SEO/GEO data tasks:
- read exports from `seo-geo/exports/`
- write normalized snapshots to `seo-geo/snapshots/`
- write reports to `seo-geo/reports/`
- do not invent missing metrics
- do not paste secrets into prompts or files
- do not submit URLs, publish content, deploy, or change production files during data analysis
- separate GSC, Bing, GA4, SERP, and AI visibility signals
- cite source files for every recommendation
- ask before editing website pages
EOF2
如果你的 Cursor version 使用不同的 rules UI,就把同樣 policy 貼進 project rule interface。
步驟 2:加入 sample exports
先從 CSV/JSON files 開始。之後你可以換成 API/MCP。
TODAY=$(date +%F)
cat > seo-geo/exports/gsc/$TODAY-pages.csv <<'EOF2'
url,query,clicks,impressions,ctr,position
/blog/reporting-automation,reporting automation software,34,4200,0.008,8.2
/features/reporting,reporting tool for startups,18,1900,0.009,11.4
EOF2
cat > seo-geo/exports/bing/$TODAY-queries.csv <<'EOF2'
query,clicks,impressions,ctr,position
reporting automation software,4,230,0.017,6.8
automate weekly reports,2,180,0.011,9.3
EOF2
cat > seo-geo/exports/ai-visibility/$TODAY-prompts.json <<'EOF2'
[
{
"prompt": "What is the best reporting automation software for startups?",
"surface": "manual-check",
"brand_mentioned": false,
"citation_url": null,
"competitors": ["Competitor A", "Competitor B"]
}
]
EOF2
步驟 3:先 normalize data,再請 Cursor 做 strategy
建立 normalizer:
cat > scripts/normalize-seo-geo-data.mjs <<'EOF2'
#!/usr/bin/env node
import { readFileSync, writeFileSync, mkdirSync, readdirSync, existsSync } from 'node:fs';
import { join } from 'node:path';
const date = process.argv[2] || new Date().toISOString().slice(0, 10);
mkdirSync('seo-geo/snapshots', { recursive: true });
const rows = ['source,date,query_or_prompt,target_url,metric,value,evidence_url,confidence,raw_file'];
function latestFile(dir, suffix) {
if (!existsSync(dir)) return null;
return readdirSync(dir).filter(f => f.includes(date) && f.endsWith(suffix))[0] || null;
}
function addCsv(source, dir, suffix, metricField) {
const file = latestFile(dir, suffix);
if (!file) return;
const raw = readFileSync(join(dir, file), 'utf8').trim().split(/
?
/);
const headers = raw.shift().split(',');
for (const line of raw) {
const values = line.split(',');
const item = Object.fromEntries(headers.map((h, i) => [h, values[i] || '']));
rows.push([source, date, item.query || '', item.url || '', metricField, item[metricField] || '', item.url || '', 'medium', file].map(JSON.stringify).join(','));
}
}
addCsv('gsc', 'seo-geo/exports/gsc', '.csv', 'clicks');
addCsv('bing', 'seo-geo/exports/bing', '.csv', 'clicks');
const aiFile = latestFile('seo-geo/exports/ai-visibility', '.json');
if (aiFile) {
const items = JSON.parse(readFileSync(join('seo-geo/exports/ai-visibility', aiFile), 'utf8'));
for (const item of items) {
rows.push(['ai-visibility', date, item.prompt || '', '', 'brand_mentioned', String(Boolean(item.brand_mentioned)), item.citation_url || '', 'low', aiFile].map(JSON.stringify).join(','));
}
}
const out = `seo-geo/snapshots/${date}-normalized.csv`;
writeFileSync(out, rows.join('
'));
console.log(`Wrote ${out}`);
EOF2
chmod +x scripts/normalize-seo-geo-data.mjs
node scripts/normalize-seo-geo-data.mjs $(date +%F)
步驟 4:要求 Cursor 產生 opportunity report,不要直接 edits
在 Cursor Agent 貼上:
Use the Cursor rule `seo-geo-data-policy`.
Read the latest normalized CSV in `seo-geo/snapshots/`.
Create `seo-geo/reports/YYYY-MM-DD-opportunity-report.md`.
For each recommendation include:
- source file
- URL or prompt
- signal
- interpretation
- confidence
- action type: refresh, create, internal link, technical ticket, monitor, ignore
- files likely involved
- approval needed
Do not edit website pages yet. Do not publish. Do not submit URLs.
好的 output 會引用 files。弱 output 只會給 generic「improve SEO」建議。如果太弱,要求 Cursor 重做並引用每一列 source row。
步驟 5:file workflow 穩定後,再加 placeholder MCP server
建立一個 placeholder,先明確定義 permissions:
cat > scripts/mcp-seo-data-server.mjs <<'EOF2'
#!/usr/bin/env node
// Placeholder for a read-only SEO/GEO MCP server.
// Future tools: get_gsc_pages, get_bing_queries, get_ga4_landing_pages,
// get_ai_visibility_snapshot. No write, submit, publish, or delete tools.
console.error('SEO/GEO MCP placeholder: read-only tools only.');
setInterval(() => {}, 1000);
EOF2
chmod +x scripts/mcp-seo-data-server.mjs
接著問 Cursor:
Design a read-only MCP configuration for this project using `scripts/mcp-seo-data-server.mjs`.
Before editing settings, explain:
- where Cursor expects MCP configuration in this environment
- tool names
- input and output schemas
- credential handling
- how to disable write actions
- how to test with one read-only query
Do not add API credentials. Do not create write tools.
最後 setup 請使用 Cursor 目前的 MCP settings UI 或 config format,因為 Cursor 的 MCP configuration surface 可能因版本與 workspace 而不同。
步驟 6:報告完成後,只核准一個 page edit
Opportunity report 建好後,只核准一頁:
From `seo-geo/reports/YYYY-MM-DD-opportunity-report.md`, approve only the recommendation for `/features/reporting`.
Allowed action: metadata and opening answer block refresh.
Allowed files: [list files]
Not approved: schema, canonical, robots, sitemap, redirects, analytics, shared template edits.
Use data as private decision context. Do not cite analytics numbers in public copy unless explicitly approved.
Run validation and summarize changed files.
這樣能把 data analysis 和 publishing 分開。
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| Cursor 捏造 missing metrics | Rule 沒載入 | 明確提到 rule,並要求 source files |
| Opportunity report 太 vague | 沒有 normalized snapshot | 先跑 normalizer |
| MCP setup 要求 broad tools | Tool boundary 不清楚 | 只允許 read-only tools |
| Public copy 暴露 analytics | Data 被當成公開 proof | 在 prompt 加上 private decision context |
| Cursor edit 太多 files | Approval 太寬 | 只核准一個 URL 和 exact files |
FAQ
一開始需要 MCP 嗎?
不需要。CSV exports 就夠了。當 workflow 重複、data freshness 變重要時,MCP 才有價值。
Cursor 應該 submit URLs 到 Bing 或 update CMS content 嗎?
第一版不要。保持 read-only actions,直到團隊信任 workflow。
Cursor 可以分析 AI visibility snapshots 嗎?
可以。用 JSON 或 CSV 保存 prompt、surface、answer summary、brand mention、citation URL、competitors 和 date。
AI coding agents for SEO/GEO 學習路徑
Cursor track:
- Cursor vs Windsurf vs Gemini CLI:SEO/GEO 自動化怎麼選
- 如何設定 Cursor Rules 做 SEO/GEO 工作
- 如何用 Cursor Plan Mode 安全更新 SEO 頁面
- 如何用 MCP 將 Cursor 接上 SEO 資料
- 如何用 Cursor Cloud Agents 做 SEO/GEO PR Reviews
- Cursor、Windsurf、Gemini CLI、Codex、Claude Code 的 SEO/GEO 營運模型
Sources and notes
- Cursor documentation hub: Cursor Docs ,包含 Agent、Rules、MCP、Skills、CLI 與 background/agent capabilities 的公開文件。
- Related Auspia guide: Cursor vs Windsurf vs Gemini CLI for SEO/GEO Automation 。
Author: Leo Harrington, Auspia SEO Analytics Translator for 500+ Executive Reports。Leo 撰寫如何把 search 與 AI visibility data 轉成團隊可執行 decisions。