# Google Search Console 数据服务
## 基本信息
- Slug: `ahonn-mcp-server-gsc`
- Source: modelscope
- Publisher: @ahonn/mcp-server-gsc
- Categories: search / monitoring / marketing
- Hosted: Yes
- License: Unknown
- Source URL: https://www.modelscope.cn/mcp/servers/@ahonn/mcp-server-gsc
## 简介
# 翻译 一个通过模型上下文协议提供访问Google Search Console数据的服务器，允许用户检索和分析具有自定义维度和报告周期的搜索分析数据。
## 安装提示

```bash
npx -y @smithery/cli install mcp-server-gsc --client claude
```

## MCP Server 详情

# Google Search Console MCP 服务器
[![smithery 徽章](https://smithery.ai/badge/mcp-server-gsc)](https://smithery.ai/server/mcp-server-gsc)

这是一个提供访问 Google Search Console 的 Model Context Protocol (MCP) 服务器。

## 功能

- 支持维度的搜索分析数据检索
- 可自定义报告周期的丰富数据分析

## 前提条件

- Node.js 18 或更高版本
- 启用了 Search Console API 的 Google Cloud 项目
- 具有 Search Console 访问权限的服务账号凭证

## 安装

### 通过 Smithery 安装

要通过 [Smithery](https://smithery.ai/server/mcp-server-gsc) 自动为 Claude Desktop 安装 Google Search Console：
```bash
npx -y @smithery/cli install mcp-server-gsc --client claude
```


### 手动安装
```bash
npm install mcp-server-gsc
```


## 身份验证设置

要获取 Google Search Console API 凭证：

1. 访问 [Google Cloud 控制台](https://console.cloud.google.com/)
2. 创建新项目或选择现有项目
3. 启用 API：

- 转到 "API 和服务" > "库"
- 搜索并启用 ["Search Console API"](https://console.cloud.google.com/marketplace/product/google/searchconsole.googleapis.com)

4. 创建凭证：

- 导航至 ["API 和服务" > "凭证"](https://console.cloud.google.com/apis/credentials)
- 点击 "创建凭证" > "服务账号"
- 填写服务账号详细信息
- 以 JSON 格式创建新密钥
- 凭证文件 (.json) 将自动下载

5. 授予权限：

- 打开 Search Console
- 将服务账号邮箱（格式：name@project.iam.gserviceaccount.com）添加为属性管理员

## 使用

### Claude Desktop 配置
```json
{
  "mcpServers": {
    "gsc": {
      "command": "npx",
      "args": ["-y", "mcp-server-gsc"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/credentials.json"
      }
    }
  }
}
```


## 可用工具

### search_analytics

从 Google Search Console 获取具有可定制参数的搜索性能数据：

**必需参数：**

- `siteUrl`：站点 URL（格式：`http://www.example.com/` 或 `sc-domain:example.com`）
- `startDate`：开始日期（YYYY-MM-DD）
- `endDate`：结束日期（YYYY-MM-DD）

**可选参数：**

- `dimensions`：逗号分隔列表（`query,page,country,device,searchAppearance`）
- `type`：搜索类型（`web`, `image`, `video`, `news`）
- `aggregationType`：聚合方法（`auto`, `byNewsShowcasePanel`, `byProperty`, `byPage`）
- `rowLimit`：返回的最大行数（默认值：1000）

示例：
```json
{
  "siteUrl": "https://example.com",
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "dimensions": "query,country",
  "type": "web",
  "rowLimit": 500
}
```


## 许可证

MIT

## 贡献

欢迎贡献！请在提交拉取请求前阅读我们的贡献指南。

