src/gaia/api/ | src/vscode/gaia/GAIA VSCode Integration
Overview
GAIA can be integrated with Visual Studio Code in two powerful ways:VSCode Extension
MCP Integration
VSCode Extension (API Server)
Overview
The GAIA VSCode extension integrates GAIA agents as selectable language models in Visual Studio Code, allowing you to use GAIA’s autonomous agents alongside GitHub Copilot and other language model providers.Features
- GAIA Code Agent: Autonomous Python development with planning, code generation, linting, and testing
- GAIA Jira Agent: Natural language interface for Jira operations
- Seamless Integration: Works with VSCode’s built-in model picker and Copilot Chat
- Local Processing: All inference runs locally on your AMD hardware via GAIA
Prerequisites
Install GAIA Framework
Start Lemonade Server
Install Node.js v20.19.x
- Windows
- Linux
Install GitHub Copilot Chat
Getting Started
Follow these steps in order:Start Lemonade Server (LLM Backend)
Start the GAIA API Server
http://localhost:8080 by default. Keep this terminal running.Build and Install the Extension
- Option A: Build and Install from VSIX
- Option B: Development Mode
gaia-vscode-0.1.0.vsix in the extension directory.Then install it:Next Steps
Next Steps
- Open a new instance of VSCode
- Open a directory (e.g.,
~/src/test) that you wish to test GAIA Code against in the new VSCode instance
Select a GAIA Model
- Open the VSCode Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Select “Chat: Manage Language Models…” or follow this guide
- Click on the model picker
- Select a GAIA model using Github Copilot Chat from the Secondary Side Bar
Use GAIA in Chat
Configuration
Access settings viaFile > Preferences > Settings and search for “GAIA”:
| Setting | Description | Default |
|---|---|---|
gaia.apiUrl | GAIA API server URL | http://localhost:8080 |
gaia.defaultModel | Default GAIA model to use | gaia-code |
Commands
The extension provides the following commands via the Command Palette:- GAIA: Manage API Server: Shows information about GAIA, configuration, and links to documentation
Architecture
LanguageModelChatProvider API to register GAIA as a language model provider.
Usage Examples
- Code Development
- Jira Operations
- Select GAIA code from the model picker
- In chat, type: “Create a function to calculate prime numbers”
- GAIA will:
- Create the function
- Generate tests
- Run linting
- Save files to your workspace
- Report file paths in the response
Troubleshooting
"Failed to connect to GAIA API server"
"Failed to connect to GAIA API server"
- Ensure the API server is running:
gaia api start - Check the server URL in settings matches where the server is running
- Verify the server is healthy:
curl http://localhost:8080/health
"No models available"
"No models available"
- Ensure Lemonade Server is running:
lemonade-server serve --ctx-size 32768 - The API server needs to be running before selecting models
- Check the GAIA output channel for error messages (View > Output > GAIA)
- Try restarting VSCode
Server Configuration Issues
Server Configuration Issues
- Update the
gaia.apiUrlsetting to match your server configuration - Restart the API server on the configured address
- Ensure firewall allows connections to the configured port
Agent-Specific Issues
Agent-Specific Issues
- Ensure Lemonade context size is 32768 or higher
- Check workspace has write permissions
- Ensure Jira is configured (see Jira documentation)
- Verify Jira credentials are set up correctly
MCP Client Integration
Overview
VSCode can also integrate with GAIA through the Model Context Protocol (MCP) server. This is an alternative approach that uses MCP client capabilities rather than the Language Model Provider API.Prerequisites
Install GAIA Framework
Start Lemonade Server
Start GAIA MCP Server
Getting Started
Start Lemonade Server
Start the GAIA MCP Server
http://localhost:8765 by default.Configure MCP Client
http://localhost:8765.Test Connection
Architecture
Available Tools
The MCP server exposes GAIA agents as tools:| Tool | Description |
|---|---|
gaia.chat | Conversational chat with context |
gaia.query | Direct LLM queries (no context) |
gaia.jira | Natural language Jira operations |
gaia.blender.create | 3D content creation |
Configuration
- MCP Server URL:
http://localhost:8765(default) - Protocol: JSON-RPC 2.0 + REST endpoints
Troubleshooting
Connection Issues
Connection Issues
- Verify MCP server is running:
gaia mcp status - Start server if needed:
gaia mcp start - Check server health:
curl http://localhost:8765/health
Tool Not Available
Tool Not Available
- List available tools:
curl http://localhost:8765/tools - Check server logs for errors
- Ensure required agent dependencies are installed
Extension Development
This section covers developing and testing the GAIA VSCode extension (API Server approach).Project Structure
Setup Development Environment
Install Dependencies
Compile TypeScript
Testing the Extension
Start Backend Services
Launch Extension Development Host
- Open the GAIA project root in VSCode
- Go to Run > Start Debugging (F5)
- Select “GAIA VSCode Extension (API)” from the launch configuration dropdown
- This opens a new VSCode window (Extension Development Host) with the extension loaded
.vscode/launch.json and automatically compiles TypeScript before launching. There are two configurations:- GAIA VSCode Extension (API) - For testing with the GAIA API server (port 8080)
- GAIA VSCode Extension (MCP) - For testing with the GAIA MCP server (port 8765)
Test the Provider
- Open Command Palette (
Ctrl+Shift+P) - Run “GAIA: Manage API Server” to see the About dialog
- Open any chat feature (e.g., Copilot Chat if available)
- Click the model picker
- Select a GAIA model (gaia-code or gaia-jira)
- Send a test message
Key Components
- Extension Activation
- Provider Implementation
- Package Configuration
- Registers the GAIA LanguageModelChatProvider
- Implements management command for About dialog
- Creates output channel for logging
API Integration
The extension communicates with the GAIA API server (see API documentation):GET /v1/models
Returns list of available GAIA models with metadata.POST /v1/chat/completions
Sends chat requests. Supports streaming via Server-Sent Events (SSE).Building for Distribution
Install VSCE
Package Extension
gaia-vscode-0.1.0.vsix.Install Locally
Debugging
Common Development Issues
Common Development Issues
-
“Failed to connect to GAIA API server” during development
- Check API server is running:
curl http://localhost:8080/health - Check
gaia.apiUrlsetting in Extension Development Host
- Check API server is running:
-
Models not appearing in picker
- Ensure API server returns models:
curl http://localhost:8080/v1/models - Check VSCode output channel for errors
- Restart Extension Development Host
- Ensure API server returns models:
-
Streaming not working
- Verify API server supports SSE streaming
- Check network tab in browser developer tools (if testing web)
-
TypeScript compilation errors
- Run
npm installto ensure dependencies are installed - Check
tsconfig.jsonconfiguration - Verify VSCode TypeScript version matches project
- Run
-
Extension not loading in debugger
- Ensure you selected the correct launch configuration: “GAIA VSCode Extension (API)”
- Check that pre-launch task compiled successfully
- Look for errors in Debug Console
Architecture Details
- Message Flow
- Model Discovery
Testing Checklist
Before submitting changes:- TypeScript compiles without errors:
npm run compile - Extension activates without errors
- Models appear in model picker
- Chat completions work (non-streaming)
- Streaming responses work
- About dialog displays correctly
- Settings are respected
- Error messages are clear and helpful
- Output channel shows useful logs
Contributing
When making changes to the extension:- Update TypeScript code in
src/ - Run
npm run compileto build - Test using the “GAIA VSCode Extension (API)” launch configuration
- Update this documentation if adding features
- Follow existing code style and patterns
- Ensure copyright headers are present
Comparison: Extension vs MCP Integration
| Feature | VSCode Extension (API) | MCP Integration |
|---|---|---|
| Integration Type | VSCode Extension | MCP Client |
| Protocol | OpenAI-compatible REST + SSE | JSON-RPC + REST |
| Port | 8080 | 8765 |
| Exposes | Agents as “models” | Agents as “tools” |
| Model Picker | ✅ Yes | ❌ No |
| Setup Complexity | Install extension | Configure MCP client |
| Launch Config | ”GAIA VSCode Extension (API)" | "GAIA VSCode Extension (MCP)“ |
| Best For | Language model provider workflow | MCP client workflow |
See Also
GAIA API Server
GAIA MCP Server
Code Agent
Jira Agent
- Development Guide - GAIA framework setup
- VSCode Language Model API - Official VSCode docs