MCP サーバーの Hosted と Self-hosted の違い
概要
MCP(Model Context Protocol)サーバーには「Hosted」と「Self-hosted」の2種類がある。Notion を例に整理する。
Hosted MCP サーバー
サービス提供者(この場合 Notion)が自社インフラ上で運営している MCP サーバー。
AIクライアント(Claude Code など) ↓ MCP プロトコル(OAuth 2.0) https://mcp.notion.com/mcp ← Notion が運営 ↓ Notion のデータ - 認証: OAuth 2.0(APIキー不要)
- アクセス範囲: ユーザーが見えるページ全体
- 管理コスト: なし(Notion が管理)
- Claude Code での設定:
claude mcp add --transport http notion https://mcp.notion.com/mcp # その後 /mcp でブラウザ OAuth 認証 Self-hosted MCP サーバー
npm パッケージなどを自分のマシンやサーバーで起動する方式。
AIクライアント(Claude Code など) ↓ stdio ローカルで動く MCP サーバー(npx @notionhq/notion-mcp-server) ↓ Notion REST API(APIキーで認証) Notion のデータ - 認証: Internal Integration Token(
NOTION_API_KEY) - アクセス範囲: 明示的に Integration を共有したページのみ
- 管理コスト: 自分でサーバーを管理・更新
- Claude Code での設定:
{ "mcpServers": { "notion": { "command": "npx", "args": ["-y", "@notionhq/notion-mcp-server"], "env": { "NOTION_API_KEY": "secret_xxxx" } } } } 比較表
| Hosted | Self-hosted | |
|---|---|---|
| 誰が動かす | サービス提供者 | 自分 |
| 認証方式 | OAuth 2.0 | API キー |
| アクセス範囲 | 広い(ユーザー権限全体) | 狭い(共有したページのみ) |
| 管理コスト | なし | あり |
| セキュリティ管理 | OAuth トークン | API キーの管理が必要 |
どちらを選ぶか
- シンプルに使いたい → Hosted(OAuth でブラウザ認証するだけ)
- アクセス範囲を細かく制御したい → Self-hosted(Integration で明示的に共有)
- オフラインや社内環境 → Self-hosted
Notion の場合、Hosted MCP サーバーは https://mcp.notion.com/mcp として提供されており、Claude Code からは claude mcp add --transport http コマンドで簡単に追加できる。
This post is licensed under CC BY 4.0 by the author.