Integrates with Google APIs using service account authentication for server-side access to Google services including Drive and Docs operations
Provides tools for creating, writing to, and managing Google Docs documents, including specialized operations for EpisodicRAG learning logs and document organization within specific folders
Day 5: APIs From Remote MCP
学習目標
Day4のLocal MCPサーバーをRemote MCPサーバーとしてデプロイし、Claude WebからもGoogle Docs操作を可能にする
今日学ぶこと
Local MCP vs Remote MCP の違い
HTTP/WebSocketベースのMCPサーバー実装
Claude Web Custom Connectors との統合
スケーラブルなAPI統合アーキテクチャ
本格的なEpisodicRAGシステムの基盤構築
プロジェクト構造
Day1-4からのステップアップ
これまでの学習 → Day5での発展
Day1: Python関数 → スケーラブルなAPI関数
Day2: Local MCP → Remote MCP Server
Day3: 認証学習 → サーバーサイド認証管理
Day4: Claude Desktop統合 → Claude Web + Custom Connectors
Local MCP vs Remote MCP
Local MCP (Day4)
特徴:
Claude Desktop専用
Stdio通信(標準入出力)
ローカルプロセス
OAuth2認証(ユーザー権限)
Remote MCP (Day5)
特徴:
Claude Web + Desktop 両対応
HTTP/WebSocket通信
リモートサーバー
サービスアカウント認証(サーバー権限)
アーキテクチャ設計
Core Components
1. Remote MCP Server
2. Authentication Strategy
3. Claude Web Integration
技術スタック
Backend
Express.js: HTTP サーバー
ws: WebSocket サポート
Google APIs: Day3・4の知識活用
Zod: スキーマ検証(Day4と同じ)
Deployment Options
Vercel: サーバーレス関数(推奨)
Railway: フルスタックホスティング
Docker: コンテナデプロイ
Security
API Key認証: カスタムコネクタ用
Rate Limiting: DDoS防止
CORS: クロスオリジン制御
Input Validation: Zod による検証
Day5の革新的なポイント
1. Universal Access
2. Scalable Architecture
3. EpisodicRAG Foundation
Centralized Knowledge: すべてのクライアントから同じEpisodicRAGフォルダーにアクセス
Unified API: 一貫したGoogle Docs操作
Multi-User Support: 将来的な複数ユーザー対応
MCP Protocol Implementation
HTTP Endpoint Design
WebSocket Real-time Updates
セキュリティ考慮事項
1. API Key Management
Environment Variables で秘密鍵管理
Rotation 可能な API キー設計
Per-client access control
2. Rate Limiting
3. Input Sanitization
Deployment Strategy
Phase 1: Basic Remote MCP
Express サーバー実装
Day4 tools の HTTP 版変換
Vercel デプロイ
Claude Web テスト
Phase 2: Advanced Features
WebSocket リアルタイム更新
Multi-user support
Advanced error handling
Monitoring & Logging
Phase 3: EpisodicRAG Integration
Knowledge graph connections
Advanced document relationships
AI-powered content suggestions
Automated knowledge curation
🎉 デプロイ成功!
Railway.app でのデプロイ
Public URL: https://testday5-production.up.railway.app
Health Check: https://testday5-production.up.railway.app/health
MCP Endpoint: https://testday5-production.up.railway.app/mcp
Claude Web Custom Connector設定
利用可能なツール
get_time
- 現在時刻を取得echo
- メッセージをエコーcalculate
- 簡単な数式計算
成功基準
Remote MCPサーバーがHTTPで動作する ✅
Claude WebでCustom Connectorが設定できる ✅
Railway.appでのデプロイ成功 ✅
Day4と同等のGoogle Docs操作がリモートで可能
スケーラブルなアーキテクチャの基盤完成 ✅
Day4との互換性
Shared Tools
create_document
→ HTTP POST /mcp/tools/callwrite_to_document
→ 同上list_loop_documents
→ 同上create_learning_log
→ 同上
Migration Path
次のステップ(Day6以降展望)
Advanced EpisodicRAG: AIベースのナレッジキュレーション
Multi-API Integration: Slack, Notion, GitHub等との統合
Real-time Collaboration: リアルタイム共同編集
AI Assistant Integration: GPT-4, Claude等との直接統合
参考リンク
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables Claude Web to interact with Google Docs through a remote HTTP-based MCP server. Provides scalable document operations including creation, editing, and management with service account authentication.