@0xmonaco/mcp-server

中文文档
1.1.9发布于 2026/11/07ES Module近 30 天下载 5985

MCP server for the Monaco SDK

原始使用文档
文档目录23 节
  1. Configuration
  2. Capability profiles
  3. Delegated owner mode
  4. Networks
  5. Installation
  6. Public-only mode (no env vars needed)
  7. Authenticated mode
  8. Tools
  9. Search
  10. Market
  11. Perp market data
  12. Orderbook
  13. Trades
  14. Trading
  15. Positions
  16. Portfolio
  17. Margin accounts
  18. Profile
  19. Fees
  20. Vault
  21. Faucet
  22. Trader codes & rewards
  23. Market pulse

@0xmonaco/mcp-server

MCP server for the Monaco SDK — gives AI assistants access to the Monaco protocol on Sei.

Works in public-only mode with zero configuration. Add a private key to enable authenticated tools — scoped by a capability profile so that supplying a key does not blindly unlock the entire tool set.

Configuration

VariableRequiredDescription
MONACO_PRIVATE_KEYNoWallet private key (0x...) — enables authenticated tools
MONACO_CLIENT_IDWith MONACO_PRIVATE_KEYMonaco application client ID
MONACO_NETWORKWith MONACO_PRIVATE_KEYSet to mainnet. Must be explicit when a private key is set — the server refuses to default to mainnet for an authenticated session. Defaults to mainnet only for public-only mode.
MONACO_CAPABILITYNoread | market-maker | full. Authenticated default: read. See capability profiles.
MONACO_TOOL_ALLOWLISTNoComma-separated tool names to enable on top of the profile (explicit per-tool opt-in, e.g. a single fund-movement tool).
MONACO_TOOL_DENYLISTNoComma-separated tool names to disable. Wins over the profile and the allowlist.
MONACO_RPC_URLNoSei RPC URL (defaults per network)
MONACO_DELEGATED_OWNER_USER_IDNoRun on behalf of a delegated owner account. The MONACO_PRIVATE_KEY wallet is the agent; on startup it authenticates as itself, then adopts an owner-scoped session so every tool call acts on the owner (the agent wallet stays the session's actor for policy enforcement; orders carry the owner's wallet). Requires MONACO_PRIVATE_KEY + MONACO_CLIENT_ID. See delegated owner mode.

Capability profiles

MONACO_CAPABILITY bounds which authenticated tools the server registers. A tool that is not permitted by the active profile (and not named in MONACO_TOOL_ALLOWLIST) is never registered — this is an authorization control, not an advisory tool annotation.

ProfileTools enabled
readAuthenticated read-only queries — profile, balances, orders, movements, fee tier, vault allowance. No state changes. Default when authenticated — supplying a key alone grants no write authority.
market-makerread + order placement / cancel / replace. Opt in to let an agent make markets. No fund movement.
fullmarket-maker + fund movement and privilege mutations (vault approve/deposit/withdraw, transfer_rewards). Opt-in only.

Order placement, cancel, replace, and close require MONACO_CAPABILITY=market-maker or higher — the default read profile cannot mutate anything. Fund-movement and privilege tools additionally require full; enable them with MONACO_CAPABILITY=full, or opt a single tool in with MONACO_TOOL_ALLOWLIST (e.g. MONACO_TOOL_ALLOWLIST=vault_withdraw). Grant full only when you intend an agent to move funds — especially on mainnet.

Delegated owner mode

Set MONACO_DELEGATED_OWNER_USER_ID to act on behalf of a delegated owner account instead of the configured wallet's own account. The wallet in MONACO_PRIVATE_KEY is the agent: on startup it authenticates as itself, then adopts an owner-scoped delegated session (loginAsDelegatedOwner). Every subsequent tool call — reads and trades — acts on the owner account, with the agent wallet kept as the session's actor for policy enforcement. Orders placed this way carry the owner's wallet, not the agent's, so order history does not record the agent. The owner must have registered this agent wallet with an active delegation policy; the server cannot self-assert ownership, and adoption fails if the agent is not authorized for that owner.

This is fail-closed: MONACO_DELEGATED_OWNER_USER_ID requires MONACO_PRIVATE_KEY and MONACO_CLIENT_ID, a blank value is rejected, and if owner adoption fails the server does not fall back to trading as the agent's own account. Fund-movement tools still require the full capability, and delegated sessions cannot withdraw owner collateral. Raw delegated-session creation is intentionally not exposed as a tool — owner adoption is a startup option, not an autonomous agent action.

Networks

For public endpoints, set MONACO_NETWORK to mainnet:

NetworkAPI URLDefault RPC URL
mainnet (default)https://apimonaco.xyzhttps://evm-rpc.sei-apis.com

Installation

Add the following to your MCP config:

  • Cursor — ~/.cursor/mcp.json
  • Windsurf — ~/.codeium/windsurf/mcp_config.json
  • Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)

Public-only mode (no env vars needed)

Market data, orderbook, trades, and docs search — no wallet required.

{
  "mcpServers": {
    "monaco": {
      "command": "npx",
      "args": ["-y", "@0xmonaco/mcp-server"]
    }
  }
}

Authenticated mode

Authenticated read-only tools under the default read profile. MONACO_NETWORK is required here — the server will not default an authenticated session to mainnet.

{
  "mcpServers": {
    "monaco": {
      "command": "npx",
      "args": ["-y", "@0xmonaco/mcp-server"],
      "env": {
        "MONACO_NETWORK": "mainnet",
        "MONACO_PRIVATE_KEY": "0x...",
        "MONACO_CLIENT_ID": "your-client-id"
      }
    }
  }
}

Trading and fund movement stay off here. Add "MONACO_CAPABILITY": "market-maker" to place / cancel / replace orders, or "MONACO_CAPABILITY": "full" to also enable fund-movement tools (vault deposit/withdraw, transfer_rewards). A single fund-movement tool can be opted in with "MONACO_TOOL_ALLOWLIST": "vault_withdraw" instead of full. RPC URLs default automatically per network but can be overridden with MONACO_RPC_URL.

Tools

Public tools require no credentials. Authenticated tools require MONACO_PRIVATE_KEY, MONACO_CLIENT_ID, and MONACO_NETWORK, and are further gated by the active capability profile — the profile column shows the minimum profile each tool needs.

ToolProfileDescription
search_docsPublicSearch the Monaco documentation for protocol, SDK, trading, and development guides.

Market

ToolProfileDescription
get_trading_pairsPublicList trading pairs with optional filters (market type, base/quote token, active status).
get_trading_pair_by_symbolPublicLook up a trading pair by symbol (e.g. BTC/USDC).
get_candlesticksPublicFetch OHLCV candlestick data for a trading pair.
get_market_metadataPublicGet tick size, minimum order size, and trading rules for a pair.
get_screenerPublicScreen trading pairs with market stats (price, volume, change), filtered by market type, category, and active status.
get_market_statsPublicGet exchange-wide life-to-date cumulative volume and trade count across all markets.
get_trader_metricsPublicGet public current long/short account counts, account shares and ratio, plus active-trader counts for a margin pair. Accounts are classified by net position across open risk buckets. Small cohorts are suppressed; activity counts include system user IDs on liquidation and ADL fills.
get_trade_flowPublicGet bounded UTC-aligned taker buy/sell quote-notional buckets and cumulative volume delta for a margin pair, including liquidation and ADL fills.
list_liquidation_eventsPublicList paginated public per-fill liquidation events, including public wallets and quote-asset notional using each event's captured mark.
get_liquidation_metricsPublicGet bounded UTC-aligned long/short liquidation totals; event counts represent persisted rows and notionals use each row's event-time mark.

Perp market data

ToolProfileDescription
get_perp_market_configPublicGet a perpetual market's configuration (leverage limits, margin requirements, funding parameters).
get_perp_market_summaryPublicGet a perpetual market's live summary (mark/index price, funding rate, open interest, 24h stats).
get_mark_pricePublicGet the current mark price for a perpetual market.
get_index_pricePublicGet the current index (oracle) price for a perpetual market.
get_funding_statePublicGet the current funding rate and next funding time for a perpetual market.
get_open_interestPublicGet the current one-sided LONG open interest (each contract counted once) for a perpetual market.
get_funding_historyPublicList historical funding-rate records for a perpetual market.
get_all_funding_historyPublicList historical funding-rate records across all perpetual markets.

Orderbook

ToolProfileDescription
get_orderbookPublicFetch a current orderbook snapshot with bids and asks.

Trades

ToolProfileDescription
get_tradesPublicFetch historical trades for a trading pair.

Trading

Order reads (get_orders, get_order) are available under read; the mutations below require market-maker or higher.

ToolProfileDescription
place_limit_ordermarket-makerPlace a limit order with price, quantity, and time-in-force. The SDK supplies an idempotency key if omitted. Retain an explicit key to retry the same submission within 15 minutes of acceptance. Calling again without the original key is not idempotent; never retry an ambiguous failure with a new key. If the original key is unavailable, report the ambiguity.
place_market_ordermarket-makerPlace a market order — executes immediately inside a mandatory 1,000 bps protective price band, so it may partially fill or be rejected. The SDK supplies an idempotency key if omitted. Retain an explicit key to retry the same submission within 15 minutes of acceptance. Calling again without the original key is not idempotent; never retry an ambiguous failure with a new key. If the original key is unavailable, report the ambiguity.
replace_ordermarket-makerModify an existing order's price and/or quantity. Not idempotent — an ambiguous failure (timeout/network error/5xx with no order) cannot be resolved from inside MCP, which has no order-stream tool; never retry, and report the ambiguity instead.
cancel_ordermarket-makerCancel a single order by ID.
batch_cancel_ordersmarket-makerCancel multiple orders by ID (non-atomic — a failed leg does not stop the others).
batch_cancel_all_ordersmarket-makerCancel all open orders, optionally filtered to a trading pair (unfiltered, it cancels your entire open-order book).
cancel_all_aftermarket-makerArm, refresh or disarm a dead man's switch that cancels your resting orders unless you call again before the timeout (0 disarms).
batch_close_all_positionsmarket-makerClose all open perpetual positions with market reduce-only orders (best-effort, optional pair-set and side filters).
get_ordersreadList your orders with optional filters.
get_orderreadGet details for a specific order by ID.

Positions

Position reads are available under read; close_position requires market-maker, and margin add/reduce move collateral and require full.

ToolProfileDescription
get_positionsreadList your perpetual positions with optional filters (margin account, trading pair, status).
get_positionreadGet details for a specific perpetual position by ID.
get_position_riskreadGet liquidation price, margin ratio, and risk metrics for a perpetual position.
get_position_historyreadList historical (closed/reduced) perpetual position records with optional filters.
get_position_pnl_historyreadGet the PnL history time series for a perpetual position over an interval.
close_positionmarket-makerClose a perpetual position with a market, limit, or IOC reduce order.

Portfolio

ToolProfileDescription
get_portfolio_summaryreadGet your authoritative portfolio summary (equity, PnL, exposure) over a period.
get_portfolio_performancereadGet your portfolio performance time series over a period.
get_portfolio_realized_pnlreadGet your realized PnL breakdown over a period.
get_portfolio_assetsreadGet your per-asset portfolio allocation and balances over a period.
get_portfolio_marginreadGet your portfolio margin overview (collateral, maintenance margin, health).

Margin accounts

Reads and risk simulations are available under read; collateral transfers move funds and require the full profile (or an explicit allowlist entry).

ToolProfileDescription
get_margin_accountsreadList your margin accounts with optional filters (state, trading pair).
get_parent_margin_account_summaryreadGet your parent (cross) margin account summary.
get_available_collateralreadGet available (unlocked) collateral for allocating to margin accounts or risk buckets.
get_parent_margin_account_movementsreadList collateral movements for your parent (cross) margin account.
simulate_parent_margin_order_riskreadPreview the risk impact of a prospective order against your parent (cross) margin account (read-only simulation).
simulate_risk_bucket_order_riskreadPreview the risk impact of a prospective order for a new or existing risk bucket (read-only simulation).
transfer_collateral_to_parent_margin_accountfullMove collateral from spot into your parent (cross) margin account.
transfer_collateral_from_parent_margin_accountfullMove collateral out of your parent (cross) margin account back to spot.
transfer_collateral_to_risk_bucketfullAllocate collateral into an isolated or cross risk bucket.
transfer_collateral_to_sub_accountfullMove collateral from your default (parent) margin account into one of your margin sub-accounts.
transfer_collateral_from_sub_accountfullMove collateral from one of your margin sub-accounts back to your default (parent) margin account.

Profile

ToolProfileDescription
get_profilereadFetch your core profile (address, username, account type, withdrawal status).
get_balancesreadList token balances with pagination.
get_balance_by_assetreadGet balance for a specific asset.
get_movementsreadFetch transaction and movement history with optional filters.
get_user_tradesreadList your own trade fills with optional filters and cursor pagination.
get_funding_paymentsreadList your perpetual funding payments with optional filters (trading pair, position, margin account).

Fees

ToolProfileDescription
get_fee_schedulePublicGet a trading pair's fee tier schedule: volume thresholds and maker/taker bps per tier (no credentials required).
simulate_feesreadSimulate fees for an order before placing it.
get_my_fee_tierreadGet your current fee tier, why your rate applies (rateSource), your effective maker and taker rates on a pair, rolling 14-day volumes, and the pair's fee schedule.

Vault

Fund-movement tools require the full profile (or an explicit allowlist entry); the allowance and pending-withdrawal reads are available under read.

ToolProfileDescription
vault_approvefullApprove the vault contract to spend a token.
vault_depositfullDeposit tokens into the vault (optional target: spot default, or margin to route into collateral).
vault_withdrawfullWithdraw tokens from the vault.
vault_get_allowancereadCheck current token allowance for the vault.
vault_needs_approvalreadCheck whether an approval transaction is needed before depositing.
get_pending_withdrawalsreadList your pending withdrawals still awaiting on-chain root confirmation.

Faucet

Testnet only — the faucet tools are never registered on mainnet.

ToolProfileDescription
request_faucetmarket-maker (non-mainnet)Request test tokens for all trading pairs.
get_faucet_inforead (non-mainnet)Check remaining faucet quota, next-request time, and recent mint history.

Trader codes & rewards

ToolProfileDescription
get_trader_code_infoPublicLook up a trader code's details (no credentials required).
check_trader_code_availabilityPublicPublic advisory check of whether a custom TraderCode handle is available (no credentials required).
get_my_trader_codereadFetch your own trader code.
set_trader_codemarket-makerClaim or edit your custom (vanity) TraderCode handle.
clear_trader_codemarket-makerClear your custom TraderCode handle, reverting to the wallet-derived default.
get_rewards_balancereadFetch your TraderCodes rewards-bucket balances across reward tokens.
transfer_rewardsfullMove your earned TraderCodes rewards from the rewards bucket into your own tradeable balance (ledger-only).

Market pulse

ToolProfileDescription
get_pulsePublicGet the latest market-pulse news feed: AI-synthesized, per-asset headlines with sentiment tags.

This inventory is generated from the tool manifest. Do not edit it by hand — edit src/manifest.ts and run bun run mcp-docs:gen.

版本与发布记录

@0xmonaco/mcp-server 共发布 180 个版本,首次发布于 2025/08/28;过去 12 个月发布了 174 个版本。

版本发布日期距今
1.1.9latest2026/11/071 天前
1.1.82026/11/061 天前
1.1.72026/11/052 天前
1.1.62026/11/053 天前
1.1.5-prerelease.de852e2prerelease-1.1.62026/11/044 天前
1.1.5-develop.129b2c6develop2026/11/044 天前

其他发布通道:prerelease-1.0.40 → 1.0.39-prerelease.19d492d,develop → 1.1.5-develop.129b2c6,prerelease-1.1.6 → 1.1.5-prerelease.de852e2。

关于 @0xmonaco/mcp-server 的常见问题

@0xmonaco/mcp-server 是什么?

MCP server for the Monaco SDK

如何安装 @0xmonaco/mcp-server?

在项目目录运行 npm install @0xmonaco/mcp-server,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mcp-server,可以用 npx mcp-server 直接运行。

@0xmonaco/mcp-server 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/0xmonaco__mcp-server 是否存在。

@0xmonaco/mcp-server 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@0xmonaco/mcp-server 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@0xmonaco/mcp-server 可以商用吗?

@0xmonaco/mcp-server 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@0xmonaco/mcp-server 的下载量有多少?

根据 npm 官方下载统计,@0xmonaco/mcp-server 在 2026/10/04 – 2026/11/02 这 30 天内被下载 5,985 次,日均约 200 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@0xmonaco/mcp-server 还在维护吗?

最新版本 1.1.9 发布于 2026/11/07(1 天前);至今共发布 180 个版本,其中过去 12 个月发布了 174 个;首次发布于 2025/08/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。