Feature Request: Add get_user tool to fetch a user profile by username

Offen Anfängerfreundlich
#1,970 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
72/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Ruhig
Tech-Stack
github, go
Bereich
api, backend

Rechercherichtung

Beginnen Sie in pkg/github/context_tools.go, indem Sie get_me mit dem bestehenden client.Users.Get-Aufruf vergleichen. Fügen Sie die erforderliche username-Eingabe hinzu, während die MinimalUser + UserDetails-Antwort und die im Issue beschriebenen users-Tool-Metadaten erhalten bleiben. Als erledigt gilt die Änderung, wenn das Tool GET /users/{username} über den authentifizierten Client aufruft und das angeforderte Profil über GitHub-Umgebungen hinweg bereitstellt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Problem

There is no tool to look up a specific GitHub user's profile by username. get_me only returns the authenticated user. search_users uses the Search API which returns a minimal user object (login, id, avatar) without profile details like name, email, bio, company, etc.

Use case

I'm building a skill that adds Co-authored-by trailers to git commits. To properly attribute a collaborator, I need their display name and numeric ID from their GitHub profile to construct the trailer:

Co-authored-by: Jane Smith <12345+janesmith@users.noreply.github.com>

Currently this requires falling back to gh api users/{username}, but I want the skill to work in Claude Desktop too where the gh CLI may not be available — only MCP tools. A get_user tool would close this gap.

Workarounds and their limits
  • gh api users/{username} — works but requires the gh CLI, which isn't available in Claude Desktop
  • WebFetch to api.github.com/users/{username} — works for public GitHub.com users without auth, but doesn't cover enterprise managed users (EMU) or GHES, which require authentication

A proper get_user tool using the server's authenticated client would work across all environments including enterprise.

Proposed solution

A get_user tool that accepts a required username parameter and calls GET /users/{username}. Returns MinimalUser with Details — the same response shape as get_me.

The Go client already supports this: client.Users.Get(ctx, username) is the same call get_me uses, just with a non-empty username string.

Implementation notes

Nearly identical to get_me in pkg/github/context_tools.go:

  • Add a username input parameter (required string)
  • Pass it to client.Users.Get(ctx, username) instead of ""
  • Return the same MinimalUser + UserDetails response
  • Toolset: users
  • Scope: read:user
  • ReadOnly: true

Edited to add - this issue was co-authored by Claude and reviewed by me.

Vorherrschende Sprache
Go
Sterne
33.1k
Forks
5k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
27

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus github/github-mcp-server

Alle Issues in github/github-mcp-server

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.