Back to Documentation
VS Code Integration
Use ContextFS with VS Code and GitHub Copilot
Prerequisites
- 1.VS Code - Version 1.85 or higher
- 2.GitHub Copilot - For AI-powered features
- 3.Python 3.9+ - Required for ContextFS
Installation
Install ContextFS CLI
pip install contextfsVS Code MCP Configuration
1. Create MCP config file
Create a .vscode/mcp.json in your workspace:
{
"servers": {
"contextfs": {
"command": "uvx",
"args": ["contextfs"]
}
}
}2. Alternative: User settings
Add to your VS Code settings.json:
{
"mcp.servers": {
"contextfs": {
"command": "uvx",
"args": ["contextfs"],
"env": {
"CONTEXTFS_DATA_DIR": "~/.contextfs"
}
}
}
}3. Reload VS Code
Reload the window (Cmd/Ctrl + Shift + P → Reload Window) to activate MCP.
GitHub Copilot Chat
With MCP configured, you can use ContextFS in Copilot Chat:
// In Copilot Chat
@contextfs search for authentication patterns
@contextfs save this decision about API structure
@contextfs what did we decide about error handling?Note: MCP support in VS Code Copilot is evolving. Check VS Code release notes for the latest features.
Terminal Integration
Use ContextFS directly in VS Code's integrated terminal:
# Initialize your project
contextfs index index init
# Index your codebase
contextfs index index
# Search for context
contextfs memory search "API design patterns"
# Save a memory
contextfs memory save "Using REST for public API" --type decisionEnvironment Variables
Configure ContextFS behavior in your MCP config:
{
"servers": {
"contextfs": {
"command": "uvx",
"args": ["contextfs"],
"env": {
"CONTEXTFS_DATA_DIR": "~/.contextfs",
"CONTEXTFS_LOG_LEVEL": "INFO",
"CONTEXTFS_CHROMA_HOST": "localhost",
"CONTEXTFS_CHROMA_PORT": "8000"
}
}
}
}Next Steps
Get the most out of ContextFS in VS Code:
- • Set up workspace-specific config in
.vscode/mcp.json - • Index your project:
contextfs index index - • Enable cloud sync for cross-device access