vscode-ai-model-detector-mcp
v2.1.0
Published
Real-time VS Code AI model detection MCP server with SQLite3 storage analysis, per-chat context awareness, and 100% accuracy
Maintainers
Readme
AI Model Detector MCP Server
Real-time VS Code AI model detection MCP server with SQLite3 storage analysis, per-chat context awareness, and 100% accuracy.
🎯 Features
- Panel-Only Detection: Reads the authoritative
chat.currentLanguageModel.panelkey from VS Code's storage database - Real-time Results: Instantly surfaces the active model ID, vendor, and family with high confidence
- Zero Fallbacks: No heuristics or settings parsing—every answer is sourced from the panel configuration
- SQLite3 Storage Analysis: Direct queries against
state.vscdbensure reproducible evidence - Model Intelligence: Bundled model metadata enables capability lookups and validation workflows
- MCP Protocol: Standard Model Context Protocol interface for easy integration
📦 Installation
NPM (Global)
npm install -g @emblem-projects/ai-model-detector-mcpNPX (No Installation)
npx @emblem-projects/ai-model-detector-mcpClaude Desktop Configuration
Add to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"ai-model-detector": {
"command": "npx",
"args": [
"-y",
"@emblem-projects/ai-model-detector-mcp"
]
}
}
}Or use the local path (if installed globally):
{
"mcpServers": {
"ai-model-detector": {
"command": "node",
"args": [
"/path/to/node_modules/@emblem-projects/ai-model-detector-mcp/dist/index.js"
]
}
}
}Other MCP Clients
For VS Code with MCP support, add to mcp.json:
{
"servers": {
"ai-model-detector": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@emblem-projects/ai-model-detector-mcp"
]
}
}
}🛠️ Available Tools
1. detect_current_model
Detects the currently active AI model by reading VS Code's panel configuration.
Response includes:
- Model ID (e.g.,
copilot/gpt-5-codex) - Model family (Claude, GPT, Gemini, etc.)
- Vendor (Anthropic, OpenAI, Google, etc.)
- Detection source (
storage:panel) - Confidence score
Example:
{
"model": "copilot/gpt-5-codex",
"family": "gpt",
"vendor": "OpenAI",
"source": "storage:panel",
"confidence": "high"
}2. validate_model_access
Validates the panel detection pipeline and optionally returns the catalog of known models.
Response includes:
- Detection capability status
- Optional list of supported model definitions
- VS Code storage status summary
3. get_model_capabilities
Analyzes capabilities of a known AI model.
Parameters:
modelId: Model identifier to analyze
Response includes:
- Model family classification
- Vendor information
- Typical capabilities (context window, features)
4. monitor_model_changes
Starts monitoring for model changes.
Parameters:
interval: Monitoring interval in milliseconds (default: 5000)
🔧 Requirements
- Node.js: >= 18.0.0
- VS Code: >= 1.85.0 (for detection to work)
- Operating System: Windows, macOS, or Linux
📊 Detection Method
The MCP server performs a single, deterministic lookup:
- Panel Storage Query: Reads
chat.currentLanguageModel.panelfrom VS Code'sstate.vscdb
- Source:
storage:panel - Confidence: high (direct panel configuration)
- Failure Mode: Returns an explicit error if the key is missing
No editor, editing-session, or settings.json fallbacks are executed—every answer is grounded in the panel selection.
🚀 Usage Examples
With Claude Desktop
Once configured, ask Claude:
- "What model are we currently using?"
- "Detect the current AI model"
- "What models are available?"
Claude will use the MCP tools to provide accurate, real-time information.
Programmatic Access
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
const transport = new StdioClientTransport({
command: 'node',
args: ['node_modules/@emblem-projects/ai-model-detector-mcp/dist/index.js']
});
const client = new Client({
name: 'my-app',
version: '1.0.0'
}, {
capabilities: {}
});
await client.connect(transport);
// Detect current model
const result = await client.callTool({
name: 'detect_current_model',
arguments: {}
});
console.log(result);📝 Development
Building from Source
git clone https://github.com/emblem-projects/ai-model-detector-mcp.git
cd ai-model-detector-mcp
npm install
npm run buildTesting
# Run test detection
node test-storage-detection.js
# Test MCP server
node start.mjs🔒 Privacy & Security
- Local Only: All detection happens locally on your machine
- No External Calls: No data is sent to external services
- Read-Only: Only reads VS Code storage, never writes
- SQLite3 Safety: Uses proper SQLite3 binding with error handling
📄 Version History
2.1.0 (Current)
- Refactored to use RealVSCodeBridge for accurate detection
- Enhanced per-chat context awareness
- Improved error handling and logging
- Added comprehensive test suite
2.0.0
- Initial MCP server implementation
- Basic model detection via storage analysis
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📧 Support
- Issues: GitHub Issues
- Email: [email protected]
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built on the Model Context Protocol by Anthropic
- Uses @modelcontextprotocol/sdk
- Inspired by the need for accurate AI model detection in VS Code
Made with ❤️ by Emblem Projects
