通过与Google Ads API集成,提供包含关键词研究、SERP分析和竞争者分析的SEO自动化工具,并通过MCP使AI助手能够访问这些功能。
marketingsearch
423 查看 · 2026-07-07 更新
简介
通过与Google Ads API集成,提供包含关键词研究、SERP分析和竞争者分析的SEO自动化工具,并通过MCP使AI助手能够访问这些功能。
简介
通过与Google Ads API集成,提供包含关键词研究、SERP分析和竞争者分析的SEO自动化工具,并通过MCP使AI助手能够访问这些功能。
App SEO AI
用于SEO自动化和AI优化的应用程序,集成Google Ads关键字规划师。
功能
- 使用Google Ads API进行关键词研究
- SERP分析
- 竞争对手分析
- SEO建议
- 集成MCP(模型上下文协议)以支持AI助手
前提条件
- Node.js (v14或更高版本)
- npm 或 yarn
- 具有API访问权限的Google Ads账户
- 启用了Google Ads API的Google Cloud Platform项目
设置
1. 克隆仓库
git clone https://github.com/ccnn2509/app-seo-ai.git cd app-seo-ai
2. 安装依赖项
npm install
3. 配置环境变量
复制示例环境文件:
cp .env.example .env
编辑.env文件并填写您的Google Ads API凭证:
# Server Configuration PORT=3000 NODE_ENV=development # Google Ads API Configuration 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 Configuration (optional) SERP_API_KEY=your_serp_api_key
4. 获取Google Ads API刷新令牌
运行以下命令获取刷新令牌:
npm run get-token
这将打开您的浏览器并引导您完成OAuth2认证过程。刷新令牌会自动保存到您的.env文件中。
5. 启动服务器
开发环境:
npm run dev
生产环境:
npm start
服务器将在您的.env文件中指定的端口上启动(默认:3000)。
API文档
当服务器运行时,API文档可在/api-docs处查看:
http://localhost:3000/api-docs
MCP集成
此项目包括MCP(模型上下文协议)集成,允许AI助手使用该API。MCP配置在mcp.json文件中。
要与Smithery一起使用,请执行以下步骤:
- 访问 Smithery
- 创建一个新的MCP服务器
- 选择
app-seo-ai仓库 - 配置服务器设置
- 部署服务器
可用的MCP工具
research_keywords- 根据给定主题或种子关键词研究相关关键词analyze_serp- 分析给定查询的SERP(搜索引擎结果页)analyze_competitors- 分析给定关键词或域名的竞争对手_health- 健康检查端点
示例用法
研究关键词
// Example request to research keywords fetch('http://localhost:3000/api/keywords/ideas?keyword=seo%20tools&language=en') .then(response => response.json()) .then(data => console.log(data));
分析SERP
// Example request to analyze SERP fetch('http://localhost:3000/api/serp/analyze?query=best%20seo%20tools&location=United%20States') .then(response => response.json()) .then(data => console.log(data));
分析竞争对手
// Example request to analyze competitors fetch('http://localhost:3000/api/competitors/analyze?domain=example.com') .then(response => response.json()) .then(data => console.log(data));
许可证
MIT
来源
- 来源:github
- 链接:https://github.com/ccnn2509/app-seo-ai