set-github-token
Configure a GitHub Personal Access Token for secure authentication to map and analyze GitHub repositories using the GitHub Mapper MCP Server.
Instructions
Set the GitHub Personal Access Token for authentication
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"token": "<token>"
},
"name": "set-github-token"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | GitHub Personal Access Token |
Implementation Reference
- src/index.ts:64-76 (handler)The handler logic for the 'set-github-token' tool. It extracts the token from arguments, sets the global githubToken, initializes the Octokit client with authentication, and returns a success message.
if (name === "set-github-token") { const { token } = args as { token: string }; githubToken = token; octokit = new Octokit({ auth: githubToken }); return { content: [ { type: "text", text: "GitHub Personal Access Token has been set successfully.", }, ], }; } else if (name === "map-github-repo") { - src/index.ts:28-41 (registration)Registration of the 'set-github-token' tool in the ListToolsRequestHandler, providing name, description, and input schema.
{ name: "set-github-token", description: "Set the GitHub Personal Access Token for authentication", inputSchema: { type: "object", properties: { token: { type: "string", description: "GitHub Personal Access Token", }, }, required: ["token"], }, }, - src/index.ts:31-40 (schema)Input schema definition for the 'set-github-token' tool, specifying the required 'token' string property.
inputSchema: { type: "object", properties: { token: { type: "string", description: "GitHub Personal Access Token", }, }, required: ["token"], },