We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dianakrog/mcpworkshop'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
const { chromium } = require('playwright');
const fs = require('fs');
async function openGeoJSONInChrome() {
console.log("๐ก๏ธ Lima Temperature from CALL__CITY_WEATHER_PROMPT: 17.7ยฐC");
console.log("๐ Starting Chrome automation with Playwright...");
try {
// Read the GeoJSON data
const geoJsonPath = 'lima_weather_polygon.geojson';
const geoJsonData = fs.readFileSync(geoJsonPath, 'utf8');
const geoJsonObject = JSON.parse(geoJsonData);
console.log("๐ Loaded GeoJSON data:");
console.log(` ๐๏ธ Features: ${geoJsonObject.features.length}`);
console.log(` ๐ก๏ธ Lima: 17.7ยฐC`);
console.log(` ๐๏ธ Callao: 17.4ยฐC`);
console.log(` ๐๏ธ Huancayo: 15.4ยฐC`);
console.log(` ๐๏ธ Trujillo: 20.5ยฐC`);
// Launch Chrome browser
console.log("๐ Launching Chrome browser...");
const browser = await chromium.launch({
headless: false,
channel: 'chrome',
args: ['--start-maximized']
});
const context = await browser.newContext({
viewport: null
});
const page = await context.newPage();
// Navigate to geojson.io
console.log("๐ Navigating to https://geojson.io/...");
await page.goto('https://geojson.io/', { waitUntil: 'networkidle' });
// Wait for the editor to load
console.log("โณ Waiting for editor to load...");
await page.waitForSelector('.CodeMirror', { timeout: 10000 });
await page.waitForTimeout(3000);
// Create a beautiful notification overlay
await page.evaluate((weatherData) => {
const overlay = document.createElement('div');
overlay.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 25px;
border-radius: 15px;
z-index: 10000;
max-width: 400px;
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
border: 2px solid rgba(255,255,255,0.2);
backdrop-filter: blur(10px);
`;
overlay.innerHTML = `
<h3 style="margin: 0 0 15px 0; font-size: 20px; font-weight: 600;">
๐ก๏ธ CALL__CITY_WEATHER_PROMPT Results
</h3>
<div style="margin-bottom: 15px;">
<div style="font-size: 16px; font-weight: 500;">๐๏ธ Lima, Peru</div>
<div style="font-size: 28px; font-weight: bold; color: #FFD700;">17.7ยฐC</div>
</div>
<div style="font-size: 14px; line-height: 1.6; margin-bottom: 15px;">
<div>๐๏ธ Callao: 17.4ยฐC</div>
<div>๐๏ธ Huancayo: 15.4ยฐC</div>
<div>๐๏ธ Trujillo: 20.5ยฐC</div>
</div>
<div style="font-size: 12px; opacity: 0.9; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 10px;">
โ
GeoJSON loaded automatically via Playwright<br>
๐ Average Temperature: 17.8ยฐC
</div>
`;
document.body.appendChild(overlay);
// Auto-remove after 15 seconds
setTimeout(() => {
if (overlay.parentNode) {
overlay.parentNode.removeChild(overlay);
}
}, 15000);
}, {});
// Click on the editor and clear existing content
console.log("โ๏ธ Clearing editor and inserting Lima weather GeoJSON...");
await page.click('.CodeMirror');
await page.keyboard.press('Control+a');
await page.waitForTimeout(500);
// Input the GeoJSON data
await page.keyboard.type(geoJsonData);
console.log("โ
GeoJSON data successfully inserted into geojson.io!");
console.log("๐บ๏ธ You should now see:");
console.log(" ๐ Lima (main city) - 17.7ยฐC");
console.log(" ๐ Callao (port city) - 17.4ยฐC");
console.log(" ๐ Huancayo (mountain city) - 15.4ยฐC");
console.log(" ๐ Trujillo (northern coast) - 20.5ยฐC");
console.log(" ๐บ Weather polygon created using AgroPolygons methodology");
// Wait for the map to render
await page.waitForTimeout(2000);
// Try to zoom to fit the data
try {
await page.click('[title="Zoom to data"]', { timeout: 5000 });
console.log("๐ Zoomed to fit Lima weather data");
} catch (e) {
console.log("โน๏ธ Auto-zoom not available, map should show Peru region");
}
console.log("\n๐ CALL__CITY_WEATHER_PROMPT Complete!");
console.log("=" .repeat(60));
console.log("๐ก๏ธ Main City: Lima, Peru - 17.7ยฐC");
console.log("๐ง Humidity: 89%");
console.log("๐จ Wind Speed: 13.7 km/h");
console.log("๐๏ธ Nearby Cities Found: 3");
console.log("๐ GeoJSON File: lima_weather_polygon.geojson");
console.log("๐ Opened in: https://geojson.io/");
console.log("=" .repeat(60));
// Keep browser open for user interaction
console.log("โฐ Browser will stay open for 90 seconds for you to explore...");
await page.waitForTimeout(90000);
} catch (error) {
console.error("โ Error during automation:", error);
} finally {
console.log("๐ Closing browser...");
if (typeof browser !== 'undefined') {
await browser.close();
}
}
}
// Execute the automation
openGeoJSONInChrome().catch(console.error);