Skip to main content
Glama
test_token_read.py•2.43 kB
#!/usr/bin/env python3 """ Test script to verify JWT token is being read correctly from config. """ import json import os def test_token_read(): """Test reading JWT token from config file.""" print("šŸ” Testing JWT Token Reading") print("=" * 40) try: # Read config file with open('claude_desktop_config.json', 'r') as f: config = json.load(f) # Extract JWT token jwt_token = config['mcpServers']['ssb-mcp-server']['env']['KNOX_TOKEN'] knox_url = config['mcpServers']['ssb-mcp-server']['env']['KNOX_GATEWAY_URL'] print(f"āœ… Config file read successfully") print(f"Knox URL: {knox_url}") print(f"JWT Token: {jwt_token[:50]}...") print(f"Token length: {len(jwt_token)} characters") # Check if token looks valid if jwt_token and jwt_token != "your-jwt-token-here" and len(jwt_token) > 100: print("āœ… JWT token appears to be valid") return True else: print("āŒ JWT token appears to be invalid or placeholder") return False except Exception as e: print(f"āŒ Error reading config: {e}") return False def test_environment_variables(): """Test environment variable setup.""" print("\nšŸŒ Testing Environment Variables") print("=" * 40) # Set up environment like the shell script would os.environ['KNOX_GATEWAY_URL'] = 'https://irb-ssb-test-manager0.cgsi-dem.prep-j1tk.a3.cloudera.site:443' # Read token from config try: with open('claude_desktop_config.json', 'r') as f: config = json.load(f) jwt_token = config['mcpServers']['ssb-mcp-server']['env']['KNOX_TOKEN'] os.environ['KNOX_TOKEN'] = jwt_token except Exception as e: print(f"āŒ Error setting up environment: {e}") return False print(f"KNOX_GATEWAY_URL: {os.environ.get('KNOX_GATEWAY_URL')}") print(f"KNOX_TOKEN: {os.environ.get('KNOX_TOKEN', 'Not set')[:50]}...") return True if __name__ == "__main__": success1 = test_token_read() success2 = test_environment_variables() if success1 and success2: print("\nšŸŽ‰ JWT token configuration is working correctly!") else: print("\nāŒ JWT token configuration has issues.") exit(0 if (success1 and success2) else 1)

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/BrooksIan/SSB-MCP-Server'

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