Skip to main content
Glama

Jira-GitLab MCP Server

by gabbar910
setup.py4.81 kB
#!/usr/bin/env python3 """ Setup script for the Jira-GitLab MCP Server """ import os import sys import subprocess from pathlib import Path def check_python_version(): """Check if Python version is compatible""" if sys.version_info < (3, 8): print("❌ Python 3.8 or higher is required") print(f"Current version: {sys.version}") return False print(f"✅ Python version: {sys.version}") return True def install_dependencies(): """Install required dependencies""" print("\n📦 Installing dependencies...") try: subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"]) print("✅ Dependencies installed successfully") return True except subprocess.CalledProcessError as e: print(f"❌ Failed to install dependencies: {e}") return False def create_config_files(): """Create configuration files if they don't exist""" print("\n⚙️ Setting up configuration...") # Create .env file from template if it doesn't exist env_file = Path(".env") env_template = Path(".env.template") if not env_file.exists() and env_template.exists(): env_file.write_text(env_template.read_text()) print("✅ Created .env file from template") print("📝 Please edit .env file with your credentials") elif env_file.exists(): print("✅ .env file already exists") # Create config.json from sample if it doesn't exist config_file = Path("config.json") config_sample = Path("config.json.sample") if not config_file.exists() and config_sample.exists(): print("📝 config.json.sample is available for reference") print("💡 Tip: Use environment variables (.env) for better security") elif config_file.exists(): print("✅ config.json file exists") def create_directories(): """Create necessary directories""" print("\n📁 Creating directories...") directories = ["logs", "tests/__pycache__", "utils/__pycache__", "connectors/__pycache__"] for directory in directories: Path(directory).mkdir(parents=True, exist_ok=True) print("✅ Directories created") def run_tests(): """Run the test suite""" print("\n🧪 Running tests...") try: result = subprocess.run([sys.executable, "-m", "pytest", "tests/", "-v"], capture_output=True, text=True) if result.returncode == 0: print("✅ All tests passed") return True else: print("❌ Some tests failed") print(result.stdout) print(result.stderr) return False except FileNotFoundError: print("⚠️ pytest not found, skipping tests") print("💡 Install pytest to run tests: pip install pytest") return True def print_next_steps(): """Print next steps for the user""" print("\n🎉 Setup completed!") print("\n📋 Next steps:") print("1. Edit .env file with your Jira and GitLab credentials") print("2. Test the configuration:") print(" python -c \"from utils.config import load_config; print('Config loaded successfully')\"") print("3. Run the MCP server:") print(" python mcp_server.py") print("\n📚 Documentation:") print("- README.md for detailed instructions") print("- .env.template for environment variable reference") print("- config.json.sample for configuration file reference") print("\n🔗 Useful links:") print("- Jira API tokens: https://id.atlassian.com/manage-profile/security/api-tokens") print("- GitLab access tokens: https://gitlab.com/-/profile/personal_access_tokens") def main(): """Main setup function""" print("🚀 Jira-GitLab MCP Server Setup") print("=" * 40) # Check Python version if not check_python_version(): sys.exit(1) # Install dependencies if not install_dependencies(): print("⚠️ Continuing with setup despite dependency installation issues...") # Create directories create_directories() # Create config files create_config_files() # Run tests (optional) print("\n🧪 Would you like to run tests? (y/n): ", end="") try: response = input().lower().strip() if response in ['y', 'yes']: run_tests() except KeyboardInterrupt: print("\n⏭️ Skipping tests...") # Print next steps print_next_steps() if __name__ == "__main__": try: main() except KeyboardInterrupt: print("\n\n⏹️ Setup interrupted by user") sys.exit(1) except Exception as e: print(f"\n❌ Setup failed with error: {e}") sys.exit(1)

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/gabbar910/MCPJiraGitlab'

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