Fee Optimizer MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FX_RATES_PATH | No | Optional override path for data/fx_rates.json. | |
| PERSONAS_PATH | No | Optional override path for data/personas.json. | |
| FEE_RATES_PATH | No | Optional override path for data/fee_rates.json. | |
| PAIR_FEES_PATH | No | Optional override path for data/pair_fees.json. | |
| FIAT_ROUTES_PATH | No | Optional override path for data/fiat_routes.json. | |
| FEE_MCP_HTTP_HOST | No | HTTP host to bind when using HTTP transport, e.g. '0.0.0.0' or '127.0.0.1'. Can also be set with HOST. | 127.0.0.1 |
| FEE_MCP_HTTP_PORT | No | HTTP port to bind when using HTTP transport, e.g. '3333'. Can also be set with PORT. | 3333 |
| FEE_MCP_TRANSPORT | No | Transport mode. Set to 'http' to run the stateless Streamable HTTP MCP endpoint; default is stdio. | stdio |
| TOKEN_PRICES_PATH | No | Optional override path for data/token_prices.json. | |
| FEE_MCP_ACCESS_LOG | No | Set to '1' to emit one structured JSON access-log line per request on stdout. | |
| FUNDING_RATES_PATH | No | Optional override path for data/funding_rates.json. | |
| FEE_MCP_TRUST_PROXY | No | Set to '0' to ignore X-Forwarded-For. By default the first XFF hop is trusted; set to '0' only when not behind a reverse proxy. | |
| REFERRAL_LINKS_PATH | No | Optional override path for data/referral_links.json. | |
| FEE_MCP_BEARER_TOKEN | No | Optional bearer token for public HTTP hosting. When set, every MCP POST must send Authorization: Bearer <secret>; /health remains open. | |
| INTERFACE_COSTS_PATH | No | Optional override path for data/interface_costs.json. | |
| SPREAD_BASELINE_PATH | No | Optional override path for data/spread_baseline.json. | |
| TOKEN_DISCOUNTS_PATH | No | Optional override path for data/token_discounts.json. | |
| WITHDRAWAL_FEES_PATH | No | Optional override path for data/withdrawal_fees.json. | |
| FEE_MCP_HTTP_ENDPOINT | No | HTTP endpoint path for the MCP POST handler when using HTTP transport. | /mcp |
| STABLECOIN_ACCESS_PATH | No | Optional override path for data/stablecoin_access.json. | |
| COUNTRY_RESTRICTIONS_PATH | No | Optional override path for data/country_restrictions.json. | |
| FEE_MCP_RATE_LIMIT_PER_MIN | No | Optional fixed-window per-client-IP rate limit on MCP POSTs, in requests per minute. Set to '0' or leave unset for unlimited. | 0 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| compare_exchange_feesA | 当用户询问加密货币交易所的手续费、费率比较、或哪个交易所交易成本最低时使用此工具。Use when the user asks about crypto exchange fees, fee comparison, or which exchange has the lowest trading cost. Supports spot and futures, with full VIP tier resolution based on monthly volume. Returns exchanges sorted by weighted effective fee rate, including referral discount and optional token discount (BNB/OKB/GT/MX/BGB/KCS). Requires country code for compliance filtering. Pass monthlyVolumeUsd for accurate VIP tier pricing; pass useToken=true if user holds the exchange's native token; pass makerShare (0-1) if the user trades mostly via limit orders. |
| get_referral_linkA | 当用户要求获取某个加密货币交易所的优惠注册链接、推荐码或返佣链接时使用。Use when the user asks for a discount registration link, referral code, or rebate link for a specific crypto exchange. Returns the referral URL with the fee discount the user will receive. Supports Binance, OKX, Gate.io. Requires exchange name and country code. |
| calculate_savingsA | 当用户询问通过推荐链接注册能节省多少手续费时使用。Use when the user asks how much they can save on fees by registering via a referral link. Computes savings based on monthly trading volume, trade type, VIP tier resolution, optional token discount (BNB/OKB/GT/MX/BGB/KCS), and optional funding cost for futures positions held over time. Returns the savings amount and the referral link to register. |
| compare_total_costA | 当用户要求比较不同交易所的真实总成本(交易手续费+资金费率+提现费+点差,v0.26 起可选年化法币入金/出金费)时使用。Use when the user asks for a total cost comparison across exchanges including trading fees, funding rates for futures positions, withdrawal fees, spread, and (v0.26) optional annualized direct fiat deposit/cash-out fees. This is the most comprehensive comparison tool. Requires purpose, country, and monthly volume. Optionally pass holdingHours for funding cost, useToken for token discount, withdrawal details, and fiatDepositAmountUsd/fiatDepositsPerYear (+cashout equivalents) to fold bank/card on/off-ramping into the ranked total. |
| recommend_exchangeA | 当用户不确定选哪个交易所、希望根据自身情况获得个性化推荐时使用。Use when the user wants a personalized exchange recommendation based on their trading volume, style, and holding habits. Scores available exchanges on weighted fees (maker/taker blend), token discounts, referral discounts, funding cost for futures, and (v0.27) the user's direct fiat deposit/cash-out habit — small monthly card/SEPA on-rampers get ranked on fiat rails too (the fiat weight grows 0.2→0.5 as venue-to-venue fiat-fee differences dominate trading-fee differences, and venues with no direct rail score zero on that leg rather than winning on an unpriced cost). Returns the best option with score, concrete reasons, tradeoffs, and actionable advice, plus ranked alternatives. Requires purpose, country, and volume. |
| get_data_sourcesA | 当用户质疑费率数据的来源、新鲜度或准确性时使用(例如:这个数据哪来的?费率多久更新一次?)。Use when the user asks where the fee data comes from, how fresh it is, or wants to verify accuracy. Returns per-file last-verified dates and source URLs (official exchange fee pages) plus caveats. No parameters required. |
| calculate_annual_costA | 当用户想知道一年下来在某交易所的真实总花费(年化交易手续费+年化资金费+年提现费)或升 VIP 档位一年能省多少钱时使用。Use when the user asks for annual/yearly cost of trading on an exchange, or how much reaching the next VIP tier would save per year. Annualizes 12 months of trading fees at the resolved VIP tier (referral + optional token discounts), 12 months of futures funding exposure, and per-event withdrawal fees times yearly withdrawal count. Includes an upgrade quote: the next VIP tier, how to qualify (volume, OKX/Bybit/Bitget/Kraken account assets (Kraken AOP), Gate GT, KuCoin KCS, or Binance BNB), and estimated annual saving. Requires exchange, purpose, country, and monthlyVolumeUsd. |
| get_funding_ratesA | 当用户询问资金费率、资金费、funding rate、当前持仓的资金成本、各交易所永续合约资金费对比时使用。Use when the user asks about perpetual futures funding rates across exchanges, or the current cost of holding a long/short. Returns per-exchange funding rate + settlement interval for a perpetual pair (default BTC/USDT). fundingMode=bundled (default) returns the offline long-run averages instantly; fundingMode=live fetches the real-time current rate from each venue independently via ccxt — venues that fail (timeout, geo-block, missing pair) fall back to the bundled average and are listed in failures, and every row is tagged with source/live timestamp. |
| get_execution_costA | 当用户询问买卖点差、滑点、订单簿深度、大单冲击成本、市价单实际成交成本、各所吃单执行成本对比时使用。Use when the user asks about bid-ask spread, slippage, order-book depth, market impact, or the real execution cost of a marketable order across exchanges. Returns per-exchange one-way execution cost in bps and USD for a specific order size (default $10,000): full spread, crossing cost (half spread), depth-walk slippage beyond the top level, total one-way cost, levels consumed, and fill status. spreadMode=bundled (default) uses offline typical-spread baselines by venue and pair class (majors/large-cap/mid-alt) instantly; spreadMode=live fetches the real top-100 order book per venue independently via ccxt and VWAP-walks it — failures fall back to bundled baselines (listed in failures), shallow books keep the measured cost with a warning. Spot requests use the spot market (e.g. kucoin rather than kucoinfutures). Requires country for compliance filtering unless exchanges are given explicitly. |
| get_fiat_costA | 当用户询问法币入金/出金成本、刷卡买币手续费、银行卡/信用卡充值费用、银行转账(SEPA/ACH/FPS/PIX/电汇 SWIFT/wire)哪个便宜、提现到银行卡实际到账多少时使用。Use when the user asks how much it costs to move fiat money INTO an exchange (deposit/buy crypto with card or bank transfer) or OUT to a bank account (cash out / withdraw fiat). Prices the direct, exchange-operated rails across venues: credit/debit cards (about 1.1% EU at Bybit to 4.5% at KuCoin; most venues have no card cash-out), US ACH (free at OKX and Kraken), EU SEPA (free deposits at OKX/Kraken/Bitget, about EUR 1 withdrawals; Gate charges 0.5%/1%), UK Faster Payments, Brazil PIX, and SWIFT/domestic wire (fixed USD 4-35 withdrawals). For every venue returns each available rail with fee in fiat AND USD, effective percentage, net amount that arrives, ETA and caveats, plus cheapest overall pick and saving vs the most expensive supported venue. Region/residency-aware: pass country so non-resident rails are filtered (SEPA is EU-only, ACH/wire US-only, FPS GB-only, PIX BR-only). Covers ONLY direct rails — third-party gateway quotes (Banxa/Simplex/MoonPay: 1.99%-5.5% at checkout) and zero-fee P2P (cost embedded in the quote spread) are excluded and called out in notes/advice. |
| get_withdrawal_feesA | 当用户询问提币手续费、转出/提现到钱包或其他交易所哪个网络便宜、USDT/USDC 走 TRC-20/ERC-20/BEP20/Arbitrum/Optimism/Base/Polygon/Solana/Avalanche 各要多少、某交易所是否支持某链、BTC/ETH/SOL/XRP/DOGE 等原生币提币费、链上转账费对比时使用。Use when the user asks which exchange has the cheapest crypto withdrawal / network fee for an asset on a given chain, whether a venue supports a network, or wants to compare on-chain transfer costs before moving coins to a wallet or another exchange. Returns every supported route per venue with the fee in native units AND USD (converted from a dated price snapshot), marks wallets currently suspended, names each venue's cheapest open route, and ranks venues with an overall best pick plus saving vs the most expensive one. Covers 16 assets (BTC, ETH, USDT, USDC, SOL, XRP, DOGE, LTC, TRX, ADA, AVAX, DOT, LINK, BCH, TON, POL) across Tron/Ethereum/BSC/Arbitrum/Optimism/Base/Polygon/Avalanche/Solana/Ton/native chains at all venues with routes (Coinbase only lists BTC/ETH/USDT/USDC — dynamic network-fee estimates). Fees are exchange-charged, pass-through on-chain costs (Kraken/KuCoin dynamic), not trading fees — for the all-in cost of a trade use compare_total_cost instead. |
| analyze_personaA | 当用户描述自己的交易类型/身份(新手小额买入、定投囤币、活跃现货、合约波段、高频刷单、高净值机构、链上无 KYC 玩家)并想知道哪种交易所最适合自己、一年真实总花费多少时使用。Use when the user asks which exchange fits THEIR kind of trading, describes themselves as a beginner/HODLer/swing trader/scalper/institution/no-KYC trader, or wants an all-in annual cost for a trader scenario. Loads a research-anchored persona preset (casual_buyer, hodler_accumulator, active_spot_trader, swing_futures_trader, day_scalper, vip_institutional, dex_native) that bundles monthly volume, maker share, futures holding hours, market-order clip size, withdrawal and fiat on/off-ramp habits, then runs the FULL annual cost stack across every venue allowed in the country — trading fees + funding + spread crossing + on-chain withdrawals + direct fiat deposit/cash-out legs — and returns the ranked venues with cost-mix %, cheapest-venue leader for each cost component, a winner with concrete reasons and trade-offs, and tailored advice (VIP upgrade saving, token-discount hint, live funding/depth suggestions). Every preset parameter can be overridden. Requires persona id and country code. |
| analyze_token_discountA | 当用户问持有某个交易所的平台币(BNB/GT/KCS/BGB/MX/HYPE)来抵扣手续费是否划算、多久能回本、能承受币价跌多少时使用。Use when the user asks whether holding an exchange's native token for fee discounts is worth it, how long until the discount pays back the locked capital, or how far the token price can drop before the saving is wiped out. Computes the annual trading fee WITHOUT the native token (zero-balance tier, no fee-deduction toggle) vs. WITH the token (GT/KCS/BNB holdings can lift the VIP tier; BNB/MX/BGB/KCS give a flat fee-deduction; Gate GT and MEXC MX and Hyperliquid HYPE have holding-tier discount ladders; Gate futures maker drops to zero). Returns annual USD saving, the USD opportunity cost of locking the required token balance (2026-09 snapshot price or explicit tokenPriceUsd override), payback in months, and the maximum one-year token price drop the saving can absorb. When tokenBalance is omitted it returns every achievable discount tier as a table with a recommended best-payback tier. Requires exchange, purpose, country, and monthlyVolumeUsd. |
| compare_personasA | 当用户想一次看清"什么类型的交易者该用哪个交易所"、要全部 7 种画像并排对比、做决策矩阵/选型总览,或问"哪个交易所适合最多人/最全能"时使用。Use when the user wants a side-by-side decision matrix of ALL trader personas (casual buyer, DCA HODLer, active spot, swing futures, scalper, VIP/institutional, no-KYC on-chain) for their country in one call. Runs each persona's full annual all-in stack across every allowed venue, then returns per-persona winner + realistic best_complete pick (every cost leg actually priced — headline winners with no fiat/withdrawal rail are demoted), a persona×venue annual-cost matrix, cross-persona venue win counts, and the single most versatile venue. Requires only the country; optionally restrict personas or force useToken. This is the fastest way to answer "which exchange for which kind of trader". |
| volume_what_ifA | 当用户问"月交易量达到 X 手续费多少/如果成交量增长到不同水平呢/再刷多少量能升 VIP 档省钱/各交易所档位跳变点",或要看一条跨成交量的费率-成本曲线时使用。Use for volume what-if / sensitivity analysis: scans monthly trading volume from zero up through the VIP ladder for spot OR futures across EVERY venue allowed in the country, returning (1) per-volume-point cross-venue ranking with the cheapest venue and its annual trading fee, (2) per-venue sweep curves with tier/maker/taker/weighted fee at each point, (3) the exact tier-crossing list (at which volume each venue moves to which rung), and when baseVolume is given, (4) each venue's next volume rung, how much MORE monthly volume it needs, and the USD/year it would save at the caller's current volume (holding-gated rungs like Binance spot's BNB requirement are explicitly flagged as unreachable by volume alone). Sweep points default to the union of every venue's tier thresholds (sampled if >16); pass explicit volumes for custom points. Applies referral discounts and the optional platform-token toggle exactly like compare_exchange_fees. Trading fees only — funding, spread, withdrawals and fiat are not included (use compare_total_cost for the full stack). |
| compare_countriesA | 当用户问"同样的交易习惯在哪个国家最便宜/我要搬家或换居住地(美国/日本/德国/新加坡…)手续费和可用交易所有什么不同/哪些所在我国被封锁/同一画像跨国对比"时使用。Use to run ONE trader persona/profile through the FULL annual all-in stack (trading fees + funding + spread + withdrawals + fiat rails) across SEVERAL countries in a single call and see how residency changes the result: per-country winner + realistic best_complete pick, annual cost and the extra vs the cheapest country (USD and %), the venues blocked by compliance and the venues that simply do not offer the profile's product (e.g. spot-only Coinbase for a futures trader), a venue×country availability matrix, cross-country venue win counts, the cheapest/costliest country and the annual cost gap, and bilingual narrative advice. Defaults to the active_spot_trader persona across 7 representative countries (US, GB, DE, JP, SG, BR, CN); pick any of the 7 personas via persona and pass an explicit countries list (up to 12). Every persona parameter can be overridden (volume, maker share, token, assets, holding hours, clip). Live funding/depth overrides are resolved once over the union of venues allowed in ANY selected country. |
| get_account_fee_tierA | 当用户想知道"我账户里实际生效的手续费率/我的真实 VIP 档位费率/API 查我的 maker taker/为什么我实际手续费和公开表不一样"时使用。Use a READ-ONLY exchange API key (apiKey + secret, OKX/KuCoin-Futures also need passphrase as password; Hyperliquid needs only the PUBLIC 0x wallet address as apiKey) to fetch the account's ACTUAL maker/taker fee for spot or futures, then compares it against this server's bundled public VIP schedule at the given monthly volume and shows the gap in bps. Credentials are used per request only, never cached, never logged (audit logs redact them). Always generate a READ-ONLY key (no trading/withdrawal permissions). Supported: Binance, OKX, Gate, Bybit, MEXC, Bitget, KuCoin (spot + kucoinfutures), Kraken (spot + krakenfutures), Coinbase (spot), Hyperliquid (wallet address), BingX, Bitstamp (spot); NOT supported by the bundled ccxt connector: Phemex, BloFin, Bitstamp perps. Country compliance/product gates are enforced before any authenticated call. |
| get_stablecoin_accessA | 当用户问"USDT/Tether/稳定币在我的国家(尤其欧洲/EEA/欧盟)还能不能交易、买卖、提币?哪些交易所下架了 USDT?MiCA 合规稳定币有哪些(USDC/EURC/EURI/EURCV/USDQ)?Revolut 的 USDT 怎么办?"时使用。Returns the MiCA regional access status of a stablecoin (default USDT): issuer + MiCA EMT authorization status, whether venue trading is barred in the resident's region (USDT: unavailable across all 30 EEA states after the 2026-07-01 CASP cliff), custody/withdrawal and self-custody rights (holding and on-chain withdrawal stay legal; the restriction binds venues, not people), a per-venue table (delisted with date / never_offered / venue_blocked; scope eea vs global; whether the venue itself serves the country), compliant alternatives and localized advice. CH and GB are NOT in the EEA region. Without a country, global/asset-level status is returned. Also auto-injected as STABLECOIN_UNAVAILABLE_IN_REGION warnings into fee/withdrawal/execution/persona tools for USDT-quoted requests from EEA residents. |
| compare_interface_costsA | 当用户问"同一个交易所为什么 App 买币这么贵?Kraken app / Instant Buy / Coinbase Simple / 简单交易的手续费是多少?听说 App 里藏了点差(hidden spread)?同一家交易所有两套价格?TUM 实测哪个欧洲平台最坑?"时使用。Compares each venue's CONSUMER interface (Kraken app Instant Buy/custom orders, Coinbase Simple, Bitstamp Basic, Bitvavo Basic one-tap, Bitpanda/BISON spread-model brokerage) against its own PRO order-book benchmark on the same account. Evidence: TUM real-money €100 round-trip study (2025-10..11, six MiCA-licensed EU platforms) independently replicated by Frankfurt School (432 round-trips, 2026-03) — retail round-trips span 13x: Bitvavo 0.58% (pass-through, transparency benchmark) < Bison 2.58% < Kraken app 5.81% (3.81 pp hidden) < Bitpanda 6.23% (4.25 pp hidden) < Coinbase Simple 7.49% (4.51 pp hidden, worst; $2.99 flat fee dominates small DCA buys and simple LIMIT orders still carry a 1% execution fee). Returns per venue: consumer product name + fee model, modeled one-way all-in cost, measured round-trip, hidden markup pp, the PRO maker/taker base, the gap in pp, and — when monthly_volume_usd is passed — the annualized excess of using the consumer app instead of PRO (e.g. Coinbase at $1k/mo ≈ $168/yr); subscription caveats (Kraken+ $4.99/10k waiver, Coinbase One) and the fact that app volume earns NO PRO tier credit. Bitpanda/BISON have no separate PRO interface (the premium IS the fee); Bitstamp Basic is flagged unverified (no third-party measurement). Pass country to apply residency gating (Bitvavo/Bitpanda/BISON are venue-blocked outside their service areas). The same gap is auto-injected as consumer_interface hints into compare_exchange_fees / calculate_savings / compare_total_cost / recommend_exchange rows and as CONSUMER_INTERFACE_MORE_EXPENSIVE warnings on savings/recommendation results. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 19 tools
There is a large cluster of heavily overlapping 'compute a cross-venue cost' tools—compare_exchange_fees, compare_total_cost, calculate_annual_cost, calculate_savings, recommend_exchange, analyze_persona, compare_personas, compare_countries, and volume_what_if all return ranked fee comparisons with only subtly different lenses. The descriptions do cross-reference each other (e.g. 'for the all-in cost of a trade use compare_total_cost instead'), which helps, but an agent asked a generic 'which exchange is cheapest' question faces genuine selection ambiguity.
Nearly all tools follow a consistent snake_case verb_noun pattern (calculate_savings, compare_total_cost, get_funding_rates, analyze_persona, recommend_exchange). The only outlier is volume_what_if, which drops the verb prefix, but the set is otherwise predictable and readable.
At 19 tools the surface is on the heavy side for a fee-optimization server, and several tools appear consolidatable (e.g. compare_exchange_fees / compare_total_cost / calculate_annual_cost are variants of the same comparison). The breadth of the domain (multi-exchange, multi-cost-leg, personas, countries) justifies many of them, but 19 is borderline.
Coverage of the fee-optimization domain is exceptionally thorough: trading fees, funding rates, execution/spread, withdrawal fees, fiat on/off-ramps, token discounts, consumer-interface markups, stablecoin regional access, API-verified account tiers, referral links, data provenance, plus persona/country and what-if analysis. No obvious operational gaps or dead ends for the stated purpose.