quick_port_scan
Scan an IP address to identify open ports for security assessment and network analysis.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ip": "<ip>"
},
"name": "quick_port_scan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes | IP address to perform a quick port scan on |
Implementation Reference
- src/tools/network-adv.ts:39-46 (handler)The actual implementation of the port scan logic using the HackerTarget API.
async scanPorts(ip: string): Promise<string> { try { const response = await fetch(`https://api.hackertarget.com/nmap/?q=${ip}`); return await response.text(); } catch (error) { throw new McpError(ErrorCode.InternalError, `Port Scan error: ${(error as Error).message}`); } } - src/index.ts:697-706 (registration)Registration of the quick_port_scan tool in the MCP server instance.
server.tool( "quick_port_scan", { ip: z.string().describe("IP address to perform a quick port scan on") }, async ({ ip }) => { const result = await netAdvClient.scanPorts(ip); return { content: [{ type: "text", text: result }], }; } );