agentleFS
thenavidmthenavidm/google-photos-mcp-cli/AGENTS.md

google-photos-mcp-cli

AGENTS.md1 starsChanged 56 days agoMITView on GitHub

The one document for agents. CLAUDE.md points here. An MCP server for Google Photos. TypeScript, ESM, Node 20+, stdio and streamable HTTP. Published as @thenavidm/google-photos-mcp-cli. Google removed whole-library read access on 31 March 2025. The photoslibrary, photoslibrary.readonly and photoslibrary.sharing scopes no longer exist for third-party apps. Do not add a tool that claims to search or browse the user's library. It cannot work. If you find yourself writing one, what you actually want is the picker flow in src/tools/picker.ts. The…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

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

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write the description for a model that cannot see the code.

    line 58
  2. Very specific:

    Add it to the README tool table and bump the count in three places: package.json description, README.md, SKILL.md.

    line 61
  3. Distinctive:

    Run the real handshake:

    line 68
  4. Distinctive:

    No em dashes. Short paragraphs.

    line 84
  5. Distinctive:

    Never name another project, repo or maintainer as a comparison, in code, docs or commits.

    line 86
  6. Distinctive:

    Every button name and menu path in the README setup section came from Google's live documentation.

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.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
AGENTS.md

Working on this repo

The one document for agents. CLAUDE.md points here.

What this is

An MCP server for Google Photos. TypeScript, ESM, Node 20+, stdio and streamable HTTP. Published as @thenavidm/google-photos-mcp-cli.

The constraint that shapes everything

Google removed whole-library read access on 31 March 2025. The photoslibrary, photoslibrary.readonly and photoslibrary.sharing scopes no longer exist for third-party apps.

Do not add a tool that claims to search or browse the user's library. It cannot work. If you find yourself writing one, what you actually want is the picker flow in src/tools/picker.ts.

The four scopes in src/config.ts are the complete set still available. Adding a removed one breaks consent for everybody, and it fails at the Google end where no amount of reading this code will explain it.

Layout

src/
  index.ts        entry: turns on the compile cache and starts the app
  app.ts          the Slipway app: tools, resources, prompts, settings, login.
                  Slipway serves MCP, the CLI and --http, and owns the write
                  guard, approvals, annotations and the audit log
  guide.ts        server instructions, the capabilities resource, the prompts
  login.ts        the one-time consent flow behind `login` and `auth`
  config.ts       env resolution, the scope list
  doctor.ts       the four checks per account, in the order they fail
  api/
    auth.ts       refresh-token exchange, and the one-time consent flow
    client.ts     both hosts, retries, uploads, byte fetching
    errors.ts     Google's errors turned into something a model can act on
  tools/
    kit.ts        adapts the tools to Slipway, binds the account per call,
                  and turns Google's errors into exit codes
    picker.ts     the picker flow
    albums.ts     albums and membership
    media.ts      reading and describing
    uploads.ts    getting bytes in
    meta.ts       auth_status and raw
  format/items.ts shaping items and albums for a model

Adding a tool

  1. defineTool in the right module. Group by what it reaches, not by endpoint.
  2. Set risk honestly. destructive means it cannot be undone through the API, which here means uploading, and nothing else.
  3. Slipway adds confirm to every destructive tool itself, and a test checks the four uploads are the only ones that ask for approval.
  4. Write the description for a model that cannot see the code. Say what it reaches, what it costs, and what will surprise the caller. Platform constraints belong in the description, not only in the README.
  5. Add it to the README tool table and bump the count in three places: package.json description, README.md, SKILL.md.

Before claiming it works

npm test is not enough. It fakes the network, deliberately.

Run the real handshake:

npm run build
printf '%s\n%s\n%s\n' \
  '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"p","version":"1"}}}' \
  '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
  '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
| node dist/index.js

CI runs the same thing, because a build that compiles says nothing about whether the server starts.

Writing

No em dashes. Short paragraphs. Comments explain why, not what.

Never name another project, repo or maintainer as a comparison, in code, docs or commits. Never put AI attribution in a commit message.

Nothing private goes in this repo: no real credentials, no internal hostnames, no environment values from anywhere else.

Setup docs are facts

Every button name and menu path in the README setup section came from Google's live documentation. Console labels get rewritten often. If you cannot verify a label, describe the goal instead of naming the control: a wrong button name is worse than none, because the reader cannot tell it is wrong until it fails.

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.