Skip to main content
Glama

SpiderFoot MCP Server

test-spiderfoot-api-direct.js2.38 kB
// Test script to directly interact with SpiderFoot API import axios from 'axios'; const SPIDERFOOT_API_URL = 'http://localhost:5001'; async function testSpiderFootAPI() { const client = axios.create({ baseURL: SPIDERFOOT_API_URL, timeout: 10000, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' } }); try { // 1. Test ping endpoint console.log('1. Testing ping endpoint...'); const pingResponse = await client.get('/ping'); console.log('Ping response:', pingResponse.data); // 2. List available modules console.log('\n2. Listing available modules...'); const modulesResponse = await client.get('/modules'); console.log('Available modules:', modulesResponse.data); // 3. List event types console.log('\n3. Listing event types...'); const eventTypesResponse = await client.get('/eventtypes'); console.log('Event types:', eventTypesResponse.data); // 4. List scans console.log('\n4. Listing scans...'); const scansResponse = await client.get('/scans'); console.log('Scans:', scansResponse.data); // 5. Get scan info for the first scan if (scansResponse.data && scansResponse.data.length > 0) { const scanId = scansResponse.data[0][0]; // Get the first scan ID console.log(`\n5. Getting info for scan ${scanId}...`); const scanInfoResponse = await client.get(`/scaninfo`, { params: { id: scanId } }); console.log('Scan info:', scanInfoResponse.data); // 6. Get scan results console.log(`\n6. Getting results for scan ${scanId}...`); const scanResultsResponse = await client.get('/scanresults', { params: { id: scanId } }); console.log('Scan results:', scanResultsResponse.data); } } catch (error) { console.error('\n❌ Error testing SpiderFoot API:'); if (error.response) { console.error('Status:', error.response.status); console.error('Headers:', error.response.headers); console.error('Data:', error.response.data); } else if (error.request) { console.error('No response received. Is the SpiderFoot server running?'); console.error('Request config:', error.config); } else { console.error('Error:', error.message); } process.exit(1); } } // Run the test testSpiderFootAPI();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CorbettCajun/Spiderfoot-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server