Skip to main content
Glama

Meteora DLMM MCP Server

by fciaf420
direct-test.jsโ€ข3.82 kB
// Direct tool testing for Meteora DLMM MCP Server require('dotenv').config(); const DLMM = require("@meteora-ag/dlmm").default; const { Connection, PublicKey } = require("@solana/web3.js"); const config = { rpcUrl: process.env.RPC_URL || "https://solana-rpc.publicnode.com", debug: true }; const connection = new Connection(config.rpcUrl); async function testPoolInfo() { console.log('\n๐Ÿงช Testing Pool Info...'); try { // First get a real DLMM pool address console.log('Fetching available pools...'); const pools = await DLMM.getLbPairs(connection); if (pools.length === 0) { console.log('โš ๏ธ No DLMM pools found'); return false; } const poolAddress = pools[0].publicKey.toString(); console.log(`Found ${pools.length} pools, testing first one: ${poolAddress}`); const dlmmPool = await DLMM.create(connection, new PublicKey(poolAddress)); const activeBin = await dlmmPool.getActiveBin(); const result = { poolAddress, tokenX: dlmmPool.tokenX.mint.toString(), tokenY: dlmmPool.tokenY.mint.toString(), tokenXSymbol: dlmmPool.tokenX.symbol, tokenYSymbol: dlmmPool.tokenY.symbol, activeBinId: activeBin.binId, activePrice: activeBin.price, }; console.log('โœ… Pool Info Success:'); console.log(JSON.stringify(result, null, 2)); return true; } catch (error) { console.error('โŒ Pool Info Error:', error.message); return false; } } async function testConnection() { console.log('\n๐ŸŒ Testing RPC Connection...'); try { const version = await connection.getVersion(); console.log('โœ… RPC Connection Success:'); console.log(`Solana version: ${JSON.stringify(version)}`); return true; } catch (error) { console.error('โŒ RPC Connection Error:', error.message); return false; } } async function testPopularPools() { console.log('\n๐Ÿ“Š Testing Popular Pools...'); try { console.log('Fetching DLMM pairs...'); const pools = await DLMM.getLbPairs(connection); const popularPools = pools.slice(0, 3); const poolInfo = popularPools.map(pool => ({ address: pool.publicKey.toString(), tokenX: pool.tokenXMint.toString(), tokenY: pool.tokenYMint.toString(), binStep: pool.binStep, })); console.log('โœ… Popular Pools Success:'); console.log(JSON.stringify(poolInfo, null, 2)); return true; } catch (error) { console.error('โŒ Popular Pools Error:', error.message); return false; } } async function runTests() { console.log('๐Ÿš€ Meteora DLMM MCP Server - Direct Testing'); console.log('๐Ÿ“ก RPC URL:', config.rpcUrl); console.log('=' .repeat(50)); const tests = [ { name: 'RPC Connection', fn: testConnection }, { name: 'Pool Info', fn: testPoolInfo }, { name: 'Popular Pools', fn: testPopularPools } ]; let passed = 0; for (const test of tests) { try { const result = await test.fn(); if (result) passed++; } catch (error) { console.error(`โŒ ${test.name} failed:`, error.message); } } console.log('\n' + '=' .repeat(50)); console.log(`๐Ÿ“Š Test Results: ${passed}/${tests.length} tests passed`); if (passed === tests.length) { console.log('๐ŸŽ‰ All tests passed! Your MCP server is working correctly.'); console.log('\n๐Ÿ’ก Next steps:'); console.log('1. Connect to Claude using MCP server configuration'); console.log('2. Try natural language queries like:'); console.log(' - "Get pool info for DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"'); console.log(' - "Show me popular DLMM pools"'); } else { console.log('โš ๏ธ Some tests failed. Check your RPC connection and configuration.'); } } runTests().catch(console.error);

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/fciaf420/Meteora-DLMM-MCP'

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