- Home
- MCP servers
- MCP Diagnostics Trae Server
MCP Diagnostics Trae Server
- javascript
11
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"lin037-mcp-diagnostics-trae": {
"command": "npx",
"args": [
"-y",
"/path/to/mcp-diagnostics"
],
"env": {
"PATH": "/usr/local/bin"
}
}
}
}You can enable Trae IDE to access real-time diagnostic data from your project, including errors, warnings, and tips. This MCP server exposes those diagnostics to Trae's AI Agent, helping you analyze code quality and receive targeted repair suggestions as you work.
How to use
You interact with the MCP server through a client that supports the Model Context Protocol. Start the local MCP server, then configure your Trae MCP client to connect. Once connected, you can fetch diagnostic data for the entire workspace or for individual files, and you can request a quick summary of all diagnostics to gauge overall code health.
Key capabilities you can use include: getting all diagnostics for the current workspace, retrieving diagnostics for a specific path, obtaining diagnostics for a complete file URI, and requesting a compact summary of diagnostics across all files. These tools are designed to help you quickly identify errors, warnings, and informational hints, then act on them with AI-assisted guidance.
How to install
Prerequisites: ensure you have Node.js and npm installed on your development machine. You may also want Git for cloning repositories.
Step 1: Install the VS Code extension to enable access to the local diagnostic data in your workspace.
Step 2: Clone and build the MCP diagnostics project.
Step 3: In Trae, configure the MCP server connection using the provided JSON configuration.
Step 4: Start the server and verify that diagnostics are available in Trae.
Configuration and usage examples
// Step 3 configuration example to paste in Trae MCP settings
{
"mcpServers": {
"diagnostics": {
"command": "npx",
"args": ["-y", "/path/to/mcp-diagnostics"],
"description": "Trae IDE 诊断信息读取工具"
}
}
}
Note: replace "/path/to/mcp-diagnostics" with the actual path where you cloned the project, for example: "E:/MCPWork/trae-diagnostics/mcp".
// If you cloned to E:/MCPWork/trae-diagnostics/mcp, Trae config becomes:
{
"mcpServers": {
"diagnostics": {
"command": "npx",
"args": [
"-y",
"E:/MCPWork/trae-diagnostics/mcp"
]
}
}
}
Getting started with Trae MCP client
Use the following commands to prepare and run the server according to the project workflow.
# Clone the diagnostics project
git clone https://github.com/lin037/mcp-diagnostics-trae.git
cd mcp-diagnostics
# Install dependencies
npm install
# Build the project
npm run build
Then start the server as described in your environment, typically by running the start script and ensuring the MCP client can connect.
Troubleshooting and notes
If you cannot connect Trae IDE to the MCP server, ensure Trae is running, the project is opened in Trae, and the language server has finished initializing.
If you receive empty diagnostics, possible causes include no errors or warnings in the project yet, ongoing analysis by the language server, or unsupported file types. Retry after a moment, save files, and confirm diagnostics appear.
If getDiagnosticsForFile returns an empty array, prefer getDiagnosticsForPath for flexible matching, and ensure you use a complete file URI format like file:///workspace/... when querying by URI.
Common checks: confirm the MCP server is running, verify network connectivity, and review Trae error logs for any startup or runtime issues.
Notes on architecture and workflow
This MCP server communicates with Trae through a standard MCP protocol, using stdin/stdout for the MCP channel and integrating with Trae via a Debug Adapter Protocol interface for diagnostics data.
Available tools
getDiagnostics
Fetches an array of diagnostic information for all files in the current workspace.
getDiagnosticsForPath
Fetches diagnostics for files matching a given path, supporting relative paths, filenames, and mixed path formats.
getDiagnosticsForFile
Fetches diagnostics for a specific file by its complete file URI.
getDiagnosticsSummary
Returns a summary count of total files, errors, and warnings in the workspace.