这是一款用于 SEO 自动化和人工智能优化的应用,它集成了 Google Ads 关键词计划工具,能有效助力 SEO 工作的开展,提升优化效率与效果。
此应用可借助 Google 广告 API 开展关键词研究、搜索结果页面(SERP)分析、竞争对手分析等工作,并给出 SEO 优化建议,还集成了 MCP(模型上下文协议)供 AI 助手使用。
git clone https://github.com/ccnn2509/app-seo-ai.git
cd app-seo-ai
npm install
复制示例环境文件:
cp .env.example .env
编辑 .env
文件并填写您的 Google 广告 API 凭证:
# 服务器配置
PORT=3000
NODE_ENV=development
# Google 广告 API 配置
GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token
GOOGLE_ADS_CLIENT_ID=your_client_id
GOOGLE_ADS_CLIENT_SECRET=your_client_secret
GOOGLE_ADS_REFRESH_TOKEN=your_refresh_token
GOOGLE_ADS_LOGIN_CUSTOMER_ID=your_customer_id_without_dashes
# SERP API 配置(可选)
SERP_API_KEY=your_serp_api_key
运行以下命令以获取刷新令牌:
npm run get-token
这将打开您的浏览器并指导您完成 OAuth2 身份验证流程。刷新令牌将自动保存到 .env
文件中。
开发环境中:
npm run dev
生产环境中:
npm start
服务器将在您 .env
文件中指定的端口上运行(默认:3000)。
API 文档在以下地址提供:/api-docs
,当服务器运行时:
http://localhost:3000/api-docs
此项目包含 MCP(模型上下文协议)集成,允许 AI 助手使用 API。MCP 配置位于 mcp.json
文件中。
要与 Smithery 一起使用:
app-seo-ai
仓库research_keywords
- 研究与给定主题或种子关键词相关的关键词analyze_serp
- 分析指定查询的搜索结果页面 (SERP)analyze_competitors
- 分析指定关键词或域名的竞争对手_health
- 健康检查端点// 示例请求以研究关键词
fetch('http://localhost:3000/api/keywords/ideas?keyword=seo%20tools&language=en')
.then(response => response.json())
.then(data => console.log(data));
// 示例请求以分析 SERP
fetch('http://localhost:3000/api/serp/analyze?query=best%20seo%20tools&location=United%20States')
.then(response => response.json())
.then(data => console.log(data));
// 示例请求以分析竞争对手
fetch('http://localhost:3000/api/competitors/analyze?domain=example.com')
.then(response => response.json())
.then(data => console.log(data));
本项目采用 MIT 许可证。