872e620342
This reverts commit 6d9c6fd2b1.
29 lines
770 B
TypeScript
29 lines
770 B
TypeScript
/**
|
|
* Simple MCP configuration helper for adding our minimal GitHub comment server
|
|
*/
|
|
const actionPath = process.env.GITHUB_ACTION_PATH || process.cwd();
|
|
|
|
export function createMcpConfig(githubInstallationToken: string) {
|
|
const githubRepository = process.env.GITHUB_REPOSITORY;
|
|
if (!githubRepository) {
|
|
throw new Error('GITHUB_REPOSITORY environment variable is required for MCP GitHub integration');
|
|
}
|
|
|
|
return JSON.stringify(
|
|
{
|
|
mcpServers: {
|
|
minimal_github_comment: {
|
|
command: "node",
|
|
args: [`${actionPath}/mcp/server.ts`],
|
|
env: {
|
|
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
|
|
GITHUB_REPOSITORY: githubRepository,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
null,
|
|
2
|
|
);
|
|
}
|