VS

VS Code AI Model Detector for MCP Server

Detect and classify AI models used by GitHub Copilot and other extensions in real time with VS Code, leveraging native storage and settings on your MCP server.

Overview

VS Code AI Model Detector is a Visual Studio Code extension that detects which AI model is currently being used by GitHub Copilot and other AI-driven extensions. It inspects VS Code’s native application storage (state.vscdb) and settings to identify model identifiers, normalize their format, and classify them by vendor, family, and capabilities. Detection runs in real time and can be polled or monitored continuously.

This extension is useful for security, auditing, telemetry, and integration with a Model Context Protocol (MCP) server. By reporting the active model and its metadata to your MCP endpoint, you can track model usage across developer machines, enforce compliance policies, or adapt tooling behavior dynamically.

Repository: https://github.com/thisis-romar/vscode-ai-model-detector

Features

  • Real-time detection of the active AI model used by VS Code extensions
  • Dynamic registry with 40+ known model IDs across OpenAI, Anthropic, Google, and others
  • Identification of model family, vendor, token limits, and special capabilities
  • Direct read access to VS Code SQLite storage for high-confidence detection
  • Live monitoring with configurable polling intervals
  • Works with VS Code Stable, Insiders, and VSCodium
  • Export or forward detection events to an MCP-compliant endpoint

Installation / Configuration

Install from the VS Code Marketplace or via the Extensions view.

Install via VS Code UI:

  1. Open Extensions (Ctrl+Shift+X)
  2. Search: AI Model Detector
  3. Click Install

Install from the Marketplace:

# opens Marketplace page in your browser
xdg-open "https://marketplace.visualstudio.com/items?itemName=thisis-romar.vscode-ai-model-detector"

Activate and use the extension programmatically from another extension or VS Code console:

const detectorExt = vscode.extensions.getExtension('thisis-romar.vscode-ai-model-detector');
if (!detectorExt) throw new Error('AI Model Detector not installed');
const api = await detectorExt.activate();

// Single detection
const result = await api.detectCurrentModel();
console.log(result.currentModel);

// Start monitoring every 5000 ms
const sessionId = await api.startModelMonitoring(5000);

// Stop monitoring later
await api.stopModelMonitoring(sessionId);

// Query capabilities
const info = await api.getModelCapabilities('claude-3.5-sonnet');
console.log(info.capabilities);

Configuration notes for MCP integration:

  • Ensure the extension can reach your MCP server (network and proxy rules).
  • Provide an MCP endpoint URL in your local settings or forward events from your own code.
  • On systems with multiple VS Code installs, verify which state.vscdb the extension reads (Stable / Insiders / VSCodium).

Example: forwarding detection to an MCP server (simple curl POST)

curl -X POST "https://mcp.example.com/v1/model-events" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "vscode-host-123",
    "detectedModel": {
      "id": "claude-3.5-sonnet",
      "vendor": "Anthropic",
      "family": "Claude",
      "maxTokens": 20000
    },
    "timestamp": "2026-04-10T12:34:56Z"
  }'

Available Resources

  • GitHub repository: https://github.com/thisis-romar/vscode-ai-model-detector
  • Marketplace: https://marketplace.visualstudio.com/items?itemName=thisis-romar.vscode-ai-model-detector
  • Model ID mapping references: mirrors VS Code Chat Model enums (microsoft/vscode-copilot-chat)

Supported model families include GPT (OpenAI), O-series, Claude (Anthropic), Gemini (Google), and several vendor-specific variants. The extension maintains a registry that normalizes IDs and updates as new model identifiers are encountered.

Model Metadata (example)

FieldTypeDescription
idstringCanonical model identifier
namestringHuman-friendly name
vendorstringVendor name (OpenAI / Anthropic / Google / etc.)
familystringModel family (GPT / Claude / Gemini / …)
maxTokensnumberMaximum context length / token limit
capabilitiesstring[]Supported features (code-completion, reasoning, multimodal)
version?string?Optional version or release tag

Use Cases

  • Audit & Compliance: Log the active model per developer session to ensure only approved models are used.
  • Telemetry & Analytics: Aggregate model usage across teams to understand preferences and subscription utilization.
  • Dynamic Tooling: Adapt linting, prompts, or augmentation plugins based on model capabilities (e.g., use shorter prompts for smaller context windows).
  • Security Controls: Detect unexpected vendor or model switches and trigger alerts or automatic policy enforcement.
  • CI / Pre-commit Checks: In pre-commit hooks or developer onboarding scripts, validate that configured extensions are using approved models.

Concrete example — alert on disallowed vendor:

  1. Start model monitoring with a short polling interval.
  2. When the detector reports a model with vendor “Unknown” or “External”, POST the event to your MCP server.
  3. MCP server can then notify admins or revoke extension access.

How Detection Works (brief)

  • Reads VS Code application SQLite (state.vscdb) for keys such as chat.currentLanguageModel.panel.
  • Parses the stored identifier and normalizes formatting (dots/hyphens).
  • Cross-references a dynamic registry to map ID → vendor/family/capabilities.
  • Returns a ModelInfo object with metadata and a confidence score based on storage source and, when available, Chat Participant API.

If you need to extend the registry or forward events in a specific format for your MCP implementation, use the extension API as an integration point and transform the returned ModelInfo to your MCP schema.