#!/usr/bin/env bash

# Test mise mcp command

# Test that mcp command exists and shows help
assert_contains "mise mcp --help" "Run the Model Context Protocol server over stdin/stdout"
assert_contains "mise mcp --help" "Exposes project tools, tasks, environment, and configuration to an MCP client."
assert_contains "mise mcp --help" "Environment resources contain real values, including secrets."

# Test that mcp server can be invoked (even if it errors without proper initialization)
# The server requires proper initialization sequence, so we just test that the command exists
# and returns a recognizable error when given invalid input
echo "invalid json" | mise mcp 2>&1 | grep -q "Failed to create service" || echo "MCP server invocation test passed"
