Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Mission: SolanaNew to Visual Studio Code? Get it now.
Mission: Solana

Mission: Solana

MissionSquad

|
2 installs
| (0) | Free
Intelligent all-in-one VS Code extension for Solana smart contract development
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Mission: Solana

An intelligent, all-in-one Visual Studio Code extension for Solana smart contract development

Mission: Solana streamlines the entire Solana development lifecycle with advanced language support, automated workflows, and integrated AI-powered contract generation via Mission Squad.

✨ Features

🤖 AI Contract Generator

  • Interactive Sidebar Interface: Generate complete Solana programs from natural language descriptions
  • Streaming Generation: Real-time code generation with live preview
  • Mission Squad Powered: Enterprise-grade AI specialized in Solana/Anchor development
  • Quick Generation: Command palette shortcut for instant contract generation
  • Save to Project: Direct integration with your workspace for seamless file creation

🎯 Sidebar-Integrated Workflow

Mission: Solana provides a comprehensive sidebar with four specialized views:

  1. Quick Actions: One-click access to build, test, and deploy commands
  2. AI Contract Generator: Interactive AI-powered contract generation interface
  3. Configuration: Manage cluster settings, wallet configuration, and AI API keys
  4. Project Setup: Project directory selection, dependency management, and project creation wizard

🔄 Automated Build System

  • Smart Build Detection: Automatically verifies build success by parsing output
  • Artifact Parsing: Extracts program ID, binary path, and deployment cost
  • Integrated Terminal: All operations visible in VS Code integrated terminal
  • State Management: Tracks build and test status across sessions

🛠️ Solana Language Server

  • Anchor-Aware Autocompletion: Intelligent code completion by parsing generated IDLs
  • Context-Sensitive Suggestions: Understands ctx.accounts.* patterns and provides relevant account completions
  • Automatic IDL Indexing: Silently builds your project to generate and parse IDL files for enhanced IntelliSense

💬 AI Development Assistant

  • Code Q&A: Ask questions about Solana development and get contextual answers
  • Security Auditing: Analyze code for Solana-specific vulnerabilities
  • Advanced Settings: Configure custom API endpoints and agent models
  • Workspace Context: AI understands your project structure and active code

🛡️ Advanced Quality Assurance

  • Dual-Linter System:
    • clippy for Rust best practices and common pitfalls
    • sec3 X-Ray for Solana-specific vulnerability detection
  • On-Save Analysis: Automatic linting when you save Rust files
  • Inline Diagnostics: Security issues and warnings displayed directly in your code

📦 Installation

Prerequisites

  • Visual Studio Code 1.85.0 or higher
  • Node.js 20.x or higher
  • Rust and Cargo (for Solana development)
  • Anchor CLI (for Anchor projects)
  • Solana CLI (for deployment)
  • sec3 X-Ray (optional, for enhanced security analysis)

Install from VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X or Cmd+Shift+X)
  3. Search for "Mission: Solana"
  4. Click Install

Install from Source

  1. Clone this repository
  2. Run npm install in the root directory
  3. Run npm install in both client/ and server/ directories
  4. Run npm run compile to build the extension
  5. Press F5 in VS Code to launch the extension in debug mode

🚀 Quick Start

1. Open Mission: Solana Sidebar

  • Click the Solana icon in the Activity Bar (left sidebar)
  • You'll see four views: Quick Actions, AI Contract Generator, Configuration, and Project Setup

2. Configure Your Project

In the Project Setup view:

  • Click "Select Existing Project" to choose your Solana project directory
  • Or click "Create New Project" to start a new project with templates
  • The extension will verify system dependencies (Rust, Solana CLI, Anchor)

In the Configuration view:

  • Set Cluster: Choose your target network (Devnet, Testnet, Mainnet, Localhost)
  • Configure Wallet: Browse, create, or import a Solana wallet keypair
  • Configure AI: Set your Mission Squad API key for AI features

3. Generate Smart Contracts with AI

In the AI Contract Generator view:

  1. Enter a description of your smart contract
    • Example: "Create a token staking program with reward distribution"
  2. Click "Generate Contract"
  3. Watch as the AI generates complete, production-ready code
  4. Click "Save to File" to add it to your project

Quick Generation from Command Palette:

  • Run Solana: Generate Contract (Quick)
  • Enter your description and the AI Contract Generator will open

4. Build, Test, Deploy

In the Quick Actions view:

  1. Click Build Program to compile your Solana program
    • The extension automatically detects success/failure
    • Program ID and artifacts are extracted automatically
  2. Click Run Tests to execute your test suite
  3. Click Deploy Program to deploy to your configured cluster
    • Includes safety checks for mainnet deployments
  4. Click Open Project in Terminal for manual commands
  5. Click View Build Artifacts to explore compiled binaries

5. Use AI Assistance

Ask AI Questions:

Command Palette → Solana: Ask AI
Example: "How do I create a PDA in Anchor?"

Audit Code for Security:

  1. Select code in your editor
  2. Run Solana: Audit Code
  3. View security analysis in a new document

Configure Advanced AI Settings:

  1. In Configuration view, click "Advanced Settings" (appears after API key is configured)
  2. Customize API endpoint and agent model name
  3. Save settings for enterprise or custom deployments

📖 Usage Guide

Sidebar Views

Quick Actions View

Provides instant access to essential development commands:

  • Build Program: Compiles using anchor build with automated success detection
  • Run Tests: Executes anchor test with terminal output
  • Deploy Program: Deploys to configured cluster with safety checks
  • Open Project in Terminal: Opens terminal in project directory
  • View Build Artifacts: Opens the target/deploy directory

AI Contract Generator View

Interactive interface for AI-powered contract generation:

  • Contract Description: Multi-line text area for detailed requirements
  • Example Prompts: Built-in examples to guide your descriptions
  • Streaming Generation: Real-time code generation with live updates
  • Copy/Save: Export generated code to clipboard or file
  • Configuration Status: Shows if Mission Squad API is configured

Configuration View

Centralized settings management with three sections:

Cluster Configuration:

  • Current cluster display (Devnet/Testnet/Mainnet/Localhost/Custom)
  • Change cluster with dropdown selection
  • Custom RPC URL support

Wallet Configuration:

  • Current wallet display with public key preview
  • Browse for existing wallet files
  • Create new wallet with automatic keypair generation
  • Import wallet from mnemonic or private key
  • Devnet airdrop support for new wallets

Mission Squad AI:

  • API status indicator (configured/not configured)
  • Configure API key via secure input
  • Advanced settings for custom endpoints and models

Project Setup View

Project and dependency management:

Project Directory:

  • Status indicator (configured/not set)
  • Select existing Anchor project
  • Create new project with template wizard:
    • Basic Anchor Program
    • Anchor Program with Tests
    • Anchor Program with Frontend
    • Multiple Programs Workspace
    • Native Solana Program

System Dependencies:

  • Rust & Cargo detection and installation
  • Solana CLI detection and installation
  • Anchor Framework detection and installation
  • Node.js detection
  • One-click installation helpers

Language Server Features

The Solana Language Server provides intelligent autocompletion for Anchor programs:

// Type 'ctx.accounts.' and get suggestions for all accounts in the instruction
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
    ctx.accounts.  // <-- Autocomplete shows: user, system_program, etc.
    Ok(())
}

The server automatically:

  1. Detects Anchor.toml in your workspace
  2. Runs anchor build in the background on initialization
  3. Parses the generated IDL from target/idl/
  4. Indexes all instructions and accounts for completion

AI Contract Generation

Best Practices for Prompts:

  • Be specific about functionality requirements
  • Mention account types and data structures needed
  • Specify security requirements (e.g., "with signer verification")
  • Include business logic details (e.g., "linear vesting over 30 days")

Example Prompts:

✅ Good: "Create a token staking program where users can stake SPL tokens
and earn rewards over time. Include functions for staking, unstaking,
and claiming rewards. Add admin functions to set reward rates."

❌ Too vague: "Make a staking program"

Generated Code Includes:

  • Complete Anchor program structure
  • Comprehensive error handling with custom error types
  • Detailed comments explaining logic
  • Security best practices (signer checks, ownership validation)
  • Proper account validation and constraints
  • Appropriate data types and account structures

Linting and Diagnostics

The extension automatically runs linters when you save Rust files:

Clippy (Rust best practices):

  • Detects unused variables, unnecessary allocations, etc.
  • Configurable via clippy.toml in your project

sec3 X-Ray (Solana security):

  • Detects Solana-specific vulnerabilities
  • Runs if x-ray is installed on your system
  • Gracefully skips if not available

Diagnostics appear inline in your code with severity levels:

  • 🔴 Error: Critical issues that must be fixed
  • 🟡 Warning: Potential issues or improvements
  • 🔵 Info: Suggestions and best practices

⚙️ Configuration

Workspace Settings

Per-project settings stored in VS Code workspace state:

  • solana.clusterUrl: RPC URL for the current cluster
  • solana.walletPath: Path to wallet keypair file
  • solana.programId: Last built program ID
  • solana.lastBuildSucceeded: Build status flag
  • solana.lastTestSucceeded: Test status flag
  • solana.projectDirectory: Configured project directory path

Global Settings

User-level settings stored in VS Code global state:

  • solana.missionSquadApiKey: Mission Squad API key for AI features
  • solana.missionSquadApiUrl: Custom API endpoint (default: https://agents.missionsquad.ai/v1/chat/completions)
  • solana.missionSquadAgentName: AI model/agent name (default: mission-solana)

VS Code Settings

Configure in settings.json:

{
  "solana.clusterUrl": "https://api.devnet.solana.com",
  "solana.walletPath": "/path/to/your/wallet.json",
  "solana.missionSquadApiUrl": "https://agents.missionsquad.ai/v1/chat/completions",
  "solana.missionSquadAgentName": "mission-solana"
}

🏗️ Architecture

Mission: Solana uses a client-server architecture with integrated AI:

┌─────────────────────────────────────┐
│   VS Code Extension (Client)        │
│   - Sidebar Views (4 TreeViews)     │
│   - AI Contract Generator (Webview) │
│   - Commands (Build/Test/Deploy)    │
│   - AI Provider (Mission Squad)     │
└──────────────┬──────────────────────┘
               │ LSP Protocol
┌──────────────▼──────────────────────┐
│   Language Server (Node.js)         │
│   - IDL Parser & Indexer            │
│   - Completion Provider             │
│   - Clippy Analyzer                 │
│   - X-Ray Analyzer                  │
└─────────────────────────────────────┘

Client (/client):

  • Extension activation and lifecycle management
  • Sidebar views: Quick Actions, AI Contract Generator, Configuration, Project Setup
  • Command implementations (build, test, deploy)
  • Webview UI for AI Contract Generator
  • Advanced AI Settings panel
  • Mission Squad AI integration

Server (/server):

  • Language Server Protocol implementation
  • Anchor IDL parsing and indexing
  • Code completion for Anchor contexts
  • Dual-linter integration (Clippy + X-Ray)

🧪 Development

Build from Source

# Install dependencies
npm install
cd client && npm install && cd ..
cd server && npm install && cd ..

# Compile TypeScript and copy webview assets
npm run compile

# Watch mode (for development)
npm run watch

# Run linter
npm run lint

# Run tests
npm test

Debug the Extension

  1. Open the project in VS Code
  2. Press F5 to launch Extension Development Host
  3. Set breakpoints in TypeScript files
  4. Test features in the development instance

Directory Structure

mission-solana/
├── .vscode/              # VS Code debug configuration
├── client/               # Extension client
│   └── src/
│       ├── ai/           # AI integration (Mission Squad)
│       ├── commands/     # Command implementations
│       ├── test/         # Extension tests
│       ├── ui/           # Sidebar views & webviews
│       │   ├── AdvancedAISettingsPanel.ts
│       │   ├── ConfigurationView.ts
│       │   ├── ContractGeneratorWebviewProvider.ts
│       │   ├── ContractGeneratorView.ts
│       │   ├── ProjectExplorerView.ts
│       │   ├── ProjectSetupView.ts
│       │   └── views/    # Webview HTML/CSS/JS
│       ├── utils/        # Utilities (wallet, project, shell)
│       └── extension.ts  # Entry point
├── server/               # Language server
│   └── src/
│       ├── analyzer/     # Linter integrations
│       ├── completion/   # Autocompletion
│       └── server.ts     # LSP server
├── package.json          # Extension manifest
└── README.md             # This file

🎨 Key Components

Webview Provider

  • ContractGeneratorWebviewProvider: Sidebar-embedded webview for AI contract generation
  • Static assets (JS/CSS) copied to client/out/ui/views/ during build
  • Two-way messaging between webview and extension for real-time interaction

TreeView Providers

  • ProjectExplorerViewProvider: Quick Actions tree
  • ConfigurationViewProvider: Settings management tree
  • ProjectSetupViewProvider: Project and dependency tree

Command System

  • Build Command: Automated build with output parsing for success detection
  • Test Command: Test execution with terminal integration
  • Deploy Command: Cluster-aware deployment with safety checks
  • AI Commands: Generate, ask, and audit with Mission Squad integration

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Run npm run lint to ensure code quality
  5. Run npm run compile to verify build
  6. Submit a pull request

📄 License

MIT License - see LICENSE file for details

🙏 Acknowledgments

  • Mission Squad: For providing AI agent infrastructure and contract generation capabilities
  • Anchor Framework: For the excellent Solana development framework
  • sec3: For X-Ray static analysis tool
  • Solana Foundation: For the Solana blockchain platform

🔗 Links

  • Mission Squad
  • Anchor Framework
  • Solana Documentation
  • sec3 X-Ray
  • VS Code Extension API

📝 Recent Updates (v0.3.3)

Refactoring & Improvements

  • Fixed AI Contract Generator: Resolved webview provider issue causing "No data provider registered" error
  • Improved Icon System: Replaced generic status icons with semantic action-specific icons
  • Removed Legacy Components: Eliminated duplicate Lifecycle Panel and Contract Generator Panel
  • Advanced AI Settings: New panel for configuring custom API endpoints and agent models
  • Automated Build Verification: Replaced manual confirmation with automated output parsing
  • Inline Contract Generation: Quick command palette access to AI contract generation

Breaking Changes

  • Removed solana.showLifecyclePanel command (functionality integrated into sidebar)
  • Removed solana.showContractGenerator command (use sidebar AI Contract Generator view)

Mission: Solana - Build secure Solana programs faster with AI-powered development tools.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft