Skip to content

search_issues returns 422 for repositories I own or administer, even though the repo exists and I have access #2206

@pamelafox

Description

@pamelafox

Summary

GitHub MCP search_issues is returning 422 Validation Failed for repositories where my account has owner/admin-level access.

A concrete example is repositories under Azure-Samples (I am a Microsoft employee, and am part of the team with access to that org).

The error says:

The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.

But in this case the repository does exist, and I do have access to it.

Expected behavior

search_issues should return issue results for repositories I own or administer.

Actual behavior

The MCP call fails with 422 Validation Failed.

Repro

Query pattern:

repo:Azure-Samples/<repo-name> is:issue is:open

Result:

failed to search issues: GET https://api.github.com/search/issues?...q=repo%3AAzure-Samples%2F<repo-name>+is%3Aissue+is%3Aopen...: 422 Validation Failed [{Resource:Search Field:q Code:invalid Message:The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.}]

Notes

  • This is happening for repos where my account is an owner/admin, not just for random external repos.
  • The error message is misleading in this case, because the repo is real and accessible.
  • I was reproducing this through the remote GitHub MCP server using search_issues.

Environment

  • GitHub MCP remote server
  • Server URL: https://api.githubcopilot.com/mcp
  • Tool: search_issues
  • Token used: authenticated GitHub token (both classic with repo access and PAT with public repos)

Questions

  1. Is this a known limitation in how search_issues builds or forwards search queries for org-owned/admin-access repos?
  2. Is there a token/account configuration requirement for searching repos where the user is an org owner/admin?
  3. If this is expected GitHub Search API behavior, could the MCP docs or error handling make that clearer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions