diagnostics.cpp

src/mcp/servers/diagnostics.cpp

@file diagnostics.cpp @brief DiagnosticsServer implementation — LSP client stubs.

Owners: @tvanfossen

DiagnosticsServer

entropic::DiagnosticsServer::DiagnosticsServer(const std::filesystem::path &root_dir, const std::string &data_dir)

Construct with root directory and data dir.

src/mcp/servers/diagnostics.cpp:137

Show on the map →

Called by init_builtins, make_diagnostics_server

Calls CheckErrorsTool, DiagnosticsTool, load_tool_definition, register_tool

Source · 22 lines
DiagnosticsServer::DiagnosticsServer(
    const std::filesystem::path& root_dir,
    const std::string& data_dir)
    : MCPServerBase("diagnostics")
    , root_dir_(root_dir) {

    std::string tools_dir = data_dir + "/tools";

    diagnostics_ = std::make_unique<DiagnosticsTool>(
        load_tool_definition(
            "diagnostics", "diagnostics", tools_dir));

    check_errors_ = std::make_unique<CheckErrorsTool>(
        load_tool_definition(
            "check_errors", "diagnostics", tools_dir));

    register_tool(diagnostics_.get());
    register_tool(check_errors_.get());

    logger->info("DiagnosticsServer initialized: root='{}'",
                 root_dir_.string());
}
Activity · 6 steps
lines 143–143std::string tools_dir = data_dir + "/tools";lines 145–147diagnostics_ = std::make_unique<DiagnosticsTool>( load_tool_definition( "diagnostics", "diagnostics", tools_dir));lines 149–151check_errors_ = std::make_unique<CheckErrorsTool>( load_tool_definition( "check_errors", "diagnostics", tools_dir));lines 153–153register_tool(diagnostics_.get());lines 154–154register_tool(check_errors_.get());lines 156–157logger->info("DiagnosticsServer initialized: root='{}'", root_dir_.string());

Requirements

REQ-MCP-001

required_access_level

MCPAccessLevel entropic::DiagnosticsTool::required_access_level() const override

Read-only tool — requires READ access.

src/mcp/servers/diagnostics.cpp:54

Show on the map →

Called by none

Calls none

Source · 3 lines
    MCPAccessLevel required_access_level() const override {
        return MCPAccessLevel::READ;
    }
Activity · 1 steps
lines 55–55return MCPAccessLevel::READ;
MCPAccessLevel entropic::CheckErrorsTool::required_access_level() const override

Read-only tool — requires READ access.

src/mcp/servers/diagnostics.cpp:102

Show on the map →

Called by none

Calls none

Source · 3 lines
    MCPAccessLevel required_access_level() const override {
        return MCPAccessLevel::READ;
    }
Activity · 1 steps
lines 103–103return MCPAccessLevel::READ;

Requirements

REQ-MCP-011