Skip to main content
Glama
delaren47

gsc-ga4-mcp

by delaren47

gsc-ga4-mcp

Claude Code에 Google Search Console과 GA4에 대한 읽기 전용 액세스를 부여하는 작은 로컬 MCP 서버로, 두 데이터셋을 교차 조회하는 몇 가지 도구도 함께 제공합니다.

문제

AI 어시스턴트에서 SEO 작업을 한다는 것은 보통 Search Console에서 CSV를 내보내고, GA4에서 CSV를 또 내보내고, 두 파일을 채팅에 붙여넣고, 새 수치가 필요할 때마다 그 과정을 반복하는 것을 뜻합니다. 그리고 두 데이터셋은 절대 저절로 맞지 않습니다. Search Console은 노출수, 클릭수, CTR을 알고 있고, GA4는 세션, 참여도, 전환을 알고 있습니다. "트래픽은 받지만 그걸 낭비하는 페이지"를 알아내려면 URL 기준으로 두 데이터셋을 수동 조인해야 합니다.

Google은 Analytics용 공식 MCP 서버를 제공하지만, Search Console은 다루지 않습니다. 커뮤니티에 Search Console 서버도 있지만, 데이터가 클라이언트 소유라면 남의 서버를 신뢰하기보다 처음부터 끝까지 직접 살펴볼 수 있는 작은 래퍼를 실행하는 것이 낫습니다.

이 서버는 읽기 전용 범위만으로 Google 공식 API를 사용자 자신의 머신에서 직접 호출합니다.

Related MCP server: Google Search Console MCP Server

하는 일

stdio를 통해 제공되는 20개의 MCP 도구입니다.

Search Console

도구

용도

gsc_list_sites

현재 자격 증명에 보이는 사이트

gsc_search_analytics

직접 dimension과 filter를 지정한 원시 searchAnalytics.query

gsc_top_queries

특정 날짜 범위의 상위 검색어

gsc_top_pages

특정 날짜 범위의 상위 페이지

gsc_query_page_matrix

검색어 × 페이지별 분석

gsc_url_inspection

단일 URL의 색인 상태

GA4

도구

설명

ga4_list_properties

계정 및 속성 요약

ga4_run_report

직접 dimension과 metrics를 지정한 raw runReport

ga4_top_pages

세션/조회수 기준 페이지

ga4_traffic_sources

소스/미디엄별 세션

ga4_landing_pages

참여 지표를 포함한 랜딩 페이지

ga4_events

이벤트 횟수

ga4_realtime

최근 30분간 활동

결합 분석

도구

설명

seo_opportunity_report

두 API를 한 번 살펴 보고, 빠른 성과(quick wins)와 재작성(rewrites) 항목으로 그룹화

compare_gsc_ga4_pages

URL 경로로 GSC 페이지를 GA4 페이지와 조인

find_high_impression_low_ctr_pages

순위는 높지만 클릭을 얻지 못하는 페이지

find_pages_with_clicks_but_low_engagement

클릭은 받지만 방문자를 붙잡지 못하는 페이지

content_refresh_candidates

성과가 하락한 페이지

구성

project_mappingsproject_lookup은 프로젝트나 클라이언트 이름을 해당 GSC 속성 및 GA4 속성과 매핑하는 로컬 파일을 읽습니다. 따라서 properties/123456789을 기억하는 대신 "example.com에 대해 GSC와 GA4를 교차 조회해 줘"라고 말할 수 있습니다.

기술 스택

Node.js + TypeScript가 기본입니다. 서버에는 @modelcontextprotocol/sdk, 인증에는 google-auth-library, 도구 스키마에는 zod를 사용합니다. 별도 데이터베이스도, 호스팅 백엔드도, 텔레메트리도 없습니다 — 프로세스는 로컬에서 실행되며 Claude Code가 stdio로 파일을 실행합니다.

범위는 읽기 전용이며, 이것이 권한의 전부입니다:

  • https://www.googleapis.com/auth/webmasters.readonly

  • https://www.googleapis.com/auth/analytics.readonly

자격 증명은 저장소 바깥, 기본적으로 ~/.config/gsc-ga4-mcp/에 있습니다.

설정

1.설치

git clone https://github.com/YOUR_USER/gsc-ga4-mcp.git
cd gsc-ga4-mcp
npm install
npm run build
mkdir -p ~/.config/gsc-ga4-mcp

2. API 지원하기

Google Cloud Console에서 프로젝트를 만들거나 선택한 뒤, 다음 API를 사용하도록 설정합니다:

  • Google Search Console API

  • Google Analytics Data API

  • Google Analytics Admin API

3. OAuth 자격 증명 만들기

APIs & Services → OAuth consent screen에서 동의 화면을 구성합니다. 관리하는 속성이 하나의 Google Workspace에 몰려 있지 않다면 External(외부)을 사용하고, 앱이 테스트 중일 때 자신의 이메일을 테스트 사용자로 추가합니다.

APIs & Services → Credentials에서 OAuth Client ID를 Desktop app 유형으로 생성하고, JSON을 다운로드한 후 ~/.config/gsc-ga4-mcp/oauth-client.json에 저장합니다.

권한을 계정 단위로 분리하고 싶은 클라이언트 작업이라면 대신 서비스 계정을 사용하고, 각 GSC와 GA4 속성에 그 이메일을 읽기 권한으로 추가합니다. 그리고 GOOGLE_AUTH_MODE=service_account를 설정하고 GOOGLE_SERVICE_ACCOUNT_KEY_FILE에 열쇠 파일 경로를 지정합니다.

4. 구성

cp .env.example .env
cp projects.example.json ~/.config/gsc-ga4-mcp/projects.json

.env의 경로는 절대 경로여야 하며 ~는 확장되지 않습니다.

GOOGLE_AUTH_MODE=oauth
GOOGLE_OAUTH_CREDENTIALS_FILE=/Users/YOUR_USER/.config/gsc-ga4-mcp/oauth-client.json
GOOGLE_TOKEN_PATH=/Users/YOUR_USER/.config/gsc-ga4-mcp/token.json
GOOGLE_OAUTH_REDIRECT_URI=http://127.0.0.1:3000/oauth2callback
PROJECTS_CONFIG=/Users/YOUR_USER/.config/gsc-ga4-mcp/projects.json
MCP_DEFAULT_GSC_SITE=sc-domain:example.com
MCP_DEFAULT_GA4_PROPERTY=properties/123456789
MAX_ROWS=25000

프로젝트 매핑(projects.json):

{
  "projects": [
    {
      "name": "My Site",
      "client": "Internal",
      "domain": "example.com",
      "gscSiteUrl": "sc-domain:example.com",
      "ga4Property": "properties/123456789",
      "notes": "Replace with the real GA4 property ID."
    }
  ]
}

5. 인증

npm run auth

스크립트는 127.0.0.1:3000에 루프백 리스너를 띄우고 Google URL 하나를 출력합니다. 그 URL을 열고 읽기 전용 범위를 승인하면 토큰이 GOOGLE_TOKEN_PATH에 기록됩니다.

6. Claude Code에 등록하기

claude mcp add google-seo -- node /ABSOLUTE/PATH/TO/gsc-ga4-mcp/dist/index.js
claude mcp list

또는 도구를 사용할 프로젝트에 .mcp.json을 커밋할 수도 있습니다 (참고: .mcp.example.json):

{
  "mcpServers": {
    "google-seo": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/gsc-ga4-mcp/dist/index.js"],
      "env": {
        "GOOGLE_AUTH_MODE": "oauth",
        "GOOGLE_OAUTH_CREDENTIALS_FILE": "/Users/YOUR_USER/.config/gsc-ga4-mcp/oauth-client.json",
        "GOOGLE_TOKEN_PATH": "/Users/YOUR_USER/.config/gsc-ga4-mcp/token.json",
        "PROJECTS_CONFIG": "/Users/YOUR_USER/.config/gsc-ga4-mcp/projects.json",
        "MCP_DEFAULT_GSC_SITE": "sc-domain:example.com",
        "MCP_DEFAULT_GA4_PROPERTY": "properties/123456789"
      }
    }
  }
}

경로와 기본 속성 기본값을 저장소에 보관하고 싶지 않다면 CLI 등록을 사용하세요.

Claude Code 사용 방법

간단한 언어로 요청하면 Claude가 필요한 도구를 선택합니다.

Use gsc_list_sites and ga4_list_properties. Give me a table of the GSC sites
and GA4 properties I can reach.
Analyse organic traffic for sc-domain:example.com over the last 90 days using
gsc_top_queries and gsc_top_pages.
Cross GSC and GA4 for example.com over the last 90 days. Find pages with high
impressions and low CTR, and rank the opportunities by likely impact.
Run seo_opportunity_report and group the output into quick wins, pages that
need a rewrite, and pages that miss search intent.
Inspect https://www.example.com/page/ with gsc_url_inspection and tell me
whether Google has it indexed.

운영 정보

  • .env, token.json, projects.json 및 서비스 계정 키는 버전 관리에서 제외하세요. 함께 제공된 .gitignore에 이미 포함되어 있습니다.

  • 클라이언트 분석 데이터는 기밀입니다. 클라이언트가 승인하지 않은 도구에 전체 출력을 붙여넣지 마세요.

  • 고객과의 계약이 끝나면 토큰 또는 서비스 계정을 폐기하세요.

  • MAX_ROWS는 응답 크기를 제한합니다. 응답이 다루기 부담스러우면 값을 낮추세요.

문제 해결

  • Claude Code가 도구를 인식하지 못하는 경우. claude mcp list를 실행한 뒤 Claude Code에서 /mcp를 실행해 보세요.

  • OAuth 토큰 오류. npm run auth를 다시 실행하고 GOOGLE_TOKEN_PATH가 절대 경로인지 확인하세요.

  • access_denied. 앱이 테스트 중이면 OAuth 동의 화면에 자신의 이메일을 테스트 사용자로 추가하세요.

  • GSC에서 도메인이 안 보이는 경우. 해당 정확한 도메인의 속성에 접근할 수 있어야 합니다. sc-domain:example.comhttps://www.example.com/은 서로 다른 속성입니다.

  • GA4 속성이 안 보이는 경우. 사용자나 서비스 계정에 계정 또는 속성에 대한 최소한 뷰어(Viewer) 권한이 필요합니다.

  • gsc_url_inspection 실패. inspectionUrlsiteUrl 안에 있어야 하며, URL-prefix 속성은 /로 끝나야 합니다.

  • GA4 측정항목 오류. GA4의 공식 dimension 및 metric 이름을 사용하세요. runReport는 그 밖의 이름은 거부합니다.

Reference

라이센스

MIT 리미. LICENSE를 참조하세요.

Install Server
A
license - permissive license
C
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    B
    maintenance
    Connects Google Search Console with Claude AI to enable SEO professionals to analyze their SEO data through natural language conversations, providing access to property information, search analytics, URL inspection, and sitemap management.
    1,349
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Connects Google Search Console with Claude AI to analyze SEO data through natural language, enabling search analytics reporting, URL inspection, indexing status checks, sitemap management, and data visualization for SEO professionals.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude to access Google Search Console data including search performance, URL indexation, sitemaps, and built-in SEO analysis tools such as trending queries, cannibalization detection, and traffic drop diagnostics.
    123
    11
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables querying Google Search Console data, including search analytics, indexing status, and sitemap management, through natural language conversations with Claude.
    123
    5
    MIT

View all related MCP servers

Related MCP Connectors

  • Live SEO workflow tools for Claude Code, Codex, and AI agents.

  • SEO research, audits, backlinks, GSC, and content workflow tools for AI agents.

  • Turn Search Console data into SEO actions, content, publishing, indexing, and AI insights.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/delaren47/gsc-ga4-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server