This guide provides comprehensive procedures for local integration testing of awaBerry components, covering HTTP server functionality, MCP client and server interactions, and core agent methods like device connection and command execution. Tests involve configuring environment variables (`projectKey`, `projectSecret`, `deviceName`, `mcpServerUrl`) to establish secure connections and execute remote commands (e.g., 'date') on configured devices. Validation ensures proper session initialization, tool listing, device connectivity, and reliable command execution across various transport mechanisms, including JSON/HTTP and Standard I/O.
This page outlines the process for testing the HTTP server component. It involves starting a local Node.js HTTP server and then executing a test client script. The test client (testHttpServer.js) connects to the server using projectKey, projectSecret, and deviceName from a .env file, and subsequently sends an execute command (defaulting to 'date') to retrieve information from a configured device.
The `testStartAwaberryMcp.js` script leverages `dotenv` for environment variable management, specifically requiring `deviceName`. It orchestrates a test sequence through `sendMcpRequest` to an MCP server. This includes initializing a protocol session, listing available tools, establishing a secure connection to a specified device (obtaining `sessionToken` and `deviceuuid`), and finally executing a remote terminal command like `date` to confirm operational integrity. Each step is validated, with failure at any point leading to process termination.
This page details the process for thoroughly testing the awaBerry MCP server across its two primary transport mechanisms: JSON/HTTP and Standard I/O (Stdio). Both testing flows involve configuring necessary environment variables such as mcpServerUrl, projectKey, projectSecret, and deviceName. For the JSON/HTTP version, tests validate session initialization, tool listing, device connection, and terminal command execution against an HTTP endpoint. The Stdio version performs similar validations by communicating directly over standard input/output, mimicking client interactions from applications like Claude Desktop. The tests ensure the server's core functionalities are operational and correctly configured.
This document outlines the technical procedures for executing local integration tests for the connectToDevice and executeCommand methods using the awaBerry Connect agent. It covers essential preconditions such as awaBerry Connect installation and account setup, environment configuration via a .env file for project credentials and device details, and steps for installing dependencies. Detailed instructions are provided for testing device connectivity, executing arbitrary commands, and managing long-running commands by polling for additional results, ensuring robust validation of the agent's core functionalities.