Solana MCP server in VS Code and Windsurf: config files that work
VS Code and Windsurf both run MCP servers for their agents, but they use different file names and different top-level keys. Here are working configs for a read-only Solana server in each, with the RPC key kept out of anything you commit.
VS Code (GitHub Copilot agent mode)
Fastest: one command
code --add-mcp '{"name":"solana","type":"stdio","command":"npx","args":["-y","github:blixvip/solana-readonly-mcp"]}'
This adds the server to your user profile, so it is available in every workspace. It uses the public RPC.
Per workspace: .vscode/mcp.json
VS Code's file uses a servers key (not mcpServers) and a type on each server. The inputs block makes VS Code ask for the RPC URL the first time the server starts and store it securely, so the key is never written into the file and the file is safe to commit:
{
"inputs": [
{
"type": "promptString",
"id": "solana-rpc-url",
"description": "Solana RPC URL (leave empty for the public mainnet endpoint)",
"password": true
}
],
"servers": {
"solana": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"github:blixvip/solana-readonly-mcp"
],
"env": {
"SOLANA_RPC_URL": "${input:solana-rpc-url}"
}
}
}
}
Leave the prompt empty to use the public mainnet endpoint. Start the server from the Start link VS Code shows above it in the file, or with MCP: List Servers in the Command Palette. Then open Copilot Chat in agent mode; the nine solana tools appear in the tools picker.
Newer Copilot setups also read a workspace-root .mcp.json with the mcpServers layout shown below for Windsurf.
Windsurf
Windsurf reads ~/.codeium/windsurf/mcp_config.json (on Windows, %USERPROFILE%\.codeium\windsurf\mcp_config.json). You can open it from the Cascade panel's MCP settings. It uses the same mcpServers layout as Claude Desktop and Cursor:
{
"mcpServers": {
"solana": {
"command": "npx",
"args": [
"-y",
"github:blixvip/solana-readonly-mcp"
],
"env": {
"SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com"
}
}
}
}
On Windows, if the server fails to start with ENOENT, use "command": "cmd" and "args": ["/c", "npx", "-y", "github:blixvip/solana-readonly-mcp"]. Press refresh in the MCP panel after saving.
Windsurf's editor is now sold as Devin Desktop. There, the user-level file is ~/.config/devin/mcp_config.json and the project file is .devin/mcp_config.json; the mcpServers block above works unchanged.
Use your own RPC endpoint
The default is the Solana Foundation's free public endpoint, https://api.mainnet-beta.solana.com. It is rate limited and refuses getTokenLargestAccounts, so get_largest_token_holders fails there. The free plans of Helius, QuickNode, Alchemy and Triton serve everything; put the URL with its key in SOLANA_RPC_URL. Devnet works too: https://api.devnet.solana.com. The server never prints the URL, only its host.
Which key goes where
| Client | File | Top-level key |
|---|---|---|
| VS Code | .vscode/mcp.json or user mcp.json | servers (+ type: "stdio") |
| Windsurf | ~/.codeium/windsurf/mcp_config.json | mcpServers |
| Devin Desktop | ~/.config/devin/mcp_config.json | mcpServers |
| Cursor | ~/.cursor/mcp.json | mcpServers |
| Claude Desktop | claude_desktop_config.json | mcpServers |
Pasting a Cursor config into VS Code is the most common reason the server "does nothing": VS Code ignores mcpServers in .vscode/mcp.json.
Using another editor?
Zed, JetBrains and others run stdio MCP servers too. A config page for them is an open issue; if you use one, a pull request with a tested config is very welcome.