# Codebeamer MCP Server - Windows Setup Guide
## ๐ช Windows-Specific Setup for GitHub Copilot (VS Code)
This guide is specifically for running the Codebeamer MCP server on **Windows** with **GitHub Copilot in VS Code**.
---
## โ
Prerequisites
1. **Python 3.8+** installed on Windows
- Download from: https://www.python.org/downloads/
- โ
Check: `python --version` or `py --version`
2. **VS Code** with **GitHub Copilot** extension installed
- Download VS Code: https://code.visualstudio.com/
- Install GitHub Copilot extension from VS Code marketplace
3. **Git for Windows** (optional, for cloning)
- Download from: https://git-scm.com/download/win
---
## ๐ Step-by-Step Setup
### Step 1: Install Python Dependencies
Open **PowerShell** or **Command Prompt** in your project directory:
```powershell
cd "C:\path\to\Codebeamer MCP -opt"
```
Option A - Using pip:
```powershell
pip install -r requirements.txt
```
Option B - Using py launcher:
```powershell
py -m pip install -r requirements.txt
```
**Expected output:**
```
Successfully installed mcp-0.9.0 requests-2.31.0
```
---
### Step 2: Set Environment Variables (Windows)
#### Option A: PowerShell (Temporary - Current Session)
```powershell
$env:CODEBEAMER_URL = "https://your-codebeamer-instance.com"
$env:CODEBEAMER_API_KEY = "your-api-key-here"
$env:CODEBEAMER_MAX_CALLS = "60"
$env:CODEBEAMER_CACHE_TTL = "300"
```
#### Option B: Command Prompt (Temporary - Current Session)
```cmd
set CODEBEAMER_URL=https://your-codebeamer-instance.com
set CODEBEAMER_API_KEY=your-api-key-here
set CODEBEAMER_MAX_CALLS=60
set CODEBEAMER_CACHE_TTL=300
```
#### Option C: System Environment Variables (Permanent)
1. Press `Win + X` โ Select "System"
2. Click "Advanced system settings"
3. Click "Environment Variables"
4. Under "User variables", click "New"
5. Add each variable:
- Variable name: `CODEBEAMER_URL`
- Variable value: `https://your-instance.com`
6. Repeat for `CODEBEAMER_API_KEY`, `CODEBEAMER_MAX_CALLS`, `CODEBEAMER_CACHE_TTL`
7. Click OK and **restart VS Code**
#### Option D: Using .env file (Recommended)
Create a `.env` file in the project directory:
```env
CODEBEAMER_URL=https://your-codebeamer-instance.com
CODEBEAMER_API_KEY=your-api-key-here
CODEBEAMER_MAX_CALLS=60
CODEBEAMER_CACHE_TTL=300
```
Then install python-dotenv:
```powershell
pip install python-dotenv
```
---
### Step 3: Update HTTP Client in codebeamer_smart_tool.py
Open `codebeamer_smart_tool.py` and find line 135 (the `_make_api_call` method).
Replace the placeholder section (lines 171-190) with:
```python
# Make actual HTTP call (REPLACE THIS SECTION)
import requests
url = f"{self.base_url}{endpoint}"
headers = {
'Authorization': f'Bearer {self.api_key}',
'Content-Type': 'application/json'
}
print(f"๐ API Call: {method} {endpoint}")
self.stats['api_calls'] += 1
# ACTUAL HTTP CALL
response = requests.request(
method=method,
url=url,
headers=headers,
params=params,
json=body,
timeout=30
)
response.raise_for_status()
data = response.json()
# (Keep the rest of the method as-is)
```
---
### Step 4: Test the MCP Server
In PowerShell or Command Prompt:
```powershell
# Option 1: Using python
python mcp_server.py
# Option 2: Using py launcher
py mcp_server.py
# Option 3: Using absolute path
C:\Python311\python.exe mcp_server.py
```
**Expected output:**
```
โ
Codebeamer MCP Server initialized
URL: https://your-codebeamer-instance.com
Max calls/min: 60
Cache TTL: 300s
Tools: 12
```
If you see this, **the server works!** Press `Ctrl+C` to stop it.
---
### Step 5: Configure GitHub Copilot MCP Settings
GitHub Copilot uses MCP configuration in VS Code settings.
#### A. Find Python Path
First, find your Python executable path:
```powershell
# PowerShell
(Get-Command python).Path
# Or
where.exe python
# Or try py
where.exe py
```
Example outputs:
- `C:\Users\YourName\AppData\Local\Programs\Python\Python311\python.exe`
- `C:\Python311\python.exe`
#### B. Configure MCP in VS Code
1. Open VS Code
2. Press `Ctrl+Shift+P` โ Type "Preferences: Open User Settings (JSON)"
3. Add the MCP configuration:
```json
{
"github.copilot.advanced": {
"mcp": {
"servers": {
"codebeamer": {
"command": "C:\\Python311\\python.exe",
"args": [
"C:\\Users\\varunjain\\Codebeamer MCP -opt\\mcp_server.py"
],
"env": {
"CODEBEAMER_URL": "https://your-codebeamer-instance.com",
"CODEBEAMER_API_KEY": "your-api-key-here",
"CODEBEAMER_MAX_CALLS": "60",
"CODEBEAMER_CACHE_TTL": "300"
}
}
}
}
}
}
```
**โ ๏ธ IMPORTANT - Windows Path Rules:**
1. Use **double backslashes** (`\\`) or **forward slashes** (`/`)
2. Use **absolute paths** (not relative paths like `./`)
3. Replace `C:\\Python311\\python.exe` with YOUR Python path
4. Replace `C:\\Users\\varunjain\\...` with YOUR project path
#### C. Alternative: Create copilot-mcp-config.json
Some versions of GitHub Copilot use a separate config file. Create `.github-copilot/mcp-config.json`:
```json
{
"servers": {
"codebeamer": {
"command": "C:\\Python311\\python.exe",
"args": [
"C:\\Users\\varunjain\\Codebeamer MCP -opt\\mcp_server.py"
],
"env": {
"CODEBEAMER_URL": "https://your-codebeamer-instance.com",
"CODEBEAMER_API_KEY": "your-api-key-here"
}
}
}
}
```
---
### Step 6: Restart VS Code
After configuration:
1. Close VS Code completely
2. Reopen VS Code
3. Open your project
4. GitHub Copilot should now have access to the 12 Codebeamer tools
---
## ๐งช Testing the Integration
### Test 1: Check if Server Starts
In VS Code terminal:
```powershell
python mcp_server.py
```
Should see initialization message.
### Test 2: Use in GitHub Copilot Chat
Open GitHub Copilot Chat and try:
```
Find all open bugs in projects 123 and 456 using Codebeamer
```
or
```
@codebeamer query items with status 'Open' in project 123
```
GitHub Copilot should automatically use the `codebeamer_query_items` tool.
---
## ๐ Windows-Specific Troubleshooting
### Issue 1: "python is not recognized"
**Solution:** Python not in PATH. Use full path:
```powershell
C:\Python311\python.exe mcp_server.py
```
Or try the `py` launcher:
```powershell
py mcp_server.py
```
### Issue 2: "ModuleNotFoundError: No module named 'mcp'"
**Solution:** Install dependencies:
```powershell
pip install -r requirements.txt
```
Or:
```powershell
py -m pip install -r requirements.txt
```
### Issue 3: "CODEBEAMER_API_KEY environment variable is required"
**Solution:** Set environment variables (see Step 2).
Verify they're set:
```powershell
echo $env:CODEBEAMER_API_KEY # PowerShell
echo %CODEBEAMER_API_KEY% # Command Prompt
```
### Issue 4: Path with spaces not working
**Solution:** Use quotes in config:
```json
"command": "C:\\Program Files\\Python311\\python.exe",
"args": ["C:\\Users\\Varun Jain\\Codebeamer MCP -opt\\mcp_server.py"]
```
### Issue 5: FileNotFoundError for codebeamer_smart_tool
**Solution:** Ensure both files are in the same directory:
- `mcp_server.py`
- `codebeamer_smart_tool.py`
Or add to PYTHONPATH:
```powershell
$env:PYTHONPATH = "C:\Users\varunjain\Codebeamer MCP -opt"
```
### Issue 6: GitHub Copilot not detecting MCP server
**Solutions:**
1. Check VS Code version (need recent version with MCP support)
2. Update GitHub Copilot extension
3. Check extension settings for MCP configuration location
4. Try workspace settings instead of user settings
5. Check VS Code Output panel โ GitHub Copilot for errors
---
## ๐ Windows File Structure
```
C:\Users\varunjain\Codebeamer MCP -opt\
โ
โโโ mcp_server.py # MCP server (must be in same dir)
โโโ codebeamer_smart_tool.py # Core tool (must be in same dir)
โโโ requirements.txt # Dependencies
โ
โโโ README.md # Main readme
โโโ SETUP_GUIDE.md # Original setup guide
โโโ WINDOWS_SETUP.md # This file
โโโ ... (other documentation files)
```
---
## ๐ง Optional: Create Windows Batch Script
Create `start_server.bat` for easy testing:
```batch
@echo off
echo Starting Codebeamer MCP Server...
set CODEBEAMER_URL=https://your-instance.com
set CODEBEAMER_API_KEY=your-api-key
set CODEBEAMER_MAX_CALLS=60
set CODEBEAMER_CACHE_TTL=300
python mcp_server.py
pause
```
Then just double-click `start_server.bat` to test!
---
## โ
Verification Checklist
- [ ] Python 3.8+ installed
- [ ] Dependencies installed (`pip install -r requirements.txt`)
- [ ] Environment variables set
- [ ] HTTP client added to `codebeamer_smart_tool.py`
- [ ] Server starts successfully (`python mcp_server.py`)
- [ ] VS Code settings updated with correct paths (double backslashes!)
- [ ] VS Code restarted
- [ ] GitHub Copilot extension updated
- [ ] Can use tools in Copilot Chat
---
## ๐ฏ Quick Start Summary for Windows
```powershell
# 1. Install dependencies
pip install -r requirements.txt
# 2. Set environment variables
$env:CODEBEAMER_URL = "https://your-instance.com"
$env:CODEBEAMER_API_KEY = "your-key"
# 3. Test server
python mcp_server.py
# 4. Configure VS Code settings.json with double backslashes
# 5. Restart VS Code
# 6. Use tools in GitHub Copilot Chat!
```
---
## ๐ Need Help?
- **Environment variables not working?** โ Use System Environment Variables (Option C)
- **Python path issues?** โ Use `where.exe python` to find correct path
-**VS Code not detecting MCP?** โ Update GitHub Copilot extension, check Output panel
- **Server crashes?** โ Check Python version (`python --version`), should be 3.8+
---
## ๐ What You Get on Windows
โ
**12 efficient MCP tools** working in GitHub Copilot
โ
**70-98% fewer API calls** to Codebeamer
โ
**Automatic caching** with 85%+ hit rate
โ
**Rate limiting protection** built-in
โ
**Works seamlessly** with GitHub Copilot Chat in VS Code
---
**Status:** โ
Ready for Windows!
**Next:** Follow steps above, configure VS Code, restart, and start using!