Skip to content

feat: add OAuth client flow with --auth flag - #131

Open
ishii-masaki-646 wants to merge 2 commits into
nota:mainfrom
ishii-masaki-646:feature/oauth-client-flow
Open

feat: add OAuth client flow with --auth flag#131
ishii-masaki-646 wants to merge 2 commits into
nota:mainfrom
ishii-masaki-646:feature/oauth-client-flow

Conversation

@ishii-masaki-646

@ishii-masaki-646 ishii-masaki-646 commented Mar 11, 2026

Copy link
Copy Markdown

Summary

  • Gyazo OAuth 認可コードフロー(Authorization Code Grant)をサポート
  • gyazo-mcp-server --auth で GYAZO_CLIENT_ID / GYAZO_CLIENT_SECRET を使ってブラウザ認証し、トークンを ~/.gyazo-mcp/token.json に保存
  • Personal Access Token(GYAZO_ACCESS_TOKEN)との併用可能。優先順位: 環境変数 > 保存済み OAuth トークン
  • Dockerfile からダミーの GYAZO_ACCESS_TOKEN を削除
  • README に OAuth セットアップ手順と Docker ボリュームマウント例を追記

Motivation

Personal Access Token では自分がアップロードした画像しか取得できないが、OAuth クライアントフローを使うことで Gyazo Teams 内で共有された画像にもアクセス可能になる。

Test plan

  • GYAZO_ACCESS_TOKEN のみで従来通り動作することを確認
  • --auth フラグで OAuth フローが正常に完了しトークンが保存されることを確認
  • 保存済み OAuth トークンで MCP サーバーが起動し画像取得できることを確認
  • Docker でボリュームマウント経由でトークンが読めることを確認

🤖 Generated with Claude Code

ishii-masaki-646 and others added 2 commits March 11, 2026 15:31
Add support for Gyazo OAuth authorization code grant flow as an
alternative to setting GYAZO_ACCESS_TOKEN directly. Users can run
`gyazo-mcp-server --auth` with GYAZO_CLIENT_ID and GYAZO_CLIENT_SECRET
to authenticate via browser and store the token at ~/.gyazo-mcp/token.json.

Token priority: GYAZO_ACCESS_TOKEN env var > stored OAuth token.
Remove dummy GYAZO_ACCESS_TOKEN from Dockerfile.
Update README with OAuth setup instructions and Docker volume mount examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Include fixes from nota#129 and nota#130:
- Remove data URI prefix from fetchImageAsBase64 return value
- Make metadata and its fields optional to handle missing API responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ishii-masaki-646

Copy link
Copy Markdown
Author

補足です。Motivation の
Gyazo Teams 内で共有された画像にもアクセス可能になる
という表現は少し不正確でした。

正しくは、Teams に限らず access_policy = "anyone" の他ユーザー画像も取得できる想定です。
意図は「PAT よりも他者共有画像にアクセスできる範囲が広がる」という点でした。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant