Solana MCP server for Cursor: setup
Cursor's agent can call MCP tools while it writes code. With a Solana MCP server it can check a mint's decimals, read an account's owner or look at a failed transaction instead of guessing. This is the setup for a read-only server that cannot sign anything.
1. Pick the config file
| File | Applies to |
|---|---|
~/.cursor/mcp.json | every project on this machine |
.cursor/mcp.json in the project root | that project only (can be committed for the team) |
On Windows ~ is %USERPROFILE%, so the global file is C:\Users\<you>\.cursor\mcp.json.
2. Add the server
{
"mcpServers": {
"solana": {
"command": "npx",
"args": [
"-y",
"github:blixvip/solana-readonly-mcp"
],
"env": {
"SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com"
}
}
}
}
If the file already has an mcpServers object, add the solana entry next to the others. Node.js 20 or newer must be on your PATH. The first start downloads the package from GitHub, which takes a few seconds.
Windows
If Cursor shows the server as failed with an ENOENT error, start npx through cmd:
{
"mcpServers": {
"solana": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"github:blixvip/solana-readonly-mcp"
],
"env": {
"SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com"
}
}
}
}
3. Check that it loaded
Open Cursor Settings and find the MCP section. The solana server should be enabled and list nine tools: get_balance, get_token_accounts, get_account_info, get_transaction, get_signatures, get_token_supply_and_authorities, get_largest_token_holders, get_priority_fees and get_slot_and_health. If it shows an error, run the server by hand in a terminal to see the message:
npx -y github:blixvip/solana-readonly-mcp --help
4. Use your own RPC key (and keep it out of git)
The public endpoint is rate limited and refuses getTokenLargestAccounts. Put a provider URL with a key in SOLANA_RPC_URL, but only in the global ~/.cursor/mcp.json, never in a project file you commit:
{
"mcpServers": {
"solana": {
"command": "npx",
"args": [
"-y",
"github:blixvip/solana-readonly-mcp"
],
"env": {
"SOLANA_RPC_URL": "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY"
}
}
}
}
Two more settings exist: SOLANA_MCP_TIMEOUT_MS (default 15000) and SOLANA_MCP_RPS, the most requests per second the server sends (default 8). Lower SOLANA_MCP_RPS if you keep hitting 429s on a free plan.
Prompts that work well in Cursor
- "Read the mint
EPjFWdd5...and use its real decimals in this conversion function." - "This transaction failed in my tests:
5eJQVYWM.... Read it and tell me which instruction failed and why." - "Which program owns account
58oQChx4...? Write a type for its data." - "What priority fee are swaps through this pool paying right now? Use that as the default in this code."
Safety
The server has no key setting and refuses every RPC method that is not a read, so an agent running in auto mode cannot send a transaction through it. It can read anything public on chain, which is the point. The RPC URL is never printed, so a key in it does not end up in the chat or in logs.
Troubleshooting
- "Too many requests" or HTTP 429: the public RPC is throttling you. Use a keyed endpoint.
- "refused getTokenLargestAccounts": same cause; the public endpoint does not serve that method.
- Nothing happens on first start:
npxis downloading. Give it a few seconds, or install once withnpm install -g github:blixvip/solana-readonly-mcpand set"command": "solana-readonly-mcp"with no args.