@@ -2,13 +2,36 @@ package github
2
2
3
3
import (
4
4
"context"
5
+ "time"
5
6
6
7
ghErrors "github.com/github/github-mcp-server/pkg/errors"
7
8
"github.com/github/github-mcp-server/pkg/translations"
8
9
"github.com/mark3labs/mcp-go/mcp"
9
10
"github.com/mark3labs/mcp-go/server"
10
11
)
11
12
13
+ // UserDetails contains additional fields about a GitHub user not already
14
+ // present in MinimalUser. Used by get_me context tool but omitted from search_users.
15
+ type UserDetails struct {
16
+ Name string `json:"name,omitempty"`
17
+ Company string `json:"company,omitempty"`
18
+ Blog string `json:"blog,omitempty"`
19
+ Location string `json:"location,omitempty"`
20
+ Email string `json:"email,omitempty"`
21
+ Hireable bool `json:"hireable,omitempty"`
22
+ Bio string `json:"bio,omitempty"`
23
+ TwitterUsername string `json:"twitter_username,omitempty"`
24
+ PublicRepos int `json:"public_repos"`
25
+ PublicGists int `json:"public_gists"`
26
+ Followers int `json:"followers"`
27
+ Following int `json:"following"`
28
+ CreatedAt time.Time `json:"created_at"`
29
+ UpdatedAt time.Time `json:"updated_at"`
30
+ PrivateGists int `json:"private_gists,omitempty"`
31
+ TotalPrivateRepos int64 `json:"total_private_repos,omitempty"`
32
+ OwnedPrivateRepos int64 `json:"owned_private_repos,omitempty"`
33
+ }
34
+
12
35
// GetMe creates a tool to get details of the authenticated user.
13
36
func GetMe (getClient GetClientFn , t translations.TranslationHelperFunc ) (mcp.Tool , server.ToolHandlerFunc ) {
14
37
tool := mcp .NewTool ("get_me" ,
@@ -44,6 +67,25 @@ func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Too
44
67
ID : user .GetID (),
45
68
ProfileURL : user .GetHTMLURL (),
46
69
AvatarURL : user .GetAvatarURL (),
70
+ Details : & UserDetails {
71
+ Name : user .GetName (),
72
+ Company : user .GetCompany (),
73
+ Blog : user .GetBlog (),
74
+ Location : user .GetLocation (),
75
+ Email : user .GetEmail (),
76
+ Hireable : user .GetHireable (),
77
+ Bio : user .GetBio (),
78
+ TwitterUsername : user .GetTwitterUsername (),
79
+ PublicRepos : user .GetPublicRepos (),
80
+ PublicGists : user .GetPublicGists (),
81
+ Followers : user .GetFollowers (),
82
+ Following : user .GetFollowing (),
83
+ CreatedAt : user .GetCreatedAt ().Time ,
84
+ UpdatedAt : user .GetUpdatedAt ().Time ,
85
+ PrivateGists : user .GetPrivateGists (),
86
+ TotalPrivateRepos : user .GetTotalPrivateRepos (),
87
+ OwnedPrivateRepos : user .GetOwnedPrivateRepos (),
88
+ },
47
89
}
48
90
49
91
return MarshalledTextResult (minimalUser ), nil
0 commit comments