github / github/github-mcp-server

Add guidance on GitHub autolinked reference formatting for AI agents

オープン 初心者向け
#3,042 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Go
スター
33k
フォーク
5k
平均マージ
2日 1時間
マージ済み PR(30日)
52

説明

### Describe the feature or problem you'd like to solve

AI agents using the MCP server create manual markdown links when they could use GitHub's built-in autolinked references instead. GitHub automatically renders patterns like `#123`, `@username`, and `owner/repo#123` as clickable links across issues, pull requests, comments, and discussions—but agents lack this knowledge in their system instructions.

For complete reference and examples, see:
https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls

### Proposed solution

Add guidance to the base context instructions (via `generateContextToolsetInstructions()`) so all agents learn about autolinked references before using any content-creation tools. This ensures consistent formatting across all GitHub interactions without duplicating guidance in multiple toolsets.

**Benefits:**
- Universal coverage: Applies to all content-creation tools (issues, PRs, comments, discussions)
- Single source of truth: One place to maintain, not scattered across toolsets
- Early discovery: Agents see this guidance at initialization, before using any specific tool
- No duplication: Leverage official docs instead of repeating content

**Implementation:**

Add a section to `pkg/github/toolset_instructions.go` in `generateContextToolsetInstructions()`:

```go
func generateContextToolsetInstructions(_ *inventory.Inventory) string {
return `Always call 'get_me' first to understand current user permissions and context.

### GitHub Autolinked References

When creating issues, pull requests, comments, or discussions, use GitHub's autolinked reference syntax—issue numbers (#123), user mentions (@example-username), and cross-repo references (example-owner/example-repo#123)—so GitHub renders them as links automatically.
See the official docs for complete details: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls.md`
}
```

This approach follows the existing pattern of `github_support_docs_search`, which references official documentation rather than duplicating content.

### Additional context

This is a lightweight enhancement that integrates seamlessly into the existing base context instructions. No new tools or infrastructure required—just a brief instruction pointing agents to official GitHub docs.

**Future enhancement:**
If agents need to proactively request formatting guidance (e.g., "How should I format this reference?"), consider creating a dedicated resource or skill in the MCP server. This would allow agents to ask for formatting help on-demand while still having the baseline guidance available at initialization. This can be explored as a follow-up if needed.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start in pkg/github/toolset_instructions.go at generateContextToolsetInstructions(), and compare the existing github_support_docs_search guidance. Verify that the generated base context includes a concise link to GitHub's autolinked references documentation before content-creation tools are used. Done means the guidance covers issue, pull request, comment, and discussion references without adding a new tool or duplicating it in other toolsets.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
go
領域
tooling
issue の種類
ドキュメント
難易度
1/5
見積もり時間
1時間未満
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
88/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。