github_commit_emails
Extract email addresses from GitHub user commit history to identify contact information for security research and OSINT investigations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | GitHub username |
Implementation Reference
- src/tools/github.ts:54-76 (handler)The implementation of getCommitEmails which fetches public events for a user and extracts email addresses from commits.
async getCommitEmails(username: string): Promise<string[]> { try { const events = await this.fetch<any[]>(`users/${username}/events/public`, { method: "GET", headers: this.getHeaders(), }); const emails = new Set<string>(); events.forEach((event: any) => { if (event.type === "PushEvent" && event.payload?.commits) { event.payload.commits.forEach((commit: any) => { if (commit.author?.email && !commit.author.email.includes("noreply")) { emails.add(commit.author.email); } }); } }); return Array.from(emails); } catch (error) { if (error instanceof McpError) throw error; throw new McpError(ErrorCode.InternalError, `GitHub Commit Emails error: ${(error as Error).message}`); } - src/index.ts:375-384 (registration)The MCP tool registration for 'github_commit_emails' that calls the ghClient.getCommitEmails method.
server.tool( "github_commit_emails", { username: z.string().describe("GitHub username") }, async ({ username }) => { const result = await ghClient.getCommitEmails(username); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } );