logging
This commit is contained in:
+1
-4
@@ -11,10 +11,7 @@ import { IssueTool } from "./issue.ts";
|
|||||||
import { PullRequestTool } from "./pr.ts";
|
import { PullRequestTool } from "./pr.ts";
|
||||||
import { PullRequestInfoTool } from "./prInfo.ts";
|
import { PullRequestInfoTool } from "./prInfo.ts";
|
||||||
import { ReviewTool } from "./review.ts";
|
import { ReviewTool } from "./review.ts";
|
||||||
import { addTools, initLogFile } from "./shared.ts";
|
import { addTools } from "./shared.ts";
|
||||||
|
|
||||||
// Initialize log file when server starts
|
|
||||||
initLogFile();
|
|
||||||
|
|
||||||
const server = new FastMCP({
|
const server = new FastMCP({
|
||||||
name: "gh-pullfrog",
|
name: "gh-pullfrog",
|
||||||
|
|||||||
+1
-15
@@ -1,6 +1,6 @@
|
|||||||
import { cached } from "@ark/util";
|
|
||||||
import { appendFileSync } from "node:fs";
|
import { appendFileSync } from "node:fs";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { cached } from "@ark/util";
|
||||||
import { Octokit } from "@octokit/rest";
|
import { Octokit } from "@octokit/rest";
|
||||||
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
||||||
import type { FastMCP, Tool } from "fastmcp";
|
import type { FastMCP, Tool } from "fastmcp";
|
||||||
@@ -39,20 +39,6 @@ function getLogPath(): string {
|
|||||||
return join(process.cwd(), "log.txt");
|
return join(process.cwd(), "log.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the log file with server startup information
|
|
||||||
*/
|
|
||||||
export function initLogFile(): void {
|
|
||||||
try {
|
|
||||||
const logPath = getLogPath();
|
|
||||||
const timestamp = new Date().toISOString();
|
|
||||||
const logEntry = `[${timestamp}] MCP Server Started: gh-pullfrog\n`;
|
|
||||||
appendFileSync(logPath, logEntry, "utf-8");
|
|
||||||
} catch {
|
|
||||||
// Silently fail if logging fails to avoid breaking the tool
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log MCP tool call information to log.txt
|
* Log MCP tool call information to log.txt
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,11 +29,6 @@ export async function run(
|
|||||||
agent.inputKeys.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]])
|
agent.inputKeys.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]])
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
// agent: "cursor",
|
|
||||||
// ...flatMorph(agents, (_, agent) => [
|
|
||||||
// agent.inputKey,
|
|
||||||
// process.env[agent.inputKey.toUpperCase()],
|
|
||||||
// ]),
|
|
||||||
|
|
||||||
const result = await main(inputs);
|
const result = await main(inputs);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user