improve mcp context initialization

This commit is contained in:
David Blass
2025-12-02 17:59:13 -05:00
parent 32f850d6ec
commit 23c18154ed
6 changed files with 54 additions and 111 deletions
+6 -2
View File
@@ -20,7 +20,7 @@ import { PullRequestInfoTool } from "./prInfo.ts";
import { ReviewTool } from "./review.ts";
import { GetReviewCommentsTool, ListPullRequestReviewsTool } from "./reviewComments.ts";
import { SelectModeTool } from "./selectMode.ts";
import { addTools } from "./shared.ts";
import { addTools, initMcpContext, type McpInitContext } from "./shared.ts";
/**
* Find an available port starting from the given port
@@ -54,7 +54,11 @@ async function findAvailablePort(startPort: number): Promise<number> {
/**
* Start the MCP HTTP server and return the URL and close function
*/
export async function startMcpHttpServer(): Promise<{ url: string; close: () => Promise<void> }> {
export async function startMcpHttpServer(
state: McpInitContext
): Promise<{ url: string; close: () => Promise<void> }> {
initMcpContext(state);
const server = new FastMCP({
name: ghPullfrogMcpName,
version: "0.0.1",