Skip to main content
Glama
AB498

Computer Control MCP

by AB498
test_wgc_env_var.py1.46 kB
import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'src')) from computer_control_mcp.core import _should_use_wgc_by_default import os def test_wgc_env_var(): """Test the WGC environment variable pattern matching""" print("Testing WGC environment variable pattern matching...") # Test with no environment variable set if 'COMPUTER_CONTROL_MCP_WGC_PATTERNS' in os.environ: del os.environ['COMPUTER_CONTROL_MCP_WGC_PATTERNS'] result = _should_use_wgc_by_default("OBS Studio") print(f"Without env var - 'OBS Studio': {result} (expected: False)") # Test with environment variable set os.environ['COMPUTER_CONTROL_MCP_WGC_PATTERNS'] = "obs, discord, game" test_cases = [ ("OBS Studio", True), ("Discord", True), ("My Game", True), ("Notepad", False), ("Google Chrome", False), ("obs studio", True), # Test case insensitivity ("DISCORD APP", True), # Test case insensitivity ] for window_title, expected in test_cases: result = _should_use_wgc_by_default(window_title) status = "✓" if result == expected else "✗" print(f"{status} '{window_title}': {result} (expected: {expected})") # Clean up if 'COMPUTER_CONTROL_MCP_WGC_PATTERNS' in os.environ: del os.environ['COMPUTER_CONTROL_MCP_WGC_PATTERNS'] if __name__ == "__main__": test_wgc_env_var()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AB498/computer-control-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server