`add_issue_comment`, `update_issue`, and `get_issue` reject valid integer `issue_number`

Aberta
#2,807 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
68/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
go
Domínio
api, backend

Direção de pesquisa

Comece pelas implementações e pelos caminhos de validação de requisições de add_issue_comment, update_issue e get_issue, concentrando-se na interpolação de issue_number nos caminhos de URL. Reproduza as chamadas com um inteiro e compare-as com um parâmetro inteiro funcional, como milestone. Considera-se concluído quando os valores inteiros de issue_number passam pela validação e chegam aos endpoints REST correspondentes do GitHub, com cobertura de regressão para as três ferramentas.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug request ai review
Summary

Three endpoints that take issue_number as a required parameter consistently fail when invoked with an integer, even though the tool schema declares issue_number as number. Other endpoints on the same server that take integer parameters work correctly, and the failure survives reconnecting the MCP server.

Affected tools
  • add_issue_comment
  • update_issue
  • get_issue
Unaffected tools (for comparison, same session, same repo, same auth)
  • create_issue — succeeds (does not take issue_number)
  • list_issues, search_issues — succeed
  • create_branch, create_or_update_file, push_files, create_pull_request — all succeed, including calls with integer fields like milestone
Reproduction
  1. Any repo the caller can write issues on.
  2. Call, e.g.:
    {
      "tool": "add_issue_comment",
      "arguments": {
        "owner": "<owner>",
        "repo": "<repo>",
        "issue_number": 11,
        "body": "test"
      }
    }
    
  3. Call fails. Retrying multiple times, including after fully reconnecting the MCP server, reproduces the failure.
  4. create_issue against the same repo in the same session succeeds, ruling out auth, permissions, and rate limiting.
  5. Reproduced across at least two independent sessions on the same day.
Expected

Comment is posted / issue is updated / issue is fetched, matching a direct REST call to POST /repos/{owner}/{repo}/issues/{issue_number}/comments (etc.).

Actual

Call is rejected before it reaches GitHub. The failure pattern is consistent with issue_number being serialised as a string somewhere in the request pipeline and then rejected by the server's own integer validation.

[TODO fill in with error string on next occurrence]

Hypothesis

The three broken endpoints are exactly the ones where issue_number is templated into a URL path segment (/repos/{owner}/{repo}/issues/{issue_number}[/comments]), whereas the working endpoints pass their integers in the request body or query string. Likely culprits:

  • A path-parameter substitution step stringifies the value before an internal validator runs.
  • A schema-validation layer runs after path substitution and sees a string where a number is required.

Anywhere issue_number is interpolated into a URL is worth checking first.

Affected version
  • MCP server: GitHub MCP http server
  • Transport: stdio.
  • Client: custom provider

Please run docker run -i --rm ghcr.io/github/github-mcp-server ./github-mcp-server --version and paste the output below

Workaround

None from the client side; the caller cannot influence how the server serialises the parameter. Affected users have to fall back to the GitHub REST API directly or edit the issue in the web UI.

Linguagem predominante
Go
Estrelas
33.1k
Forks
5k
Merge médio
2d 15h
PRs com merge (30d)
27

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/github-mcp-server

Todas as issues de github/github-mcp-server

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.