Skip to main content
Glama
nanyang12138

AI Research MCP Server

by nanyang12138

search_github_repos

Find trending AI/ML repositories on GitHub by filtering with keywords, topics, stars, and recency to discover relevant research projects.

Instructions

Search for trending AI/ML GitHub repositories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordsNoKeywords to search for
topicsNoGitHub topics to filter by (e.g., ['llm', 'transformer'])
min_starsNoMinimum number of stars
daysNoLook for repos updated in last N days
max_resultsNoMaximum number of results

Implementation Reference

  • Core handler function that implements the search_github_repos tool logic: caches results from GithubClient.search_repositories and formats them.
    async def _search_github_repos(
        self,
        keywords: Optional[List[str]] = None,
        topics: Optional[List[str]] = None,
        min_stars: int = 50,
        days: int = 30,
        max_results: int = 25,
    ) -> str:
        """Search GitHub repositories."""
        cache_key = f"github_{keywords}_{topics}_{min_stars}_{days}"
        cached = self.cache.get(cache_key, self.cache_expiry["github"])
        if cached:
            repos = cached
        else:
            repos = await asyncio.to_thread(
                self.github.search_repositories,
                keywords=keywords,
                topics=topics,
                min_stars=min_stars,
                pushed_since=f"{days}d",
                max_results=max_results,
            )
            self.cache.set(cache_key, repos)
        
        return self._format_repos(repos)
  • Tool registration in list_tools(), including name, description, and input schema definition.
    Tool(
        name="search_github_repos",
        description="Search for trending AI/ML GitHub repositories",
        inputSchema={
            "type": "object",
            "properties": {
                "keywords": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "Keywords to search for",
                },
                "topics": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "GitHub topics to filter by (e.g., ['llm', 'transformer'])",
                },
                "min_stars": {
                    "type": "integer",
                    "description": "Minimum number of stars",
                    "default": 50,
                },
                "days": {
                    "type": "integer",
                    "description": "Look for repos updated in last N days",
                    "default": 30,
                },
                "max_results": {
                    "type": "integer",
                    "description": "Maximum number of results",
                    "default": 25,
                },
            },
        },
    ),
  • Helper function used by the handler to format the list of repositories as markdown.
    def _format_repos(self, repos: List[Dict]) -> str:
        """Format repositories as markdown."""
        if not repos:
            return "*No repositories found.*"
        
        lines = []
        for i, repo in enumerate(repos, 1):
            name = repo.get("full_name", "Unknown")
            description = repo.get("description", "No description")
            url = repo.get("url", "")
            stars = repo.get("stars", 0)
            language = repo.get("language", "")
            topics = repo.get("topics", [])
            
            lines.append(f"### {i}. [{name}]({url})")
            lines.append(f"⭐ {stars:,} • {language}")
            lines.append(f"\n{description}")
            
            if topics:
                topic_tags = " ".join(f"`{t}`" for t in topics[:5])
                lines.append(f"\n{topic_tags}")
            
            lines.append("")
        
        return "\n".join(lines)

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/nanyang12138/AI-Research-MCP'

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