2
2
3
3
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js" ;
4
4
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js" ;
5
- import path from "path" ;
6
- // import { z } from "zod";
7
- // import fs from "fs";
8
5
9
6
// Create the MCP server
10
7
const server = new McpServer ( {
@@ -60,7 +57,7 @@ server.tool(
60
57
) ;
61
58
62
59
// Return all HTTP errors (4xx/5xx)
63
- server . tool ( "getNetworkErrors " , "Check our network ERROR logs" , async ( ) => {
60
+ server . tool ( "getNetworkErrorLogs " , "Check our network ERROR logs" , async ( ) => {
64
61
const response = await fetch ( `http://127.0.0.1:${ PORT } /network-errors` ) ;
65
62
const json = await response . json ( ) ;
66
63
return {
@@ -74,6 +71,7 @@ server.tool("getNetworkErrors", "Check our network ERROR logs", async () => {
74
71
} ) ;
75
72
76
73
// // Return all XHR/fetch requests
74
+ // // DEPRECATED: Use getNetworkSuccessLogs and getNetworkErrorLogs instead
77
75
// server.tool("getNetworkSuccess", "Check our network SUCCESS logs", async () => {
78
76
// const response = await fetch(`http://127.0.0.1:${PORT}/all-xhr`);
79
77
// const json = await response.json();
@@ -88,8 +86,8 @@ server.tool("getNetworkErrors", "Check our network ERROR logs", async () => {
88
86
// });
89
87
90
88
// Return all XHR/fetch requests
91
- server . tool ( "getNetworkLogs " , "Check ALL our network logs" , async ( ) => {
92
- const response = await fetch ( `http://127.0.0.1:${ PORT } /all-xhr ` ) ;
89
+ server . tool ( "getNetworkSuccessLogs " , "Check ALL our network logs" , async ( ) => {
90
+ const response = await fetch ( `http://127.0.0.1:${ PORT } /network-success ` ) ;
93
91
const json = await response . json ( ) ;
94
92
return {
95
93
content : [
@@ -117,6 +115,7 @@ server.tool(
117
115
const result = await response . json ( ) ;
118
116
119
117
if ( response . ok ) {
118
+ // Removed path due to bug... will change later anyways
120
119
// const message = `Screenshot saved to: ${
121
120
// result.path
122
121
// }\nFilename: ${path.basename(result.path)}`;
0 commit comments