Skip to main content
Glama

Radicle + GitHub MCP Server

by fovi-llc
sync_with_github_mcp.py•3.8 kB
#!/usr/bin/env python3 """ Use MCP tools to sync with GitHub repository. """ import asyncio import sys from pathlib import Path # Add the src directory to the path sys.path.insert(0, str(Path(__file__).parent / "src")) from radicle_mcp.server import run_rad_command async def use_mcp_for_github_sync(): """Use MCP tools to handle GitHub sync.""" print("šŸ”„ Using MCP to sync with GitHub repository fovi-llc/radicle-mcp") # First, let's check our current Radicle status print("\n1. šŸ“Š Checking current Radicle status...") status_result = await run_rad_command(["rad", "inspect"]) print(f"Current RID: {status_result['stdout']}") # Check current remotes print("\n2. 🌐 Checking current remotes...") remote_result = await run_rad_command(["rad", "remote"]) print(f"Current remotes:\n{remote_result['stdout']}") # Use git through our MCP wrapper to add GitHub remote print("\n3. šŸ™ Adding GitHub remote...") git_remote_result = await run_rad_command([ "git", "remote", "add", "github", "https://github.com/fovi-llc/radicle-mcp.git" ]) if git_remote_result['success']: print("āœ… GitHub remote added successfully") else: print(f"āš ļø GitHub remote add result: {git_remote_result['stderr']}") # Fetch from GitHub to get the LICENSE file print("\n4. šŸ“„ Fetching from GitHub...") fetch_result = await run_rad_command(["git", "fetch", "github"]) if fetch_result['success']: print("āœ… Successfully fetched from GitHub") print(f"Fetch output: {fetch_result['stdout']}") else: print(f"āŒ Fetch failed: {fetch_result['stderr']}") # Check what we got print("\n5. šŸ” Checking GitHub branches...") branch_result = await run_rad_command(["git", "branch", "-r"]) print(f"Remote branches: {branch_result['stdout']}") # Merge or rebase with GitHub main if it exists print("\n6. šŸ”€ Merging GitHub changes...") merge_result = await run_rad_command([ "git", "merge", "github/main", "--allow-unrelated-histories" ]) if merge_result['success']: print("āœ… Successfully merged GitHub changes") else: print(f"āš ļø Merge result: {merge_result['stderr']}") # Try to continue anyway # Stage all our new files print("\n7. šŸ“ Staging local changes...") add_result = await run_rad_command(["git", "add", "."]) if add_result['success']: print("āœ… All files staged") else: print(f"āŒ Failed to stage files: {add_result['stderr']}") # Commit our changes print("\n8. šŸ’¾ Committing changes...") commit_result = await run_rad_command([ "git", "commit", "-m", "Add Radicle + GitHub MCP server integration\n\n- Complete Python MCP server for Radicle CLI\n- GitHub MCP server integration\n- VS Code and Claude Desktop configuration\n- Setup and test scripts" ]) if commit_result['success']: print("āœ… Changes committed successfully") print(f"Commit result: {commit_result['stdout']}") else: print(f"āš ļø Commit result: {commit_result['stderr']}") # Push to GitHub print("\n9. šŸš€ Pushing to GitHub...") push_result = await run_rad_command(["git", "push", "github", "main"]) if push_result['success']: print("āœ… Successfully pushed to GitHub!") print(f"Push result: {push_result['stdout']}") else: print(f"āŒ Push failed: {push_result['stderr']}") print("\nšŸŽ‰ MCP-powered GitHub sync complete!") print("Your local changes are now synced with https://github.com/fovi-llc/radicle-mcp") if __name__ == "__main__": asyncio.run(use_mcp_for_github_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