Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9567d84442 | ||
|
|
d79564db5e | ||
|
|
a7a0e87fd8 | ||
|
|
7050b8de75 | ||
|
|
2fc3ddee16 |
+18
-2
@@ -18,8 +18,24 @@ inputs:
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "node20"
|
||||
main: "entry.cjs"
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
- name: Setup Node.js 24
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
cache: "pnpm"
|
||||
cache-dependency-path: ${{ github.action_path }}/pnpm-lock.yaml
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
shell: bash
|
||||
working-directory: ${{ github.action_path }}
|
||||
- name: Run agent
|
||||
run: node entry.ts
|
||||
shell: bash
|
||||
working-directory: ${{ github.action_path }}
|
||||
|
||||
branding:
|
||||
icon: "code"
|
||||
|
||||
@@ -26164,7 +26164,7 @@ async function main(params) {
|
||||
// package.json
|
||||
var package_default = {
|
||||
name: "@pullfrog/action",
|
||||
version: "0.0.30",
|
||||
version: "0.0.35",
|
||||
type: "module",
|
||||
files: [
|
||||
"index.js",
|
||||
|
||||
+5
-69
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
import { writeFileSync } from "node:fs";
|
||||
// Minimal GitHub Issue Comment MCP Server
|
||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
||||
@@ -8,34 +7,10 @@ import { type } from "arktype";
|
||||
import { z } from "zod";
|
||||
import { resolveRepoContext } from "../utils/repo-context.ts";
|
||||
|
||||
// Simple error logging to file
|
||||
function logError(message: string, error?: any) {
|
||||
const timestamp = new Date().toISOString();
|
||||
const errorText = error ? `\nError: ${error.message}\nStack: ${error.stack}` : "";
|
||||
const logEntry = `[${timestamp}] ${message}${errorText}\n`;
|
||||
|
||||
try {
|
||||
writeFileSync("/tmp/mcp-error.log", logEntry, { flag: "a" });
|
||||
console.error(logEntry);
|
||||
} catch (writeError) {
|
||||
console.error(`Failed to write error log: ${writeError}`);
|
||||
console.error(logEntry);
|
||||
}
|
||||
}
|
||||
|
||||
let server: McpServer;
|
||||
|
||||
try {
|
||||
logError("Creating MCP server...");
|
||||
server = new McpServer({
|
||||
const server = new McpServer({
|
||||
name: "Minimal GitHub Issue Comment Server",
|
||||
version: "0.0.1",
|
||||
});
|
||||
logError("MCP server created successfully");
|
||||
} catch (error) {
|
||||
logError("Failed to create MCP server", error);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
// Define the schema for creating issue comments
|
||||
const Comment = type({
|
||||
@@ -43,10 +18,7 @@ const Comment = type({
|
||||
body: type.string.describe("the comment body content"),
|
||||
});
|
||||
|
||||
try {
|
||||
logError("Registering create_issue_comment tool...");
|
||||
|
||||
server.tool(
|
||||
server.tool(
|
||||
"create_issue_comment",
|
||||
"Create a comment on a GitHub issue",
|
||||
{
|
||||
@@ -95,7 +67,6 @@ try {
|
||||
};
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
logError("Tool execution failed", error);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
@@ -108,49 +79,14 @@ try {
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
logError("Tool registered successfully");
|
||||
} catch (error) {
|
||||
logError("Failed to register tool", error);
|
||||
process.exit(1);
|
||||
}
|
||||
);
|
||||
|
||||
async function runServer() {
|
||||
try {
|
||||
logError("Starting MCP server...");
|
||||
|
||||
const transport = new StdioServerTransport();
|
||||
logError("Transport created, attempting connection...");
|
||||
|
||||
await server.connect(transport);
|
||||
logError("MCP server connected successfully");
|
||||
|
||||
process.on("exit", () => {
|
||||
logError("Process exiting, closing server...");
|
||||
server.close();
|
||||
});
|
||||
|
||||
process.on("SIGTERM", () => {
|
||||
logError("SIGTERM received, closing server...");
|
||||
server.close();
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
process.on("SIGINT", () => {
|
||||
logError("SIGINT received, closing server...");
|
||||
server.close();
|
||||
process.exit(0);
|
||||
});
|
||||
} catch (error) {
|
||||
logError("Server startup failed", error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
logError("Initializing MCP server process...");
|
||||
|
||||
runServer().catch((error) => {
|
||||
logError("Unhandled server error", error);
|
||||
process.exit(1);
|
||||
});
|
||||
await runServer();
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pullfrog/action",
|
||||
"version": "0.0.30",
|
||||
"version": "0.0.35",
|
||||
"type": "module",
|
||||
"files": [
|
||||
"index.js",
|
||||
|
||||
Reference in New Issue
Block a user