Dagon Inference
OfficialEnables buying Dagon Inference credits with USDC on Solana, including validated wallet-signed or fee-sponsored transactions submitted through a configured Solana RPC and confirmed via purchase tools.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
Dagon Inference MCP server
A stdio Model Context Protocol server for Dagon Inference: list models, check a balance, create keys, buy credits with USDC on Solana, and chat.
MIT licensed.
Dagon Inference serves uncensored (abliterated) open-weight LLMs through an OpenAI-compatible API, paid with USDC on Solana. This server lets an MCP client (Claude Desktop, Claude Code, Cursor, ...) use it directly. Needs Node 22.18 or newer; no install step:
npx -y dagon-mcpGet an account key with the dagon_create_key tool or at https://inference.dagon.so.
No MCP client? An agent can pay per request with x402 instead: send
the request with no key, sign the USDC transfer the 402 asks for, retry, and keep the key returned in
x-dagon-key. No key, no SOL, no install beyond an x402 client such as @x402/fetch with @x402/svm. This server
does not pay with x402; it uses keys and the wallet purchase below.
Tools
Tool | What it does | Key |
|
| no |
|
| yes |
|
| no |
|
| yes |
|
| yes |
|
| yes |
Balance and chat use DAGON_API_KEY by default and accept an api_key argument. Purchases and confirmations never
accept an account override: they always use the server's configured DAGON_API_KEY, so a tool caller cannot redirect
a configured wallet's payment to another account.
Buying credits
dagon_buy_credits calls POST /v1/credits/purchase, then POST /v1/credits/purchase/confirm
(guide).
Before any gateway call, the amount must be at least DAGON_MIN_PURCHASE_USD (default $1), within
DAGON_MAX_PURCHASE_USD (per call, default $50), together with purchases this server process has already prepared
within DAGON_MAX_PURCHASE_USD_PER_SESSION (default $200), and together with everything prepared today (UTC) by any
server process sharing the spend ledger within DAGON_MAX_PURCHASE_USD_PER_DAY (default $200). Requests outside these
limits fail with a tool error and create nothing. Purchases the gateway did not create do not count. The session total
resets when the MCP server restarts; the daily total does not, because it is kept in DAGON_SPEND_LEDGER (default
%APPDATA%\dagon-mcp\spend-ledger.json on Windows, $XDG_CONFIG_HOME/dagon-mcp/spend-ledger.json or
~/.config/dagon-mcp/spend-ledger.json elsewhere; written with mode 0600 where supported). An unreadable or corrupt
ledger refuses purchases. DAGON_TREASURY_WALLET is required for every purchase, with or without a wallet.
When the gateway does not sponsor the network fee, the payer's worst-case SOL cost (5,000 lamports per signature, the
compute-budget priority fee, and 0.00203928 SOL rent whenever the transaction creates the treasury's USDC account) is
counted against DAGON_MAX_SOL_FEES per UTC day (default 0.05 SOL) in the same ledger; a purchase that would exceed it
is refused unsigned. An invalid limit stops the server at startup.
DAGON_WALLET_SECRET_KEYset:DAGON_API_KEYandDAGON_TREASURY_WALLETare also required. The server first proves that the returned transaction (legacy or v0 message) is exactly the payment the payment service builds: one USDCTransferCheckedof the requested amount from the configured wallet's associated token account to the configured treasury's associated token account, one SPL Memo whose data is thepurchase_id, and at most one idempotent creation of the treasury's USDC account whose rent is paid by the fee payer. It rejects mismatched response metadata, amounts, mint, token program, destination, memo, blockhash, fee-payer or signer roles, lookup tables, duplicate keys, unrelated instructions, accounts or writable authorities; a sponsor fee payer may appear in no instruction except as that rent payer. Only bounded Solana compute-budget instructions may also accompany the transfer. After validation it signs as the wallet. A fee-sponsored transaction carries no fee payer signature: the server does not submit it but sends it to the gateway's confirm assigned_transaction, and the payment service adds its fee payer signature and submits it. Otherwise it submits throughDAGON_SOLANA_RPC_URLand confirms with the signature. Either way it confirms the purchase for at most 45 seconds; past that it reports the purchase as pending. Once the payment may be on-chain, every result and error names thepurchase_idand the transaction signature (or, when fee sponsored, the signed transaction): do not buy again, pass them todagon_confirm_purchase. The wallet needs the USDC, and SOL for the fee only when the purchase is not fee sponsored. Give the client a tool timeout of at least 90 seconds; cancelling the tool call stops the wait.No wallet: pass
payer_wallet. The server runs the same byte-level validation withpayer_walletas payer and transfer authority, and only then returns the unsigned base64 transaction, naming the treasury it pays and the SOL it can cost. A transaction that fails validation is never returned. Sign it with that wallet before it expires, without rebuilding it. Whenfee_sponsoredis true, do not submit it: calldagon_confirm_purchasewithpurchase_idandsigned_transaction(the base64 wallet-signed transaction). Otherwise submit it, then calldagon_confirm_purchasewithpurchase_idand itssignature.
The secret key never leaves the server process and is never echoed, including in errors. At startup the server prints the derived payer address to stderr; check it is the wallet you meant. The trusted treasury address is configured independently rather than accepted from the gateway response. Use a dedicated hot wallet holding only what you intend to spend.
Every gateway and Solana RPC request is aborted after 30 seconds or when the client cancels the tool call, and gateway responses larger than 4 MiB are refused.
Related MCP server: trade-router-mcp
Configuration
Variable | Default | Purpose |
| none | Account key ( |
|
| Gateway URL. Must be |
| none | Solana secret key: 64-byte base58 (Phantom/Solflare export) or JSON byte array ( |
| none | Trusted Solana treasury owner whose USDC associated token account receives purchases. Required for any purchase and with |
|
| RPC for submitting signed purchases that are not fee sponsored (the payment service submits sponsored ones). |
|
| Smallest single |
|
| Largest single |
|
| Total USD of purchases one MCP server process may prepare. |
|
| Total USD of purchases per UTC day, persisted across restarts in the spend ledger. |
|
| Worst-case SOL (fees plus treasury account rent) unsponsored purchases may cost the payer per UTC day. |
| user config dir (see above) | File holding the daily totals. |
Install
Claude Code
claude mcp add dagon --env DAGON_API_KEY=gk_... -- npx -y dagon-mcpClaude Desktop
Add to claude_desktop_config.json (Settings → Developer → Edit Config); write the values themselves:
{
"mcpServers": {
"dagon": {
"command": "npx",
"args": ["-y", "dagon-mcp"],
"env": {
"DAGON_API_KEY": "gk_...",
"DAGON_TREASURY_WALLET": "9rMdbu4KdLWH2nPXbzhm9HTKaibGZ2ckakQbW1wPh6KK"
}
}
}
}On Windows, if npx is not found, use "command": "cmd", "args": ["/c", "npx", "-y", "dagon-mcp"].
Cursor
~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
{
"mcpServers": {
"dagon": {
"command": "npx",
"args": ["-y", "dagon-mcp"],
"env": { "DAGON_API_KEY": "gk_..." }
}
}
}Project .mcp.json, omp
Claude Code and omp expand ${VAR} from your environment, so secrets stay out of the file:
{
"mcpServers": {
"dagon": {
"command": "npx",
"args": ["-y", "dagon-mcp"],
"env": {
"DAGON_API_KEY": "${DAGON_API_KEY}",
"DAGON_WALLET_SECRET_KEY": "${DAGON_WALLET_SECRET_KEY:-}",
"DAGON_TREASURY_WALLET": "${DAGON_TREASURY_WALLET:-}"
},
"timeout": 120000
}
}
}timeout is omp's per-tool timeout in milliseconds; drop it for clients that do not use it.
Security
DAGON_WALLET_SECRET_KEYis optional. Without it the server never signs anything: it returns validated unsigned transactions for you to sign with your own wallet. With it, use a dedicated hot wallet holding only what you intend to spend; the key never leaves the process and is never echoed.DAGON_TREASURY_WALLETis the trust anchor for purchases: every transaction is checked byte-for-byte to pay exactly that treasury, so a compromised or spoofed gateway cannot redirect funds. The published Dagon treasury is9rMdbu4KdLWH2nPXbzhm9HTKaibGZ2ckakQbW1wPh6KK; take it from this README or https://inference.dagon.so, not from a tool result.Per-call, per-session and per-day USD caps and a daily SOL fee cap bound what any tool caller can spend.
Purchases always credit the configured
DAGON_API_KEY; a tool caller cannot redirect them to another account.
Development
git clone https://github.com/inkwell-finance/dagon-mcp.git
cd dagon-mcp
npm ci
npm run check # type-check
npm test # tool tests against a mocked fetch; no network
npm run build # compile to dist/License
MIT © Inkwell Finance, Inc. d/b/a Dagon
Available Tools
6 toolsdagon_balanceCheck Dagon credit balanceARead-onlyInspect
Show the credit balance of a Dagon account key in USD: total credits, total usage, available (GET /v1/credits).
Inputs: api_key.
dagon_buy_creditsBuy Dagon credits with Solana USDCADestructiveInspect
Buy credits for the configured Dagon account, paid in USDC on Solana. The server checks that the gateway's transaction is exactly the USDC payment to the configured treasury (DAGON_TREASURY_WALLET). If the MCP server has a wallet (DAGON_WALLET_SECRET_KEY), it then signs and confirms it (submitting it itself unless the purchase is fee sponsored, in which case the payment service adds the fee payer's signature and submits it). Otherwise it returns the verified unsigned transaction for payer_wallet to sign; then call dagon_confirm_purchase with signed_transaction (fee sponsored: do not submit it yourself) or with the signature of the transaction you submitted (not fee sponsored).
Inputs: amount_usd (required), chain, payer_wallet.
dagon_chatChat with a Dagon modelBInspect
Send a chat completion to a Dagon model (POST /v1/chat/completions, non-streaming) and return the reply. Spends credits.
Inputs: model (required), prompt, system, api_key, +3 more.
dagon_confirm_purchaseConfirm a Dagon credit purchaseAIdempotentInspect
Report a dagon_buy_credits payment you signed yourself so the configured account is credited (POST /v1/credits/purchase/confirm). Fee sponsored: pass signed_transaction, the base64 wallet-signed transaction, without submitting it (the payment service adds the fee payer's signature and submits it; resending the same one is safe). Not fee sponsored: submit it yourself and pass its signature.
Inputs: purchase_id (required), signature, signed_transaction.
dagon_create_keyCreate a Dagon API keyAInspect
Create a new Dagon account key (POST /v1/keys). The secret is shown only once: store it securely (e.g. as DAGON_API_KEY) and never paste it into shared chats or files under version control.
Inputs: name.
dagon_modelsList Dagon modelsARead-onlyInspect
List the models available on Dagon Inference, with their pricing (GET /v1/models). No API key needed.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct resource or step: model listing, balance, key creation, credit purchase, purchase confirmation, and chat. The only potential confusion is between dagon_buy_credits and dagon_confirm_purchase, but their descriptions make the two-phase payment flow (initiate vs. report signed transaction) explicit.
All tools share a dagon_ prefix and snake_case, with compound verb_noun names like dagon_create_key and dagon_confirm_purchase. Minor deviation: dagon_models and dagon_balance are bare nouns without a verb, breaking the otherwise consistent verb_noun pattern.
Six tools is well-scoped for an inference gateway: discover models, check balance, mint a key, buy credits, confirm payment, and chat. Each tool earns its place with no redundant operations.
The core lifecycle (discover → fund → authenticate → chat) is fully covered, including the tricky manual-signing purchase flow. Gaps exist around key management (no list/revoke/delete key) and chat is non-streaming only, but agents can work around these.
Maintenance
Related MCP Connectors
Open-model LLM inference for agents. Pay per call in USDC via x402 or API key. First call free.
247 LLMs + image/video/voice/music gen + crypto/DeFi/markets/web-search. Pay-per-call USDC, no key.
Marketplace where AI agents hire other agents, paid per call in USDC. Plus LLM inference.
Pay-per-call tools for AI agents, paid in USDC on Base or Solana. Web search, page and PDF reading, crypto news, Hyperliquid perps, market pulse, Chainlink price history, token checks, SEC filings, weather and more. Free calls every day, and a failed call costs nothing. Works with Tollkit Wallet.
Related MCP Servers
- AlicenseAqualityDmaintenanceUnified AI compute API gateway for agents. Access 30+ services and 95+ models across 8 backends (Groq, Together AI, DeepInfra, Fireworks, Replicate, RunPod) with native x402 USDC payments, Stripe, and crypto top-up.574 npm2MIT

trade-router-mcpofficial
AlicenseBqualityDmaintenanceNon-custodial Solana swap & limit order engine for AI agents. 21 tools - swap, limit, trailing, TWAP, DCA, combo orders - across Raydium, PumpSwap, Orca, Meteora. Jito MEV-protected execution. Ed25519-verified server messages. Private key never leaves the process.21259 npm3MIT- AlicenseNot gradedqualityDmaintenanceConnects AI agents to decentralized, community-built APIs on Solana, enabling autonomous discovery, payment, and execution of tools without subscriptions or API keys.5 npmMIT
- AlicenseBqualityDmaintenanceProvides 13 Solana DeFi intelligence tools for AI agents, paid per-call via micropayments (USDC). Enables pulling live DeFi data and automatic payment settlement.1383 npm2MIT