GitHub Code Search
Search millions of public GitHub repositories for real-world code patterns and implementation examples.
Community: Submitted by a user or imported; check the owner before granting accessOnlineNo sign-inGlobalFreeRead-only
What it can do
- SearchGitHub: Find real-world code examples from over a million public GitHub repositories to help answer programming questions. **IMPORTANT: This tool searches for literal code patterns (like grep),
What data it sees
Do you need an account
No: the server works without sign-in
Search millions of public GitHub repositories for real-world code patterns and implementation examples. Discover how developers use specific libraries and handle complex configurations in production environments. Improve coding speed and accuracy by referencing verified open-source solutions.
Server tool list (1)
Raw names from tools/list. Only developers need these.
| searchGitHub | Find real-world code examples from over a million public GitHub repositories to help answer programming questions. **IMPORTANT: This tool searches for literal code patterns (like grep), not keywords. Search for actual code that would appear in files:** - ✅ Good: 'useState(', 'import React from', 'async function', '(?s)try {.*await' - ❌ Bad: 'react tutorial', 'best practices', 'how to use' **When to use this tool:** - When implementing unfamiliar APIs or libraries and need to see real usage patterns - When unsure about correct syntax, parameters, or configuration for a specific library - When looking for production-ready examples and best practices for implementation - When needing to understand how different libraries or frameworks work together **Perfect for questions like:** - "How do developers handle authentication in Next.js apps?" → Search: 'getServerSession' with language=['TypeScript', 'TSX'] - "What are common React error boundary patterns?" → Search: 'ErrorBoundary' with language=['TSX'] - "Show me real useEffect cleanup examples" → Search: '(?s)useEffect\(\(\) => {.*removeEventListener' with useRegexp=true - "How do developers handle CORS in Flask applications?" → Search: 'CORS(' with matchCase=true and language=['Python'] Use regular expressions with useRegexp=true for flexible patterns like '(?s)useState\(.*loading' to find useState hooks with loading-related variables. Prefix the pattern with '(?s)' to match across multiple lines. Filter by language, repository, or file path to narrow results. |