agentleFS
AminForouAminForou/mcp-gsc/CLAUDE.md

mcp-gsc

CLAUDE.md1.8k starsChanged 8 months agoMITView on GitHub

Context for AI coding assistants (Claude, Cursor, Copilot, etc.) working in this repo. MCP server that connects Google Search Console to AI assistants. Single file: gsc_server.py (~1,670 lines). Built with FastMCP — no custom framework. Two modes, tried in order: Set GSC_SKIP_OAUTH=true to force service account mode and skip OAuth entirely. No credentials needed — all Google API calls are mocked with unittest.mock.

Trending

Quiet since September.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 2 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the AminForou/mcp-gsc repository that our weekly crawl found: only 5 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

The file

We split this CLAUDE.md into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    OAuth (default): Place client_secrets.json in the repo root.

    line 21
  2. Very specific:

    Add an @mcp.tool() decorated async function anywhere in gsc_server.py

    line 41
  3. Very specific:

    Use get_gsc_service() for auth — it handles OAuth and service account automatically

    line 42
  4. Very specific:

    No credentials needed — all Google API calls are mocked with unittest.mock.

    line 66

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Context for AI coding assistants (Claude, Cursor, Copilot, etc.) working in this repo.

What this is

MCP server that connects Google Search Console to AI assistants. Single file: gsc_server.py (~1,670 lines). Built with FastMCP — no custom framework.

Running locally

uv sync
uv run python gsc_server.py

Auth

Two modes, tried in order:

  1. OAuth (default): Place client_secrets.json in the repo root. On first run, a browser window opens for Google login. Token saved to token.json (gitignored), auto-refreshes when expired.
  2. Service account: Set GSC_CREDENTIALS_PATH to the path of your service account JSON key file.

Set GSC_SKIP_OAUTH=true to force service account mode and skip OAuth entirely.

Key environment variables

VariableDefaultDescription
MCP_TRANSPORTstdioSet to sse for remote/Docker/network use
MCP_HOST127.0.0.1Host to bind when MCP_TRANSPORT=sse
MCP_PORT3001Port to bind when MCP_TRANSPORT=sse
GSC_DATA_STATEallall = matches GSC dashboard; final = confirmed data only (2–3 day lag)
GSC_ALLOW_DESTRUCTIVEfalseSet true to enable add_site, delete_site, delete_sitemap
GSC_CREDENTIALS_PATH—Path to service account JSON key file
GSC_OAUTH_CLIENT_SECRETS_FILEclient_secrets.jsonPath to OAuth client secrets file
GSC_SKIP_OAUTHfalseSet true to skip OAuth and use service account only

Adding a new tool

  1. Add an @mcp.tool() decorated async function anywhere in gsc_server.py
  2. Use get_gsc_service() for auth — it handles OAuth and service account automatically
  3. Return json.dumps(result) not formatted text strings (LLMs work better with structured data)
  4. Handle HttpError and return a plain string error message on failure
@mcp.tool()
async def my_new_tool(site_url: str) -> str:
    """One-line description shown to the AI as the tool's purpose."""
    try:
        service = get_gsc_service()
        result = service.someApi().someMethod(siteUrl=site_url).execute()
        return json.dumps(result)
    except Exception as e:
        if "404" in str(e):
            return _site_not_found_error(site_url)
        return f"Error: {str(e)}"

Running tests

pytest test_gsc_server.py -v

No credentials needed — all Google API calls are mocked with unittest.mock.

Docker

docker build -t mcp-gsc .
docker run -e MCP_TRANSPORT=sse -e MCP_PORT=3001 \
  -v /path/to/client_secrets.json:/app/client_secrets.json \
  -p 3001:3001 mcp-gsc

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.