18#include <nlohmann/json.hpp>
67 logger->warn(
"[diagnostics] placeholder invoked — no language server is wired");
68 return {
tool_error_json(
"not_implemented",
"diagnostics is not implemented: no language "
69 "server is connected (mcp.enable_diagnostics)."),
115 logger->warn(
"[check_errors] placeholder invoked — no language server is wired");
116 return {
tool_error_json(
"not_implemented",
"check_errors is not implemented: no language "
117 "server is connected (mcp.enable_diagnostics)."),
138 const std::filesystem::path& root_dir,
141 , root_dir_(root_dir) {
145 diagnostics_ = std::make_unique<DiagnosticsTool>(
147 "diagnostics",
"diagnostics",
tools_dir));
149 check_errors_ = std::make_unique<CheckErrorsTool>(
151 "check_errors",
"diagnostics",
tools_dir));
156 logger->info(
"DiagnosticsServer initialized: root='{}'",
DiagnosticsServer(const std::filesystem::path &root_dir, const std::string &data_dir)
Construct with root directory and data dir.
~DiagnosticsServer() override
Destructor.
const std::filesystem::path & root_dir() const
Get the root directory.
Concrete base class for MCP servers (80% logic).
void register_tool(ToolBase *tool)
Register a tool with this server.
Diagnostics MCP server — LSP client for code diagnostics.
spdlog initialization and logger access.
ENTROPIC_EXPORT std::shared_ptr< spdlog::logger > get(const std::string &name)
Get or create a named logger.
Activate model on GPU (WARM → ACTIVE).
ToolDefinition load_tool_definition(const std::string &tool_name, const std::string &server_prefix, const std::string &data_dir)
Load a tool definition from a JSON file.
@ optional
optional: every escape asks the host's path approver
std::string tool_error_json(const std::string &code, const std::string &message)
A declared tool error: {"error": code, "message": message}.
MCPAccessLevel
MCP tool access level for per-identity authorization.
@ READ
Read-only operations (e.g., read_file, list_directory)
MCPServerBase concrete base class + ServerResponse.
Structured result from tool execution.