Skip to main content
Glama
Notion Uploader MCP

Notion Uploader MCP

by jkkitakita

Notion Uploader MCP

Model Context Protocol (MCP) サーバーで、CursorのチャットからNotionページに画像やファイルをアップロードできます。

機能

  • ローカルファイルをNotionページにアップロード

  • 複数の添付方法をサポート:

    • image: ページ内に画像ブロックとして追加

    • file: ページ内にファイルブロックとして追加

    • cover: ページのカバー画像として設定

    • icon: ページのアイコンとして設定

  • データベースプロパティへの添付

  • 大容量ファイルのマルチパートアップロード対応(20MB以上)

  • キャプション追加機能

Related MCP server: MCP Notion Upload Server

セットアップ

1. Notion APIトークンの取得

  1. Notion Integrations にアクセス

  2. "New integration" をクリック

  3. インテグレーションを作成し、APIトークンをコピー

  4. アップロード先のNotionページにインテグレーションを招待

2. 依存関係のインストール

cd tools/notion-uploader-mcp
npm install

3. ビルド

npm run build

4. 環境変数の設定

.envファイルを作成し、Notion APIトークンを設定:

cp .env.example .env
# .envファイルを編集してNOTION_TOKENを設定

または、環境変数として設定:

export NOTION_TOKEN=secret_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

5. MCP設定への追加

プロジェクトルートの .mcp.json に以下を追加:

{
  "mcpServers": {
    "notion-uploader": {
      "type": "stdio",
      "command": "node",
      "args": ["./tools/notion-uploader-mcp/dist/server.mjs"],
      "env": {
        "NOTION_TOKEN": "${NOTION_TOKEN}"
      }
    }
  }
}

使用方法

Cursorのチャットで、upload_to_notion ツールが利用可能になります。

パラメータ

  • file_path (必須): アップロードするファイルの絶対パス

  • page_id_or_url (必須): NotionページのIDまたはURL

  • attach_as (オプション): 添付方法

    • "image" (デフォルト): 画像ブロックとして追加

    • "file": ファイルブロックとして追加

    • "cover": ページカバーとして設定

    • "icon": ページアイコンとして設定

  • property (オプション): データベースのファイルプロパティ名

  • caption (オプション): ファイルのキャプション

使用例

# 画像をページに追加
upload_to_notion(
  file_path: "/path/to/image.png",
  page_id_or_url: "https://notion.so/your-page-id",
  caption: "プロジェクトのスクリーンショット"
)

# ページカバーとして設定
upload_to_notion(
  file_path: "/path/to/cover.jpg",
  page_id_or_url: "your-page-id",
  attach_as: "cover"
)

# データベースプロパティに添付
upload_to_notion(
  file_path: "/path/to/document.pdf",
  page_id_or_url: "database-page-id",
  property: "添付ファイル"
)

開発

開発モード

TypeScriptファイルを直接実行:

npm run dev

ビルド

TypeScriptをJavaScriptにコンパイル:

npm run build

トラブルシューティング

  1. NOTION_TOKEN not found: 環境変数が正しく設定されているか確認

  2. Page not found: ページIDが正しいか、インテグレーションが招待されているか確認

  3. Permission denied: インテグレーションに適切な権限があるか確認

ライセンス

プロジェクトのライセンスに従います。

Available Tools

2 tools
upload_to_notionC

Upload a local file to Notion and attach it to a page

Inputs: file_path (required), page_id_or_url (required), caption, property, +1 more.

upload_to_notion_atB

Upload a file and insert an image/file block immediately AFTER a placeholder or a specific block_id

Inputs: file_path (required), page_id_or_url (required), caption, block_id, +4 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 2 tools

    Disambiguation3/5

    Both tools perform uploads to Notion, differing only in placement: one attaches to a page generically, the other inserts after a specific block. The names are very similar, so an agent could easily pick the wrong one without reading carefully, though the descriptions do clarify the distinction.

    Naming Consistency5/5

    Both tool names follow the same verb_noun pattern, 'upload_to_notion', with the second adding a consistent '_at' suffix to indicate location specificity. This is a predictable and uniform convention.

    Tool Count3/5

    With only two tools, the server feels borderline thin for its stated purpose, though each tool does cover a distinct aspect of uploading. It is not egregiously sparse, but a more complete server might include additional related operations.

    Completeness4/5

    The server covers the core upload functionality for its narrow domain: basic page attachment and targeted insertion after a block. Minor gaps exist, such as lacking an explicit way to specify a page for the general upload or support for deleting/replacing uploaded blocks, but agents can likely accomplish common tasks with these two tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers