Gemini CLI + Moby MCP (agent trading on Solana)
Your agent runs in Gemini CLI, and you manage it from your phone.
Your AI agent trades Solana tokens, including memes, majors and tokenized stocks (xStocks on Solana, like TSLAx), with your USDC, inside the limits you set.
AI Trading on Base, BNB Chain and Robinhood Chain is coming soon.
This page is for Gemini CLI (with a paid Gemini API key or enterprise access). It is the Gemini CLI piece of agentic trading on Moby. Gemini CLI runs the agent. The Moby app is where you set limits and revoke a key.
The Gemini CLI harness listing is the same host. Setup here uses the agent key as Authorization: Bearer.
Other clients: Codex, Claude Code and Grok CLI.
Add the Gemini CLI MCP server
-
Create a key in the Moby app
Download Moby. Open the Agent tab, tap Connect, and create a key. The key starts with moby_agent_. It links Gemini CLI to your Moby account. It is an agent API key, not a wallet private key. Do not paste it into chat. You can revoke it in the app.
-
Store the key in an environment variable
Paste the key into MOBY_API_KEY in the environment that starts Gemini CLI. Set it to the key itself, not the word Bearer. The block waits for you to paste the key; it never lands in your shell history. Do not write the key into settings.json or into a chat.
Paste the key at the prompt. The header below reads this variable.
# paste the key, press Enter; it never lands in your shell history read -rs MOBY_API_KEY && export MOBY_API_KEY -
Add Moby's streamable HTTP server
Merge the block below into mcpServers in ~/.gemini/settings.json. That file applies to every project. For one project, use .gemini/settings.json instead. httpUrl is the streamable HTTP field in the Gemini CLI MCP guide, and the URL is https://mcp.moby.win/mcp. The header value in the file is Bearer $MOBY_API_KEY. The configuration reference says string values in settings.json expand $MOBY_API_KEY when the file loads. The header Gemini sends is Authorization: Bearer moby_agent_... using the key from that variable. Do not pass the key to gemini mcp add --header. That command writes the header text it receives into settings.json, and a double-quoted $MOBY_API_KEY is expanded by the shell before the write.
Merge this into mcpServers. The file keeps $MOBY_API_KEY. Docs: httpUrl plus a headers object, and settings.json string expansion.
{ "mcpServers": { "moby": { "httpUrl": "https://mcp.moby.win/mcp", "headers": { "Authorization": "Bearer $MOBY_API_KEY" } } } }Your first trade
Check my Moby agent wallet balance and limits, then buy $10 of NVDAx and set a take-profit at +15% and a stop-loss at -10%.A 0.75% swap fee (minimum $0.90 per swap), plus onchain fees.
Agent buys have no automatic exits unless you ask for them, like this prompt does.
-
Confirm Gemini CLI sees the server
Run gemini mcp list. In Gemini CLI, type /mcp. If startup says MCP issues were detected, the same guide says to run /mcp list for status.
Gemini CLI documents this in the MCP server guide and the configuration reference. Skills are in Agent Skills.
Link your account and set limits
You set your agent's limits on max per trade, daily buy limit and market-cap range from the Moby app, and Moby checks them server-side on every buy. The agent trades Solana only, funded with USDC. There are no withdrawals through MCP.
The key from the Agent tab, Connect, is what links Gemini CLI to your Moby account. On first connect, Gemini CLI should call get_my_trading_profile and follow the onboarding on the agents page. Revoke the key there to turn it off. A profile saved by Gemini CLI cannot raise the app limits.
What to watch when an agent holds a key is on AI agent security.
Install Gemini CLI skills
Gemini CLI skills are folders with a SKILL.md file. The file starts with YAML frontmatter. The frontmatter needs a name and a description, and it has to be the first thing in the file. Gemini CLI discovers user skills in ~/.gemini/skills/ and ~/.agents/skills/, and workspace skills in .gemini/skills/ and .agents/skills/. In a session, /skills list shows them and /skills reload picks up a folder you just added. From the shell, gemini skills list lists discovered skills. Docs: Agent Skills and Creating Agent Skills.
Moby Knowledge is Moby's reference for how the agent works. Tell Gemini CLI: Read https://moby.win/agents.md and use it as your reference for Moby. To keep that as a skill, save this folder as ~/.gemini/skills/moby-knowledge/SKILL.md.
User skill folder. The skills guide says SKILL.md is the required file, with name and description in the frontmatter.
---
name: moby-knowledge
description: Use when researching or trading Solana tokens with Moby in Gemini CLI. Follow the Moby agent docs and the limits set in the app.
---
Read https://moby.win/agents.md and https://moby.win/marketplace/moby-knowledge/ and follow them. Trade Solana only, funded with USDC, inside the limits set in the Moby app. There are no withdrawals through MCP.Moby Starter Strategies ship with the Moby MCP connector. They are not a separate skill folder. After the server is connected, ask Gemini CLI to list Moby's starter strategies and recommend one. Pick a card, or say what to change, before it runs one.
Before a buy, use the rug-check skill. get_token_trade_brief is the one-call pre-buy read.
Example prompts
These prompts stay on Solana. A buy spends USDC only after you say yes. Nothing here promises a result.
Check risk before a buy
Check the risk of this Solana token before I buy it with USDC. Tell me if I should skip it.
Scan smart money
Scan Solana smart-money flows. List tokens tracked wallets are buying. Do not buy anything.
Guarded buy
If this Solana token fits my limits, prepare a buy of 10 USDC. Name the token, the contract, and the amount, and wait for my yes.
FAQ
How do I set the Moby key for Gemini CLI?
Export MOBY_API_KEY in the environment that starts Gemini CLI. Set it to the key itself, not the word Bearer. The read command waits for the paste and keeps it out of shell history. In settings.json, leave the header as Bearer $MOBY_API_KEY. The configuration reference expands that variable when the file loads. Do not put the key itself in the file.
How do I add an MCP server to Gemini CLI?
Add an mcpServers entry with httpUrl and a headers object. For Moby, httpUrl is https://mcp.moby.win/mcp and the header value stays Bearer $MOBY_API_KEY. User settings are ~/.gemini/settings.json. Then run gemini mcp list, or type /mcp in Gemini CLI.
How do I revoke the key?
Open the Moby app, go to the Agent tab, tap Connect, and revoke the key. That key stops working. Create a new one there if you want Gemini CLI to connect again.
What does the agent trade?
The agent trades Solana only, funded with USDC, inside the limits you set in the Moby app. The opening sentence on this page names what that covers. A buy spends real USDC from the agent wallet. There are no withdrawals through MCP.
Manage it from your phone
Set the limits in the Moby app, then come back to Gemini CLI. All download options.
More on Moby: agentic trading, all agents, the Gemini CLI listing, the Agent Marketplace, the Moby MCP listing, and AI agent security.
Setup for other clients: Codex, Claude Code and Grok CLI.