We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bahadirbklg/layer-ai-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
setup.pyā¢2.28 KiB
#!/usr/bin/env python3
"""Setup secure credentials for Layer.ai MCP server."""
import sys
from auth import LayerTokenManager
def main():
"""Interactive credential setup."""
print("š Layer.ai MCP Server - Secure Credential Setup")
print("=" * 55)
print("This will securely store your Layer.ai credentials using encryption.")
print("Your API token will be encrypted and stored locally.\n")
try:
manager = LayerTokenManager()
# Check if credentials already exist
existing = manager.get_credentials()
if existing:
print("ā Existing credentials found!")
print(f"š¢ Workspace ID: {existing['workspace_id']}")
print(f"š API Token: [CONFIGURED]\n")
overwrite = input("Do you want to update these credentials? (y/N): ").strip().lower()
if overwrite not in ['y', 'yes']:
print("š Keeping existing credentials.")
return
# Get new credentials
print("\nš Enter your Layer.ai credentials:")
print("You can find these at: https://app.layer.ai/settings/api-keys\n")
api_token = input("š API Token (starts with 'pat_'): ").strip()
if not api_token:
print("ā API token is required")
sys.exit(1)
workspace_id = input("š¢ Workspace ID: ").strip()
if not workspace_id:
print("ā Workspace ID is required")
sys.exit(1)
# Store credentials
print("\nš Encrypting and storing credentials...")
if manager.store_credentials(api_token, workspace_id):
print("ā Credentials stored securely!")
print("\nš Setup complete! Your Layer.ai MCP server is ready to use.")
print("š Your API token is encrypted and stored in .layer-mcp/secure/")
print("š You can now use the MCP server without exposing your token.")
else:
print("ā Failed to store credentials")
sys.exit(1)
except KeyboardInterrupt:
print("\n\nš Setup cancelled.")
sys.exit(0)
except Exception as e:
print(f"\nā Setup failed: {e}")
sys.exit(1)
if __name__ == "__main__":
main()