Overview
Visual Studio Code supports the Model Context Protocol through its AI assistant features, enabling real-time security scanning during development. This integration allows developers to identify and fix security issues as they write code.
Prerequisites
- Visual Studio Code v1.102 or later
- GitHub Copilot subscription
- Prisma AIRS MCP server running and accessible
Quick Start
- Create
.vscode/mcp.json
in your project root - Add the Prisma AIRS server configuration
- Open VS Code and start using security tools
Configuration Methods
Option 1: Workspace Settings (Recommended for Teams)
Create a .vscode/mcp.json
file in your workspace to configure the Prisma AIRS MCP server for a workspace and share configurations with team members.
- Create a
.vscode/mcp.json
file in your workspace root - Add the following configuration:
{
"servers": {
"prisma-airs": {
"url": "YOUR_PRISMA_AIRS_URL",
"type": "http"
}
},
"inputs": []
}
Replace YOUR_PRISMA_AIRS_URL
with your server endpoint:
Environment | URL Example |
---|---|
Local Development | http://localhost:3000 |
Docker (default) | http://localhost:3000 |
Docker (custom port) | http://localhost:3100 |
Production | https://airs.example.com |
Option 2: User Settings (For Individual Use)
To configure the Prisma AIRS MCP server for all your workspaces:
- Run the command
MCP: Open User Configuration
from the Command Palette (Cmd/Ctrl + Shift + P
) - Add the Prisma AIRS server configuration to the opened
mcp.json
file
Option 3: Command Palette
- Open the Command Palette (
Cmd/Ctrl + Shift + P
) - Run
MCP: Add Server
- Choose the type of MCP server (HTTP)
- Provide the server information
- Select whether to add it to Workspace Settings or Global settings
Configuration Examples
Development Environment
{
"servers": {
"prisma-airs-dev": {
"url": "http://localhost:3000",
"type": "http"
}
},
"inputs": []
}
Production Environment
{
"servers": {
"prisma-airs-prod": {
"url": "https://airs.example.com",
"type": "http"
}
},
"inputs": []
}
Using Security Tools
Available Tools
Once connected, these Prisma AIRS security tools become available:
Tool Name | Description |
---|---|
airs_scan_content |
Real-time security scanning |
airs_scan_async |
Batch content scanning |
airs_get_scan_results |
Retrieve scan results |
airs_get_threat_reports |
Detailed threat analysis |
airs_clear_cache |
Clear server cache |
Accessing Tools in VS Code
- Open the Chat view:
Ctrl/Cmd + Shift + I
- Select Agent mode from the dropdown
- Click the Tools button to see available tools
- Select the Prisma AIRS tools you need
Example Workflows
Security Code Review:
Can you review this function for security vulnerabilities using the Prisma AIRS tools?
API Input Validation:
Please scan this API endpoint input for potential injection attacks.
Data Handling Check:
Check if this code properly handles sensitive data according to security policies.
Server Management
Viewing Server Status
- Open Extensions view:
Ctrl/Cmd + Shift + X
- Find MCP SERVERS - INSTALLED section
- Locate your Prisma AIRS server
Available Actions
Action | Description | How to Access |
---|---|---|
Start/Stop | Control server connection | Right-click → Start/Stop |
View Logs | See server output | Right-click → Show Output |
Check Config | Review current settings | Right-click → Show Configuration |
Browse Resources | See available resources | Right-click → Browse Resources |
Remove | Uninstall server | Right-click → Uninstall |
Troubleshooting
Common Issues
Server Not Connecting
Symptoms: Tools not appearing, connection errors
Solutions:
-
Verify server is running:
# Check server health curl http://localhost:3000/health # For Docker deployments docker ps | grep prisma-airs
-
Check VS Code MCP logs:
- Extensions view → MCP Servers → Right-click → Show Output
-
Verify configuration file syntax:
# Validate JSON cat .vscode/mcp.json | jq .
Tool Limit Exceeded
Error: “Cannot have more than 128 tools per request”
Solution: Disable unused MCP servers:
- Open Chat view → Tools picker
- Deselect unnecessary tools/servers
- Keep only required Prisma AIRS tools active
Permission Issues
Symptoms: MCP features disabled
Solutions:
- Check organization policies for MCP support
- Verify GitHub Copilot subscription is active
- Contact IT if MCP is disabled by policy
Best Practices
-
Environment Naming
- Use descriptive names:
prisma-airs-dev
,prisma-airs-staging
- Helps prevent accidental connections to wrong environment
- Use descriptive names:
-
Team Collaboration
- Use workspace settings (
.vscode/mcp.json
) for shared configs - Commit MCP configuration to version control
- Document server URLs in README
- Use workspace settings (
-
Security
- Always use HTTPS for production servers
- Don’t commit sensitive URLs to public repositories
- Use environment-specific configurations
-
Performance
- Limit active tools to those you need
- Monitor rate limits through server resources
- Use caching effectively
Integration Examples
Pre-commit Security Check
// In .vscode/tasks.json
{
"label": "Security Scan",
"type": "shell",
"command": "echo 'Run Prisma AIRS scan on staged files'",
"problemMatcher": []
}
Code Review Workflow
- Open PR in VS Code
- Use Copilot with Prisma AIRS tools
- Ask: “Scan this PR for security issues”
- Review and address findings
Next Steps
- Explore available security features
- Review security best practices
- Set up CI/CD integration