Skip to main content
Glama

Agricultural AI MCP Server

by BishalJena
test-server.jsโ€ข1.85 kB
// Quick test script for the MCP server const fetch = require('node-fetch'); async function testMCPServer() { const baseUrl = 'http://localhost:10000'; try { console.log('๐Ÿงช Testing MCP Server...'); // Test health endpoint const healthResponse = await fetch(`${baseUrl}/health`); const healthData = await healthResponse.json(); console.log('โœ… Health check:', healthData.status); // Test crop-price tool const cropPriceResponse = await fetch(`${baseUrl}/tools/crop-price`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ state: 'Punjab', commodity: 'Wheat', limit: 5 }) }); const cropPriceData = await cropPriceResponse.json(); console.log('โœ… Crop price tool:', cropPriceData.success ? 'Working' : 'Error'); // Test soil health tool const soilResponse = await fetch(`${baseUrl}/tools/soil-health`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ state: 'Punjab', ph_level: 6.5, npk_values: { nitrogen: 280, phosphorus: 23, potassium: 280 } }) }); const soilData = await soilResponse.json(); console.log('โœ… Soil health tool:', soilData.success ? 'Working' : 'Error'); console.log('๐ŸŽ‰ All tests passed! MCP Server is ready for hackathon!'); } catch (error) { console.error('โŒ Test failed:', error.message); } } // Only run if this file is executed directly if (require.main === module) { testMCPServer(); } module.exports = { testMCPServer };

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/BishalJena/fs-gate'

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