import{StreamableHTTPClientTransport}from"@modelcontextprotocol/sdk/client/streamableHttp.js"import{Client}from"@modelcontextprotocol/sdk/client/index.js"// Construct server URL with authenticationconsturl=newURL("https://server.smithery.ai/@cuongpo/hyperion-mcp-server/mcp")url.searchParams.set("api_key","36e96d01-a9dd-4e4c-a705-bbe239a712ea")url.searchParams.set("profile","notable-sparrow-IsrW6Y")constserverUrl=url.toString()consttransport=newStreamableHTTPClientTransport(serverUrl)// Create MCP clientconstclient=newClient({name:"My Hyperion App",version:"1.0.0"})awaitclient.connect(transport)// List available toolsconsttools=awaitclient.listTools()console.log(`Available tools: ${tools.map(t=>t.name).join(", ")}`)
📦 Installation
Prerequisites
Node.js 18+
npm or yarn package manager
Install MCP SDK
TypeScript Support (Optional)
🔐 Authentication
The Hyperion MCP Server is hosted on Smithery and requires authentication:
🛠️ Available Tools
The Hyperion MCP Server provides 18 comprehensive tools for blockchain interactions:
💼 Wallet Management
create_wallet
Create a new Hyperion wallet with generated mnemonic phrase.
Parameters:
name (optional): Wallet name
Example:
import_wallet
Import existing wallet using private key or mnemonic phrase.
Parameters:
privateKey (optional): Private key to import
mnemonic (optional): Mnemonic phrase to import
name (optional): Wallet name
Example:
list_wallets
List all available wallets.
Parameters: None
Example:
set_current_wallet
Set the current active wallet for transactions.
Parameters:
address (required): Wallet address to set as current
Example:
get_current_wallet
Get current active wallet information.
Parameters: None
Example:
💰 Balance & Transactions
get_balance
Get balance of wallet address (native tMETIS or ERC20 tokens).
Note: You need to provide the compiled bytecode for the ERC721 contract. The server includes a reference implementation (HyperionERC721) that extends OpenZeppelin's ERC721URIStorage with minting capabilities.
// ❌ DON'T: Hardcode API keys
const apiKey = "36e96d01-a9dd-4e4c-a705-bbe239a712ea"
// ✅ DO: Use environment variables
const apiKey = process.env.SMITHERY_API_KEY
// ✅ DO: Use secure key management
import { getSecret } from './secure-config.js'
const apiKey = await getSecret('SMITHERY_API_KEY')
function validateAddress(address) {
if (!address || typeof address !== 'string') {
throw new Error('Address is required and must be a string')
}
if (!/^0x[a-fA-F0-9]{40}$/.test(address)) {
throw new Error('Invalid Ethereum address format')
}
return address.toLowerCase()
}
function validateAmount(amount) {
if (!amount || isNaN(parseFloat(amount))) {
throw new Error('Amount must be a valid number')
}
if (parseFloat(amount) <= 0) {
throw new Error('Amount must be greater than 0')
}
return amount
}
class RateLimiter {
constructor(maxRequests = 10, windowMs = 60000) {
this.maxRequests = maxRequests
this.windowMs = windowMs
this.requests = []
}
async checkLimit() {
const now = Date.now()
this.requests = this.requests.filter(time => now - time < this.windowMs)
if (this.requests.length >= this.maxRequests) {
const oldestRequest = Math.min(...this.requests)
const waitTime = this.windowMs - (now - oldestRequest)
await new Promise(resolve => setTimeout(resolve, waitTime))
}
this.requests.push(now)
}
}
const rateLimiter = new RateLimiter()
async function rateLimitedCall(toolName, params) {
await rateLimiter.checkLimit()
return await client.callTool(toolName, params)
}