test-hybrid.jsā¢2.58 kB
// Test the hybrid API+SDK approach
require('dotenv').config();
// Load the hybrid server module
const serverModule = require('./src/index-hybrid.ts');
console.log('š Testing Hybrid Meteora DLMM MCP Server');
console.log('š API for reads + š§ SDK for writes');
console.log('=' .repeat(50));
// Test configuration
const testConfig = {
rpcUrl: "https://solana-rpc.publicnode.com",
walletPrivateKey: undefined, // No wallet for read-only testing
debug: true,
maxRetries: 3,
rpcTimeout: 30000
};
async function testHybridServer() {
try {
console.log('ā
1. Creating hybrid server instance...');
const server = serverModule({ config: testConfig });
console.log('ā
2. Hybrid server created successfully!');
console.log('š Configuration:', JSON.stringify(testConfig, null, 2));
console.log('\nš ļø Hybrid MCP Server Features:');
console.log('š READ Operations (API-based):');
console.log(' - ā
get_pool_info: Fast pool information via Meteora API');
console.log(' - ā
get_user_positions: User positions via API (with SDK fallback)');
console.log(' - ā
get_popular_pools: Popular pools sorted by liquidity');
console.log(' - ā
get_claimable_fees: Pool info + fee calculation notes');
console.log('\nāļø WRITE Operations (SDK-based):');
console.log(' - š§ claim_fees: Transaction execution via SDK');
console.log(' - š§ Future: add_liquidity, remove_liquidity, swap');
console.log('\nšÆ Hybrid Benefits:');
console.log('ā
Fast read operations (no RPC restrictions)');
console.log('ā
Full transaction capabilities (when RPC allows)');
console.log('ā
Graceful degradation (API fallbacks)');
console.log('ā
Best of both worlds');
console.log('\nš” Usage Examples:');
console.log('- "Get pool info for ZmZ7nJ4PSMCUd8HFafDYRXappQEiLsipY38d2fYxabT"');
console.log('- "Show me popular DLMM pools"');
console.log('- "Get my positions for wallet [address]"');
console.log('- "Claim fees from position [address]" (requires wallet)');
console.log('\nš Hybrid Meteora DLMM MCP server is ready!');
console.log('š” API-powered reads + š§ SDK-powered writes');
return true;
} catch (error) {
console.error('ā Error:', error.message);
return false;
}
}
testHybridServer().then(success => {
if (success) {
console.log('\nš Ready for deployment and Claude connection!');
} else {
console.log('\nā Fix issues before deploying');
}
}).catch(console.error);