Skip to main content
Glama

bnbchain-mcp

Official
by bnb-chain
client.ts656 B
import { Client } from "@bnb-chain/greenfield-js-sdk" import { MAINNET, TESTNET } from "../constants" const getRpcUrl = (network: "testnet" | "mainnet") => { return network === "testnet" ? TESTNET.rpcUrl : MAINNET.rpcUrl } const getChainId = (network: "testnet" | "mainnet") => { return network === "testnet" ? TESTNET.chainid : MAINNET.chainid } const clientMap = new Map<string, Client>() export const getClient = (network: "testnet" | "mainnet") => { if (!clientMap.has(network)) { clientMap.set( network, Client.create(getRpcUrl(network), getChainId(network).toString()) ) } return clientMap.get(network) as Client }

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/bnb-chain/bnbchain-mcp'

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