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?

codex cli でMicrosoft Learn MCP Serverを使う

Posted at

はじめに

  • Microsoft Learn MCP Server なるものが提供されていることを知りました。MCP未経験ながらAzure使ってるならこれは必須だろうと思ってみたものの、このgithubにはcodex用の設定例がありません。(Microsoft、codex推しではないの???)
  • ブラウザでMCPサーバにアクセスしてみるとstreamable HTTP transportを使ってというメッセージが出力されました

This is an MCP server endpoint and cannot be accessed directly via a browser or unsupported transports like SSE. Please use a streamable HTTP transport. For more details, visit: https://github.com/microsoftdocs/mcp.

  • codexのgithubサイトでStreamable HTTPについての記述を見つけました。
    Streamable HTTP に対応する
  • とりあえず接続できて使えた設定を記載します。こうした方がいいとか間違ってるとかあったらコメントください

手順

  • config.tomlを編集します。既存の設定に今回のMCP設定を追加します。参考接続設定
  • experimental_use_rmcp_clientを使用しています。(experimentalなので今後変更の可能性があります)
~/.codex/config.toml

# ↑↑↑ 接続設定他 ↑↑↑
###
# MCP
experimental_use_rmcp_client = true
[mcp_servers.microsoft_learn_docs] # 名前をmicrosoft_learn_docsにしましたが任意で問題ないと思います
url = "https://learn.microsoft.com/api/mcp"

設定確認

$ codex --version
codex-cli 0.46.0
$ codex mcp list
Name                  Url                                  Bearer Token Env Var  Status   Auth
microsoft_learn_docs  https://learn.microsoft.com/api/mcp  -                     enabled  Unsupported

使い方と実行例

# codexに接続したあと
› gpt-5-codex を使用できるリージョンを日本語で教えて search Microsoft docs
• リージョン
  - East US 2(Global Standard)eastus2
  - Sweden Central(Global Standard)swedencentral
  参考
  - 推論モデルの提供リージョン: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/reasoning#availability
  - GPT‑5 セクション(Foundry Models): https://learn.microsoft.com/en-us/azure/ai-foundry/foundry-models/concepts/models-sold-directly-by-azure#azure-openai-in-azure-ai-foundry-models
  注意
  - gpt-5-codex は限定アクセスモデルです。申請: https://aka.ms/oai/gpt5access
  - 提供リージョンは更新される可能性があるため、最新のドキュメントを確認してください。

おわりに

・MCP使う前は、codexにAzure SDKのURLを教えて、ダウンロードの許可与えてなんて面倒なことやってましたがその作業が、嘘みたいに楽になりました。LLMモデルを使用可能なリージョンを調べる時なんかも何アクセスもしてやっとたどりついてたのに劇的な改善です。今までは、Microsoft Learn見ても理解できないことも多くて正直不満もあったのにcodexに聞けば解決できるとなれば、Microsoft Learn さま、さまです。

この記事が何かのお役にたてれば幸いです。

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?