mirror of
https://github.com/gbrigandi/mcp-server-wazuh.git
synced 2025-12-20 20:32:20 -06:00
Wazuh MCP server successfully tested with Claude
This commit is contained in:
@@ -6,10 +6,42 @@ cargo test
|
||||
echo "Building MCP client CLI..."
|
||||
cargo build --bin mcp_client_cli
|
||||
|
||||
if nc -z localhost 8000 2>/dev/null; then
|
||||
echo "Testing MCP client CLI against running server..."
|
||||
./target/debug/mcp_client_cli health
|
||||
./target/debug/mcp_client_cli get-data
|
||||
else
|
||||
echo "MCP server is not running. Start it with 'cargo run' to test the CLI."
|
||||
echo "Building main server binary for stdio CLI tests..."
|
||||
# Build the server executable that mcp_client_cli will run
|
||||
cargo build --bin mcp-server-wazuh # Output: target/debug/mcp-server-wazuh
|
||||
|
||||
echo "Testing MCP client CLI in stdio mode..."
|
||||
|
||||
echo "Executing: ./target/debug/mcp_client_cli --stdio-exe ./target/debug/mcp-server-wazuh initialize"
|
||||
./target/debug/mcp_client_cli --stdio-exe ./target/debug/mcp-server-wazuh initialize
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "CLI 'initialize' command failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Executing: ./target/debug/mcp_client_cli --stdio-exe ./target/debug/mcp-server-wazuh provideContext"
|
||||
./target/debug/mcp_client_cli --stdio-exe ./target/debug/mcp-server-wazuh provideContext
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "CLI 'provideContext' command failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Example of provideContext with empty JSON params (optional to uncomment and test)
|
||||
# echo "Executing: ./target/debug/mcp_client_cli --stdio-exe ./target/debug/mcp-server-wazuh provideContext '{}'"
|
||||
# ./target/debug/mcp_client_cli --stdio-exe ./target/debug/mcp-server-wazuh provideContext '{}'
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "CLI 'provideContext {}' command failed!"
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
echo "Executing: ./target/debug/mcp_client_cli --stdio-exe ./target/debug/mcp-server-wazuh shutdown"
|
||||
./target/debug/mcp_client_cli --stdio-exe ./target/debug/mcp-server-wazuh shutdown
|
||||
if [ $? -ne 0 ]; then
|
||||
# Shutdown might return an error if the server closes the pipe before the client fully processes the response,
|
||||
# but the primary goal is that the server process is terminated.
|
||||
# For this script, we'll be lenient on shutdown's exit code for now,
|
||||
# as long as initialize and provideContext worked.
|
||||
echo "CLI 'shutdown' command executed (non-zero exit code is sometimes expected if server closes pipe quickly)."
|
||||
fi
|
||||
|
||||
echo "MCP client CLI stdio tests completed."
|
||||
|
||||
Reference in New Issue
Block a user