ai-hacker-mcp 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +20 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-hacker-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server for Kali Linux penetration testing - provides system prompts and tool listing for AI-assisted security testing",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  const server = new Server(
11
11
  {
12
12
  name: 'kali-mcp-server',
13
- version: '1.0.0',
13
+ version: '1.0.1',
14
14
  },
15
15
  {
16
16
  capabilities: {
@@ -24,7 +24,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
24
24
  tools: [
25
25
  {
26
26
  name: 'list_kali_tools',
27
- description: 'List available Kali Linux security and penetration testing tools installed on the system',
27
+ description: 'List available Kali Linux security and penetration testing tools installed on system',
28
28
  inputSchema: {
29
29
  type: 'object',
30
30
  properties: {
@@ -49,19 +49,24 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
49
49
  const { category } = args || {};
50
50
 
51
51
  return new Promise((resolve, reject) => {
52
- let command = 'dpkg -l | grep -E "kali|metasploit|nmap|burpsuite|sqlmap|nikto|hydra|john|aircrack|wireshark|tcpdump|netcat|socat|gobuster|dirb|ffuf|wpscan|nikto|whatweb|enum4linux|smbclient|nbtscan|rpcclient|showmount|snmpwalk|onesixtyone|ike-scan|sslscan|testssl|nuclei|subfinder|amass|httpx|ffuf|gobuster|dirsearch|wfuzz|feroxbuster|rustscan|masscan|unicornscan|zmap|arp-scan|netdiscover|fping|hping3|scapy|tcping|mtr|traceroute|dig|nslookup|host|whois|curl|wget|git|svn|hg" | grep -E "^ii" | awk \'{print $2}\'';
52
+ let command;
53
53
 
54
54
  if (category) {
55
- command = `dpkg -l | grep -E "kali|${category}" | grep -E "^ii" | awk '{print $2}'`;
55
+ command = `dpkg -l | grep -i "${category}" | grep "^ii" | awk '{print $2}'`;
56
+ } else {
57
+ command = 'dpkg -l | grep "^ii" | awk \'{print $2}\'';
56
58
  }
57
59
 
58
60
  exec(command, { shell: '/bin/bash' }, (error, stdout, stderr) => {
59
61
  if (error) {
62
+ console.error(`Command failed: ${command}`);
63
+ console.error(`Error: ${error.message}`);
64
+ console.error(`Stderr: ${stderr}`);
60
65
  resolve({
61
66
  content: [
62
67
  {
63
68
  type: 'text',
64
- text: `Error listing Kali tools: ${error.message}\nStderr: ${stderr}`,
69
+ text: `Error listing Kali tools: ${error.message}\nCommand: ${command}\nStderr: ${stderr}`,
65
70
  },
66
71
  ],
67
72
  isError: true,
@@ -74,6 +79,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
74
79
  message: `Found ${tools.length} Kali security tools installed on this system. You can use these tools through terminal via iflow-cli.`
75
80
  };
76
81
 
82
+ console.error(`Successfully listed ${tools.length} tools`);
77
83
  resolve({
78
84
  content: [
79
85
  {
@@ -91,6 +97,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
91
97
  throw new Error(`Unknown tool: ${name}`);
92
98
  }
93
99
  } catch (error) {
100
+ console.error(`Handler error: ${error.message}`);
94
101
  return {
95
102
  content: [
96
103
  {
@@ -104,9 +111,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
104
111
  });
105
112
 
106
113
  async function main() {
107
- const transport = new StdioServerTransport();
108
- await server.connect(transport);
109
- console.error('Kali MCP Server running on stdio');
114
+ try {
115
+ const transport = new StdioServerTransport();
116
+ await server.connect(transport);
117
+ console.error('Kali MCP Server running on stdio');
118
+ } catch (error) {
119
+ console.error('Failed to start server:', error);
120
+ process.exit(1);
121
+ }
110
122
  }
111
123
 
112
124
  main().catch((error) => {