0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GitMCPを使って公開GitHubリポジトリをAIコーディングエージェントから参照可能にする方法

0
Last updated at Posted at 2026-01-12

はじめに

GitMCPは、公開されているGitHubリポジトリを読み取り専用で扱う用途に適したMCPサーバーである。
自身のGitHubリポジトリではなく、公開されているGitHubリポジトリを参照するのに役立つ(自身のGitHubリポジトリの操作や参照には、GitHub公式のgithub-mcp-serverを使うと良い)。

本記事では、GitMCPを使って公開GitHubリポジトリをAIコーディングエージェントから参照可能にする方法を紹介する。

動作確認環境

  • Claude Code v2.0.24
  • Codex 0.4.58

設定

Claude Code

.mcp.jsonで追加する場合

プロジェクト内に、.mcp.jsonを作成して以下を記載する。

{
  "mcpServers": {
    "gitmcp-<repo>": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://gitmcp.io/<owner>/<repo>"
      ],
      "env": {}
    }
  }
}
  • gitmcp-<repo>: 任意の名前
  • <owner>: GitHubオーナー名(ユーザー名またはOrganization)
  • <repo>: リポジトリ名

例: TypeScriptリポジトリ( https://github.com/microsoft/TypeScript )の場合

{
  "mcpServers": {
    "gitmcp-typescript": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://gitmcp.io/microsoft/TypeScript"
      ],
      "env": {}
    }
  }
}

コマンドで追加する場合

以下のコマンドで参照したいGitHubリポジトリを追加する。

任意のリポジトリをプロジェクトに追加
claude mcp add gitmcp-<repo> -s project -- npx -y mcp-remote https://gitmcp.io/<owner>/<repo>
  • gitmcp-<repo>: 任意の名前
  • <owner>: GitHubオーナー名(ユーザー名またはOrganization)
  • <repo>: リポジトリ名

例: TypeScriptリポジトリ( https://github.com/microsoft/TypeScript )の場合

claude mcp add gitmcp-typescript -s project -- npx -y mcp-remote https://gitmcp.io/microsoft/TypeScript

Codex

Codexの設定ファイル(~/.codex/config.toml)に以下を追記する。

任意のリポジトリをプロジェクトに追加
[mcp_servers."gitmcp-<repo>"]
command = "npx"
args = ["-y", "mcp-remote", "https://gitmcp.io/<owner>/<repo>"]
  • gitmcp-<repo>: 任意の名前
  • <owner>: GitHubオーナー名(ユーザー名またはOrganization)
  • <repo>: リポジトリ名

例: TypeScriptリポジトリ( https://github.com/microsoft/TypeScript )の場合

[mcp_servers."gitmcp-typescript"]
command = "npx"
args = ["-y", "mcp-remote", "https://gitmcp.io/microsoft/TypeScript"]

まとめ

GitMCPを使って公開GitHubリポジトリをAIコーディングエージェントから参照可能にする方法を紹介した。公開されているGitHubリポジトリの情報をAIコーディングエージェントに参照させる際、手軽に使えて便利なので試してみてほしい。

参考

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?