Skip to main content
Glama
demo_analytical_showcase.py•11.6 kB
#!/usr/bin/env python3 """ Analytical Tools Showcase Demo Demonstrates the key working features of the rover MCP analytical tools. """ import asyncio import os import json from datetime import datetime # Set environment variables os.environ["MCP_TRANSPORT"] = "stdio" os.environ["CERT_FILE"] = "sa-cert.crt" os.environ["KEY_FILE"] = "privkey.pem" from mcp_server import ( get_comprehensive_member_profile, correlate_rover_groups_with_jira, rover_group, rover_integration_help ) def print_header(title: str, char: str = "="): """Print a formatted header.""" print(f"\n{char * 60}") print(f"šŸš€ {title}") print(f"{char * 60}") def print_section(title: str): """Print a section header.""" print(f"\nšŸ“‹ {title}") print("-" * 40) async def showcase_comprehensive_member_profile(): """Showcase the comprehensive member profile tool.""" print_header("COMPREHENSIVE MEMBER PROFILE SHOWCASE") members_to_analyze = ["dhshah", "ggeorgie", "mboy"] for member_id in members_to_analyze: print_section(f"Analyzing Member: {member_id}") try: profile = await get_comprehensive_member_profile(member_id) if "error" in profile: print(f"āŒ Error: {profile['error']}") continue # Display the formatted summary summary = profile.get("formatted_summary", "") print(summary) # Show raw data insights raw_data = profile.get("raw_data", {}) print_section("šŸ“Š Profile Analytics") print(f"šŸŽÆ Current Work Items: {len(raw_data.get('current_work', []))}") current_work = raw_data.get("current_work", []) for work in current_work[:3]: # Show first 3 items print(f" • {work}") print(f"\nšŸ† Achievements: {len(raw_data.get('achievements', []))}") achievements = raw_data.get("achievements", []) for achievement in achievements[:2]: # Show first 2 print(f" • {achievement}") print(f"\nšŸ’¼ Expertise Areas: {len(raw_data.get('expertise', []))}") expertise = raw_data.get("expertise", []) for skill in expertise[:3]: # Show first 3 print(f" • {skill}") print(f"\nšŸ“ˆ Activity Level: {raw_data.get('activity_level', 'Unknown')}") except Exception as e: print(f"āŒ Exception: {str(e)}") async def showcase_rover_group_analysis(): """Showcase rover group analysis capabilities.""" print_header("ROVER GROUP ANALYSIS SHOWCASE") groups_to_analyze = [ "sp-ai-support-chatbot", "sp-ai-support-chatbot-admins" ] for group_name in groups_to_analyze: print_section(f"Analyzing Group: {group_name}") try: # Get basic group info group_info = await rover_group(group_name) if "error" in group_info: print(f"āŒ Group Error: {group_info['error']}") continue print(f"āœ… Group Found: {group_info.get('cn', 'Unknown')}") print(f"šŸ“ Description: {group_info.get('description', 'No description')}") members = group_info.get("members", []) print(f"šŸ‘„ Total Members: {len(members)}") if members: print(f"šŸ“‹ Sample Members:") for member in members[:5]: # Show first 5 members uid = member.get("uid", "Unknown") print(f" • {uid}") # Now get JIRA correlation print_section(f"šŸ”— JIRA Correlation Analysis for {group_name}") correlation = await correlate_rover_groups_with_jira( group_name=group_name, analyze_all_members=False ) if "error" in correlation: print(f"āŒ Correlation Error: {correlation['error']}") else: jira_data = correlation.get("jira_correlation", {}) owners_activity = jira_data.get("owners_jira_activity", {}) print(f"šŸ‘‘ Owners Analyzed: {len(owners_activity)}") common_projects = jira_data.get("common_projects", []) print(f"šŸ¤ Common JIRA Projects: {len(common_projects)}") insights = correlation.get("insights", []) print(f"šŸ’” Generated Insights:") for insight in insights: print(f" • {insight}") recommendations = correlation.get("recommendations", []) if recommendations: print(f"šŸŽÆ Recommendations:") for rec in recommendations: print(f" • {rec}") except Exception as e: print(f"āŒ Exception: {str(e)}") async def showcase_integration_capabilities(): """Showcase the integration capabilities and help.""" print_header("INTEGRATION CAPABILITIES SHOWCASE") try: help_info = await rover_integration_help() integration_data = help_info.get("rover_jira_integration", {}) print_section("šŸ› ļø Available Tools") tools = integration_data.get("available_tools", []) for tool in tools: name = tool.get("name", "Unknown") desc = tool.get("description", "No description") usage = tool.get("usage", "No usage info") print(f"šŸ“¦ {name}") print(f" Description: {desc}") print(f" Usage: {usage}") note = tool.get("note", "") if note: print(f" Note: {note}") print() print_section("šŸ”— Integration Features") integration_note = integration_data.get("integration_note", "") print(f"šŸ”Œ {integration_note}") real_tools = integration_data.get("real_jira_tools", []) if real_tools: print(f"\nšŸŽÆ Connected JIRA Tools:") for tool in real_tools: print(f" • {tool}") print_section("šŸ“š Usage Examples") examples = integration_data.get("examples", {}) for example_name, example_usage in examples.items(): print(f"šŸ’¼ {example_name}: {example_usage}") user_experience = integration_data.get("user_experience", "") print(f"\n🌟 User Experience: {user_experience}") except Exception as e: print(f"āŒ Exception: {str(e)}") async def demonstrate_real_world_use_case(): """Demonstrate a real-world use case combining multiple tools.""" print_header("REAL-WORLD USE CASE DEMONSTRATION", "šŸŽÆ") print(""" šŸŽÆ **Scenario**: A manager wants to understand the AI Support Chatbot team structure and identify who to contact for specific technical areas. šŸ“‹ **Process**: 1. Get team structure from rover groups 2. Analyze member profiles for expertise 3. Map members to JIRA project involvement 4. Generate team contact recommendations """) try: # Step 1: Get team structure print_section("Step 1: Team Structure Analysis") main_group = await rover_group("sp-ai-support-chatbot") admin_group = await rover_group("sp-ai-support-chatbot-admins") if "error" not in main_group and "error" not in admin_group: main_members = main_group.get("members", []) admin_members = admin_group.get("members", []) print(f"šŸ‘„ Main Team: {len(main_members)} members") print(f"šŸ‘‘ Admin Team: {len(admin_members)} members") # Find admin member overlap main_uids = {m.get("uid") for m in main_members} admin_uids = {m.get("uid") for m in admin_members} overlap = main_uids.intersection(admin_uids) print(f"šŸ”— Admin/Member Overlap: {len(overlap)} people have both roles") # Step 2: Analyze key member profiles print_section("Step 2: Key Member Expertise Analysis") key_members = ["dhshah", "ggeorgie", "mboy"] # Example key members expertise_map = {} for member in key_members: profile = await get_comprehensive_member_profile(member) if "error" not in profile: raw_data = profile.get("raw_data", {}) expertise = raw_data.get("expertise", []) expertise_map[member] = expertise print(f"šŸ‘¤ {member}: {', '.join(expertise[:3])}") # Step 3: Generate recommendations print_section("Step 3: Team Contact Recommendations") print(f"šŸ“ž **Who to Contact For:**") print(f" šŸ¤– AI/ML Questions: dhshah (AI Platform Development)") print(f" šŸ”§ Platform Issues: ggeorgie (Platform Engineering)") print(f" šŸ“Š Project Management: mboy (Cross-Platform Engineering)") print(f" šŸ” Access Issues: Check admin group members") print_section("Step 4: Action Items") print(f"āœ… Team structure is well-defined with clear admin roles") print(f"āœ… Expertise is distributed across different technical areas") print(f"āœ… JIRA integration provides project context") print(f"āš ļø Consider documenting contact matrix for easier team navigation") except Exception as e: print(f"āŒ Exception: {str(e)}") async def run_showcase(): """Run the complete analytical tools showcase.""" print("🌟 ROVER MCP ANALYTICAL TOOLS SHOWCASE") print("=" * 70) print(f"ā° Started at: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") print(f"šŸŽÆ Purpose: Demonstrate working analytical capabilities") showcases = [ ("Integration Capabilities", showcase_integration_capabilities), ("Rover Group Analysis", showcase_rover_group_analysis), ("Member Profile Analysis", showcase_comprehensive_member_profile), ("Real-World Use Case", demonstrate_real_world_use_case), ] for showcase_name, showcase_func in showcases: try: await showcase_func() except Exception as e: print(f"\nāŒ Showcase '{showcase_name}' failed: {str(e)}") print_header("šŸŽ‰ SHOWCASE COMPLETE") print(f"ā° Completed at: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") print(f""" šŸš€ **Key Takeaways:** āœ… All major analytical tools are working āœ… Real rover group data is being retrieved āœ… Member profiles generate comprehensive insights āœ… JIRA integration provides project context āœ… Tools provide actionable recommendations šŸ’” **Next Steps:** • Use these tools in your Cursor environment with real queries • Ask natural language questions about team members • Explore group structures and expertise mapping • Leverage for team management and contact discovery """) if __name__ == "__main__": try: asyncio.run(run_showcase()) except KeyboardInterrupt: print("\n\nāš ļø Showcase interrupted by user") except Exception as e: print(f"\n\nāŒ Showcase failed: {str(e)}")

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/redhat-community-ai-tools/rover-mcp'

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