Diagnostics MCP Server

Diagnostics MCP Server

An HTTP MCP server providing AI agents with real-time access to all VS Code diagnostics (TypeScript, ESLint, Prettier, etc.) via 5 powerful tools including workspace health scoring.

Category
Visit Server

README

Diagnostics MCP Server

HTTP MCP server with 5 diagnostic tools providing real-time access to ALL VS Code diagnostics (TypeScript, ESLint, Prettier, and all installed extensions)

License: MIT Version

šŸŽÆ Overview

This Model Context Protocol (MCP) server provides AI agents with real-time access to all diagnostics from your VS Code workspace, including:

  • āœ… TypeScript/JavaScript errors and warnings
  • āœ… ESLint linting issues
  • āœ… Prettier formatting issues
  • āœ… All Language Servers (Python, Go, Rust, etc.)
  • āœ… All VS Code Extensions diagnostics
  • āœ… Real-time updates as you code

āš™ļø Configuration

The extension provides two configuration settings:

diagnostics-mcp-server.autoStart

  • Type: boolean
  • Default: true
  • Description: Automatically start HTTP MCP server when VS Code opens

To disable auto-start:

  1. Open VS Code Settings (Ctrl+,)
  2. Search for "diagnostics-mcp-server"
  3. Uncheck "Auto Start"
  4. Use the "Start HTTP MCP Server" command to start manually

diagnostics-mcp-server.port

  • Type: number
  • Default: 3846
  • Description: Port for HTTP MCP server

To change the port:

  1. Open VS Code Settings (Ctrl+,)
  2. Search for "diagnostics-mcp-server.port"
  3. Set your desired port number
  4. Restart the server or reload VS Code
  5. Update your MCP client configuration with the new port

šŸ“‹ Installation

Step 1: Install VS Code Extension

Install from VS Code Marketplace:

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Diagnostics MCP Server"
  4. Click Install

Latest Version: 1.0.12 - Complete HTTP MCP implementation with 5 diagnostic tools, enhanced error handling, and working commands

Step 2: Extension Auto-Start

The extension automatically starts the HTTP MCP server when VS Code opens. No additional setup required!

Server Details:

  • Protocol: HTTP with Server-Sent Events
  • Port: 3846 (automatically managed)
  • Startup: Automatic with VS Code

Step 3: Configure MCP Client

Add this to your MCP client configuration (e.g., Claude Desktop config or VS Code MCP settings):

{
  "mcpServers": {
    "diagnostics": {
      "type": "http",
      "url": "http://127.0.0.1:3846/mcp",
      "description": "VS Code diagnostics - all 5 tools (errors, warnings, info, health, all diagnostics)"
    }
  }
}

Verify Connection

  1. Check server status: Visit http://127.0.0.1:3846/health
  2. View logs: VS Code Output panel → "Diagnostics MCP Server"
  3. Test connection: Server automatically starts when VS Code opens

Available immediately after VS Code extension installation - no additional setup required!

Usage

Once configured, AI agents (like Claude, GitHub Copilot) can use these 5 MCP tools:

  1. get_all_diagnostics - Get complete diagnostic information from workspace
  2. get_errors - Get only error-level diagnostics
  3. get_warnings - Get only warning-level diagnostics
  4. get_info - Get only info-level diagnostics
  5. get_workspace_health - Get workspace health score (0-100)

šŸ”§ How It Works

This extension uses an HTTP MCP Server architecture:

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  AI Agent (Claude, GitHub Copilot)                 │
│  ↓                                                  │
│  HTTP MCP Protocol (port 3846)                     │
│  ↓                                                  │
│  VS Code Extension (HTTP MCP Server)               │
│  ↓                                                  │
│  vscode.languages.getDiagnostics() API             │
│  ↓                                                  │
│  ALL Diagnostics (TS, ESLint, Prettier, etc.)     │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Why Extension Required?

  • VS Code diagnostics are only accessible inside VS Code via the vscode module
  • The extension provides the bridge between VS Code APIs and the MCP server
  • This ensures you get ALL diagnostics from ALL sources, not just TypeScript

šŸ“¦ What's Included

  • HTTP MCP Server - Runs on port 3846 with Server-Sent Events
  • 5 Diagnostic Tools - Comprehensive workspace diagnostic access
  • 3 VS Code Commands - Start/Stop/Status server control
  • Real-time Updates - Live diagnostic monitoring
  • Health Scoring - Workspace quality metrics (0-100)

šŸ› ļø Development

Build from Source

git clone https://github.com/Maaz0313-png/Diagnostics-MCP.git
cd "Diagnostics MCP"
npm install
npm run compile

Test Locally

# Test the launcher
node index.js --help

# Test with a workspace
node index.js

šŸ“– API Reference - 5 MCP Tools

1. Tool: get_all_diagnostics

Get complete diagnostic information from workspace.

Returns:

{
  "total": 42,
  "diagnostics": [
    {
      "file": "src/app.ts",
      "line": 10,
      "column": 5,
      "severity": "error",
      "message": "Type 'string' is not assignable to type 'number'",
      "source": "ts"
    }
  ],
  "status": "found",
  "timestamp": "2025-10-02T10:30:00.000Z"
}

2. Tool: get_errors

Get only error-level diagnostics.

Returns:

{
  "count": 5,
  "diagnostics": [...],
  "severityLevel": "errors",
  "status": "found",
  "timestamp": "2025-10-02T10:30:00.000Z"
}

3. Tool: get_warnings

Get only warning-level diagnostics.

Returns:

{
  "count": 3,
  "diagnostics": [...],
  "severityLevel": "warnings",
  "status": "found",
  "timestamp": "2025-10-02T10:30:00.000Z"
}

4. Tool: get_info

Get only info-level diagnostics.

Returns:

{
  "count": 2,
  "diagnostics": [...],
  "severityLevel": "info",
  "status": "found",
  "timestamp": "2025-10-02T10:30:00.000Z"
}

5. Tool: get_workspace_health

Get workspace health score (0-100) based on diagnostics.

Returns:

{
  "healthScore": 85,
  "status": "good",
  "summary": {
    "errors": 2,
    "warnings": 5,
    "infos": 3,
    "total": 10
  },
  "timestamp": "2025-10-02T10:30:00.000Z"
}

Health Score Calculation:

  • Errors: -10 points each
  • Warnings: -3 points each
  • Info: -1 point each
  • Scale: 0-100 (100 = perfect health)
  • Status: excellent (90+), good (70+), fair (50+), poor (<50)

šŸŽ® VS Code Commands

Four commands available in Command Palette (Ctrl+Shift+P):

  1. šŸš€ Diagnostics MCP: Start HTTP MCP Server

    • Manually start the MCP server
    • Use if server didn't auto-start or autoStart is disabled
  2. šŸ›‘ Diagnostics MCP: Stop HTTP MCP Server

    • Stop the running MCP server
    • Useful for troubleshooting
  3. šŸ”„ Diagnostics MCP: Restart HTTP MCP Server

    • Restart the MCP server (stop + start)
    • Use after changing configuration settings (port, etc.)
  4. šŸ“Š Diagnostics MCP: MCP Server Status (5 Tools + Health)

    • View server status, current diagnostics count, and health score
    • Quick health check of your workspace

šŸ¤ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

šŸ“„ License

MIT License - see LICENSE file for details

šŸ”— Links

āš ļø Troubleshooting

"MCP server not connecting"

  1. Check server status: Visit http://127.0.0.1:3846/health
  2. View logs: VS Code Output panel → "Diagnostics MCP Server"
  3. Restart server: Use command "Diagnostics MCP: Start HTTP MCP Server"
  4. Reload VS Code window: Ctrl+Shift+P → "Reload Window"

"Port 3846 already in use"

  1. Stop other applications using port 3846
  2. Or change port in VS Code settings: diagnostics-mcp-server.port
  3. Use "Restart HTTP MCP Server" command or reload VS Code
  4. Update your MCP client config with the new port

"No diagnostics returned"

  1. Open a workspace with code files
  2. Wait for language servers to initialize
  3. Check VS Code's Problems tab for diagnostics

šŸ“ Version History

1.0.14 (Current)

  • āœ… Configuration settings support (autoStart, port)
  • āœ… Restart command for easy server restart
  • āœ… Configurable port number
  • āœ… Optional auto-start disable

1.0.12-1.0.13

  • āœ… Complete HTTP MCP server implementation
  • āœ… 5 specialized diagnostic tools
  • āœ… Enhanced error handling and connection stability
  • āœ… Working VS Code commands (Start/Stop/Status)
  • āœ… Comprehensive tool documentation in metadata
  • āœ… Beautiful diagnostic icon
  • āœ… Full workspace health scoring

1.0.11

  • āœ… Enhanced connection stability for empty diagnostics
  • āœ… HTTP transport implementation

1.0.10

  • āœ… Added severity-specific tools (get_errors, get_warnings, get_info)

1.0.0 (Initial Release)

  • āœ… Basic VS Code diagnostics integration
  • āœ… Support for all language servers and extensions

šŸ’” Use Cases

  • AI-Powered Code Review: Let AI agents analyze all code issues
  • Automated Quality Checks: Monitor workspace health in real-time
  • Smart Refactoring: AI can see all diagnostics before suggesting changes
  • Learning Assistant: Help users understand and fix code issues
  • CI/CD Integration: Pre-commit diagnostic analysis

Made with ā¤ļø by Maaz Tajammul

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured