Home / Servers / GitHub API / search_code

Search code

An MCP tool from the GitHub API server, hosted on mcp.hjlabs.in.

Search code Searches for query terms inside of a file. This method returns up to 100 results per page. When searching for code, you can get text match metadata for the file **content** and file **path** fields… [GET /search/code]

Name on the gateway: github_api__search_code · read-only.

Parameters

NameTypeDescription
q requiredstringThe query contains one or more search keywords and qualifiers. Qualifiers…
sortindexed**This field is closing down.** Sorts the results of your query. Can only be…
orderdesc | asc**This field is closing down.** Determines whether the first search result…
per_pageintegerThe number of results per page (max 100). For more information, see "Using…
pageintegerThe page number of the results to fetch. For more information, see "Using…

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "github_api__search_code",
  "arguments": {
    "q": "…"
  }
}

Or connect the GitHub API server directly, which lists 1,221 tools including this one:

Run in your terminal
claude mcp add --transport http hj-github-api https://mcp.hjlabs.in/mcp/github-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the search code tool with q set to ….

More from GitHub API