返回市场
应用 seo 人工智能

应用 seo 人工智能

作者:ccnn250936 星标更新:2025-08-25

项目介绍

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凭证:

# 服务器配置
PORT=3000
NODE_ENV=development

# Google Ads 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

4. 获取Google Ads API刷新令牌

运行以下命令获取刷新令牌:

npm run get-token

这将打开您的浏览器并引导您完成OAuth2认证过程。刷新令牌将自动保存到您的.env文件中。

5. 启动服务器

开发模式:

npm run dev

生产模式:

npm start

服务器将在.env文件中指定的端口上启动(默认:3000)。

API文档

当服务器运行时,可以在/api-docs找到API文档:

http://localhost:3000/api-docs

MCP集成

此项目包括MCP(模型上下文协议)集成,允许AI助手使用API。MCP配置位于mcp.json文件中。

要与Smithery一起使用:

  1. 访问Smithery
  2. 创建一个新的MCP服务器
  3. 选择app-seo-ai仓库
  4. 配置服务器设置
  5. 部署服务器

可用的MCP工具

  • 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

// 示例请求以分析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