Skip to main content
Glama
index.ts1.54 kB
import "./polyfills.js"; import { FastMCP } from "fastmcp"; import { tool_market_price, tool_market_klines, tool_exchange_info } from "./tools/market.js"; import { tool_account_balances, tool_open_orders } from "./tools/account.js"; import { tool_place_order, tool_cancel_order } from "./tools/trade.js"; import { ToolError } from "./util/errors.js"; const server = new FastMCP({ name: "binance-mcp", version: "0.1.0", instructions: "Binance Spot REST toolkit: prezzi, klines, exchangeInfo, bilanci, open orders e trade protetti da env toggle.", }); const tools = [ tool_market_price, tool_market_klines, tool_exchange_info, tool_account_balances, tool_open_orders, tool_place_order, tool_cancel_order, ]; tools.forEach((tool) => { server.addTool({ name: tool.name, description: tool.description, parameters: tool.parameters, execute: async (args) => { try { const result = await tool.run(args); return JSON.stringify(result, null, 2); } catch (error) { const handled = error instanceof ToolError ? error : new ToolError((error as Error).message); throw handled; } }, }); }); const transport = process.env.MCP_TRANSPORT ?? "stdio"; const port = Number(process.env.PORT ?? 8080); server .start( transport === "http" ? { transportType: "httpStream", httpStream: { port } } : { transportType: "stdio" }, ) .then(() => { console.log(`binance-mcp ready via ${transport === "http" ? `http:${port}` : "stdio"}`); });

Latest Blog Posts

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/Valerio357/binance-mcp'

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