🤖 Copilot Chat MCP Extension
A VS Code extension that integrates with GitHub Copilot Chat to provide multiplication functionality using the MCP server.
🎯 What This Does
This extension allows you to:
- Type in Copilot Chat:
@mcp-calculator multiply 6 and 7
- Get instant results:
6 × 7 = 42
- All within Copilot Chat interface - no separate windows or popups
- Uses MCP server at
https://at-mcp-demo.dev.commandcentral.com/
🚀 Quick Start
Prerequisites
- VS Code with GitHub Copilot installed and active
- MCP Server available at
https://at-mcp-demo.dev.commandcentral.com/
Setup
Install dependencies:
npm install
Compile the extension:
npm run compile
Start the MCP server:
cd ../mcp-server-demo
npm start
Test in VS Code:
- Press F5 to launch Extension Development Host
- Open Copilot Chat (Ctrl+Alt+I)
- Type:
@mcp-calculator multiply 6 and 7
- See result: 6 × 7 = 42
💬 How to Use in Copilot Chat
Basic Usage
@mcp-calculator multiply 6 and 7
@mcp-calculator multiply 2.5 by 4
@mcp-calculator multiply 10 * 3
Get Help
@mcp-calculator help
Example Conversation
You: @mcp-calculator multiply 6 and 7
Bot: 🧮 Multiplication Result
6 × 7 = 42
✅ Calculated using MCP server
You: @mcp-calculator multiply 2.5 by 4
Bot: 🧮 Multiplication Result
2.5 × 4 = 10
✅ Calculated using MCP server
🛠️ Features
- Natural language input: "multiply 6 and 7", "multiply 2.5 by 4"
- Multiple formats: "and", "by", "*" all work
- Error handling: Graceful handling when server is down
- Help system: Built-in help and examples
- Follow-up suggestions: Copilot suggests next actions
- Real-time validation: Checks if MCP server is available
Technical Details
Chat Participant
- ID:
mcp.calculator
- Name:
@mcp-calculator
- Description: MCP Calculator for mathematical operations
Supported Commands
- multiply: Multiply two numbers
- help: Show usage instructions
The extension recognizes these patterns:
multiply X and Y
multiply X by Y
multiply X * Y
- Where X and Y are numbers (including decimals)
Testing
Manual Testing
- Start MCP Server:
cd mcp-server-demo && npm start
- Launch Extension: Press F5 in VS Code
- Open Copilot Chat: Ctrl+Alt+I
- Test Commands:
@mcp-calculator multiply 6 and 7
@mcp-calculator multiply 2.5 by 4
@mcp-calculator help
Expected Results
- ✅ Multiplication: Shows result with calculation
- ✅ Error handling: Shows helpful message if server down
- ✅ Help: Shows usage instructions
- ✅ Follow-ups: Suggests related actions
🛡️ Error Handling
Server Not Running
❌ MCP Server not available
Please start the MCP server first:
cd mcp-server-demo
npm start
❓ I can help you multiply numbers!
Try: multiply 6 and 7 or multiply 2.5 by 4
Type help for more information.
Network Errors
❌ Error calling MCP server
[Detailed error message]
📁 Project Structure
copilot-chat-extension/
├── src/
│ └── extension.ts # Main extension logic
├── out/ # Compiled JavaScript
├── .vscode/
│ ├── launch.json # F5 debug config
│ └── tasks.json # Build tasks
├── package.json # Extension manifest
├── tsconfig.json # TypeScript config
└── README.md # This file
🔄 Integration with MCP Server
The extension communicates with the MCP server at:
- Manifest:
GET https://at-mcp-demo.dev.commandcentral.com/.well-known/mcp/manifest.json
- Multiply:
POST https://at-mcp-demo.dev.commandcentral.com/tools/MultiplyNumbers/invoke
Request Format:
{
"a": 6,
"b": 7
}
Response Format:
{
"result": 42
}
Troubleshooting
Copilot Chat Not Available
- Ensure GitHub Copilot is installed and activated
- Check VS Code version (requires 1.90.0+)
- Restart VS Code if needed
Extension Not Loading
- Check VS Code Extension Host output
- Verify compilation:
npm run compile
- Restart Extension Development Host
MCP Server Issues
- Verify server is accessible: Test at
https://at-mcp-demo.dev.commandcentral.com/
- Check server logs for errors
- Test server directly:
Invoke-RestMethod -Uri "https://at-mcp-demo.dev.commandcentral.com/.well-known/mcp/manifest.json"
** Now you can use MCP tools directly in GitHub Copilot Chat!**