1
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?

OpenCodeでNotionをMCP接続する!

1
Last updated at Posted at 2026-05-13

概要

OpenCodeからNotionをMCPで接続することで、OpenCodeがNotionのページ読み書きを直接行えるようになります!

前提条件

  • OpenCodeがインストール済みであること
  • Notionアカウントを持っていること

設定手順

1. opencode.json を開く

設定ファイルは2種類あります。

種類 パス
グローバル(全プロジェクト共通) ~/.config/opencode/opencode.json
プロジェクト(そのプロジェクトのみ) ./opencode.json(プロジェクトルート)

ファイルがなければ作成する。

mkdir -p ~/.config/opencode
touch ~/.config/opencode/opencode.json

2. Notion MCPサーバーを追加する

opencode.json に以下を追記する。

{
  "mcp": {
    "notion": {
      "type": "remote",
      "url": "https://mcp.notion.com/mcp",
      "enabled": true
    }
  }
}

type について

type 説明
remote インターネット上のURLにあるMCPサーバーに接続する
local 自分のPC上で動かすMCPサーバー

Notionは公式がリモートサーバーを用意しているので remote を使う。

3. OAuth認証する

以下を実行する。
実行すると、ブラウザが開いてNotionの認証ページに飛ぶのでOpenCodeに編集させたいワークスペースを選択して認証する。

opencode mcp auth notion

4. 動作確認

OpenCodeを起動してチャットでNotionに関するタスクを依頼すると、自動でMCPツールが使われる。

「Notionの○○ページに新しいページを作って」

参考ページ

他のMCPサーバーも同じような手順でOpenCodeに接続することができます。
詳しくは以下の公式ドキュメントを参考にしてみてください。

1
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
1
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?