0
0

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 で Notion にノートを自動作成してみた(MCP連携)

Last updated at Posted at 2025-10-27

はじめに

ChatGPTをPlusプランにしたことで、Codex(CLI版のAIコーディング支援ツール)を利用できるようになりました。
日々の業務メモをNotionで管理しているので、「Codex CLIからNotionページを自動作成できないかな?」と思い、Notion MCP(Model Context Protocol)を試してみました。


Notion MCPとは

Notion MCPについては、公式ドキュメントに詳しくまとめられています。

MCP(Model Context Protocol)は、ChatGPTやCodexのようなAIエージェントが外部サービスに接続して操作できる仕組みです。
これを使えば、AIがNotionのページを作成したり、既存のデータを読み取ったりできます。


Codex CLIからNotion MCPへ接続

公式ドキュメントの「Stdio MCP」を利用します。

設定は以下の通りです。

{
  "mcpServers": {
    "notionMCP": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.notion.com/mcp"]
    }
  }
}

これをCodexの設定ファイルに追加します。

~/.codex/config.toml

[mcp_servers.notion]
command = "npx"
args    =  ["-y", "mcp-remote", "https://mcp.notion.com/mcp"]

設定後、Codexを起動するとNotion MCPが有効になります。

スクリーンショット 2025-10-15 222637.png

無事、Notion MCPの接続が確認できました。
image.png


動作確認:Notionに自動で仕事メモを作成

Codexのカスタムコマンドを作成してみます。
以下の内容で ~/.codex/prompts/notion-daily.md を用意しました。

notion mcpを利用して以下を実行してください。

1. 仕事メモ/[現在の年月] 以下に今日の日付ファイルを作成

2. 以下の内容を順に聞き、その内容を作成したファイルに反映させてください
  - 今日したこと
  - 今日の課題は
  - 今日の成果
  - 次回出勤日にすること
3. 直近の日付ファイルのTodoの内容を表示し、足したいこと、削除したいことを確認してください

Codexで実行してみる

/prompts:notion-daily を実行します。

スクリーンショット 2025-10-27 214842.png

Codexが順番に質問を投げかけてくれるので、答えていくだけです。

image.png

回答を終えると、Notionにページが自動作成されます。

スクリーンショット 2025-10-27 220046.png


ChatGPTからNotionを使う方法(おまけ)

Notion MCPは、ChatGPTの「接続」機能からも利用できます。
これを使うと、ChatGPTにNotionの内容を直接検索・要約してもらうことが可能です。

設定手順

  1. ChatGPTで「設定 > 接続」を開く
  2. 「Notion MCP」を選択
  3. ChatGPTに接続を許可

image.png

接続が完了したら、Deep ResearchからNotionの情報を検索できます。

image.png

私は毎日Notionに仕事の記録を残しているのですが、ChatGPTで「最近のメモをまとめて」とお願いすると、13分ほどで要約を生成してくれました。

image.png


おわりに

MCPを利用することで、CodexやChatGPTからさまざまな外部サービスを操作できるようになります。
Notion以外にもGitHub、Google Drive、SlackなどのMCPが順次提供されているため、AIを活用した自動化の第一歩としてもおすすめです。


参考リンク

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?