proxy_stop_server
Stop the HTTP/HTTPS proxy server to halt automated traffic monitoring and analysis operations.
Instructions
Stop the proxy server
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "proxy_stop_server"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/tool-handlers.js:245-262 (handler)Handler implementation for the 'proxy_stop_server' tool. It checks if the proxy server is running, stops it by calling proxyServer.stop(), and returns an appropriate success or status message.
case 'proxy_stop_server': if (!this.proxyServer.isRunning()) { return { content: [{ type: "text", text: "Proxy server is not running" }] }; } await this.proxyServer.stop(); return { content: [{ type: "text", text: "✅ Proxy server stopped" }] }; - Schema definition for the proxy_stop_server tool, specifying its name, description, and empty input schema (no parameters required).
proxy_stop_server: { name: "proxy_stop_server", description: "Stop the proxy server", inputSchema: { type: "object", properties: {} } }, - index.js:65-73 (registration)MCP server registration for listing all tools, including proxy_stop_server, using the TOOLS object from tool-definitions.js.
// List available tools this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(TOOLS).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) }; - index.js:77-98 (registration)MCP server registration for handling tool calls, dispatching to ToolHandlers.handleTool which routes to the specific proxy_stop_server handler.
this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await this.toolHandlers.handleTool(name, args || {}); if (result.isError) { throw new McpError( ErrorCode.InternalError, result.error ); } return result; } catch (error) { console.error(`Tool error [${name}]:`, error.message); throw new McpError( ErrorCode.InternalError, `Tool execution failed: ${error.message}` ); } - Core implementation of the proxy server stop method (ProxyServerWithSSL.stop()), called by the tool handler to gracefully close the HTTP server.
async stop() { if (!this.running || !this.server) { return; } return new Promise((resolve) => { this.server.close(() => { this.running = false; this.server = null; console.log('✅ Proxy server stopped'); resolve(); }); }); }