earth2-mcp-server
Version:
Earth2 MCP Server for Claude integration - Access your Earth2 account data through Claude
44 lines (36 loc) • 1.19 kB
JavaScript
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('earth2_api_log_smart.json', 'utf8'));
const endpoints = new Map();
data.forEach(item => {
try {
const url = new URL(item.url);
if (url.hostname.includes('earth2.io') && !url.hostname.includes('mapbox')) {
const path = url.pathname;
const method = item.method;
const key = `${method} ${path}`;
if (!endpoints.has(key)) {
endpoints.set(key, {
method,
path,
fullUrl: item.url,
status: item.status
});
}
}
} catch(e) {
// Skip invalid URLs
}
});
// Sort and display
const sorted = Array.from(endpoints.values()).sort((a, b) => {
if (a.path !== b.path) return a.path.localeCompare(b.path);
return a.method.localeCompare(b.method);
});
console.log('=== UNIQUE EARTH2 API ENDPOINTS ===\n');
sorted.forEach(ep => {
console.log(`${ep.method.padEnd(6)} ${ep.path}`);
});
console.log(`\n=== TOTAL: ${sorted.length} unique endpoints ===`);
// Write to file
fs.writeFileSync('unique_endpoints.txt', sorted.map(ep => `${ep.method} ${ep.path}`).join('\n'));
console.log('\nSaved to unique_endpoints.txt');