Skip to main content
Glama

Alchemy MCP Plugin

by itsanishjain
test-alchemy.js958 B
import { Alchemy, Network } from "alchemy-sdk"; // Initialize Alchemy SDK with API key const API_KEY = "KRdhdsBezoTMVajIknIxlXgBHc1Pprpw"; // Configure Alchemy SDK const settings = { apiKey: API_KEY, network: Network.ETH_MAINNET, }; // Create Alchemy instance const alchemy = new Alchemy(settings); async function testAlchemy() { try { console.log("Testing Alchemy API connection..."); // Get current gas price const gasPrice = await alchemy.core.getGasPrice(); console.log("Current gas price (wei):", gasPrice.toString()); console.log( "Current gas price (gwei):", parseInt(gasPrice.toString()) / 1e9 ); // Get latest block number const blockNumber = await alchemy.core.getBlockNumber(); console.log("Latest block number:", blockNumber); console.log("Alchemy API connection test successful!"); } catch (error) { console.error("Error testing Alchemy API:", error); } } testAlchemy();

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/itsanishjain/alchemy-sdk-mcp'

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