Skip to main content
Glama

Radicle + GitHub MCP Server

by fovi-llc
demo_sync.py•4.23 kB
#!/usr/bin/env python3 """ Demo script showing GitHub ↔ Radicle synchronization functionality. """ import asyncio import os import sys from datetime import datetime async def demo_sync(): """Demonstrate sync functionality.""" print("šŸŽÆ GitHub ↔ Radicle Synchronization Demo") print("=" * 50) # Check environment github_token = os.getenv("GITHUB_PERSONAL_ACCESS_TOKEN") if not github_token: print("āŒ Missing GITHUB_PERSONAL_ACCESS_TOKEN environment variable") print("šŸ“ To set it up:") print(" 1. Go to GitHub Settings > Developer settings > Personal access tokens") print(" 2. Generate a new token with 'repo' and 'issues' permissions") print(" 3. Export it: export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here") print("\nāš ļø Running in demo mode without actual sync...") # Show dry-run information print("\nšŸ” What would be synced (dry-run):") print(" āœ“ GitHub issues → Radicle issues") print(" āœ“ Radicle issues → GitHub issues") print(" āœ“ GitHub PRs → Radicle patches (limited)") print(" āœ“ Radicle patches → GitHub PRs (limited)") print("\nšŸ’” Key features:") print(" • Idempotent operations (safe to run multiple times)") print(" • Mapping database tracks GitHub/Radicle ID relationships") print(" • Preserves original metadata and links") print(" • Respects existing mappings to avoid duplication") return # Test with actual sync try: from github_radicle_sync import GitHubRadicleSyncer github_repo = "fovi-llc/radicle-mcp" print(f"šŸš€ Testing sync with repository: {github_repo}") print(f"šŸ”‘ Token: {'*' * 8}...{github_token[-4:]}") syncer = GitHubRadicleSyncer(github_token, github_repo) print("\nšŸ” Testing connectivity...") # Test GitHub connectivity github_issues = syncer.github.get_issues() print(f"āœ… GitHub: Found {len(github_issues)} issues") github_prs = syncer.github.get_pull_requests() print(f"āœ… GitHub: Found {len(github_prs)} pull requests") # Test Radicle connectivity radicle_issues = await syncer.radicle.get_issues() print(f"āœ… Radicle: Found {len(radicle_issues)} issues") radicle_patches = await syncer.radicle.get_patches() print(f"āœ… Radicle: Found {len(radicle_patches)} patches") # Show current mappings issue_mappings = len(syncer.db.data.get('issues', {})) patch_mappings = len(syncer.db.data.get('patches', {})) last_sync = syncer.db.data.get('last_sync', 'Never') print(f"\nšŸ“Š Current sync state:") print(f" Issue mappings: {issue_mappings}") print(f" Patch mappings: {patch_mappings}") print(f" Last sync: {last_sync}") # Ask user if they want to perform actual sync print("\nšŸ¤” Would you like to perform an actual sync? (y/N): ", end="") response = input().strip().lower() if response in ['y', 'yes']: print("\nšŸ”„ Performing sync...") results = await syncer.sync_all() print("\nšŸ“Š Sync Results:") print(f" Issues GitHub → Radicle: {results['issues_gh_to_rad']}") print(f" Issues Radicle → GitHub: {results['issues_rad_to_gh']}") print(f" Patches GitHub → Radicle: {results['patches_gh_to_rad']}") print(f" Patches Radicle → GitHub: {results['patches_rad_to_gh']}") print(f"\nšŸŽ‰ Sync completed at {datetime.now().isoformat()}") else: print("\nāœ… Demo completed (no sync performed)") except ImportError: print("āŒ github_radicle_sync module not available") print("Make sure all dependencies are installed") except Exception as e: print(f"āŒ Error during demo: {e}") import traceback traceback.print_exc() if __name__ == "__main__": asyncio.run(demo_sync())

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/fovi-llc/radicle-mcp'

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