SEO智助
启用AI助手执行SEO自动化任务的MCP服务器,包括通过Google Ads API集成进行关键词研究、SERP分析和竞争者分析。
服务介绍
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