Ultrafast Mcp Sequential Thinking について
UltraFast MCP Sequential Thinking は、構造化された反復的な問題解決を支援するRust製のMCPサーバー兼クライアントです。分岐や思考の修正、セッション管理、エクスポート、分析に対応し、stdioとHTTPで接続できます。
主な機能
- 01問題を順序立てた思考に分割
- 02思考の修正と分岐の探索
- 03計画の深さを動的に調整
- 04セッションの管理、統合、出力
- 05セッション分析と進捗追跡
活用シーン
- 01複数段階の問題解決を整理
- 02異なる推論経路を比較
- 03思考セッションを保存して再確認
MCP 対応
sequential_thinking、export_session、analyze_session、merge_sessionsの各ツールと、セッションおよび分析データのリソースを提供します。stdioとHTTPに対応しています。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
ツール
ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。
詳細
UltraFast MCP Sequential Thinking
公式 Docker イメージは techgopal/ultrafast-mcp-sequential-thinking で利用できます
UltraFast MCP フレームワークを基盤として構築された、逐次的思考のための高性能な Rust ベースの Model Context Protocol(MCP)サーバーおよびクライアント実装です。
🚀 概要
UltraFast MCP Sequential Thinking は、動的かつ内省的な思考プロセスを通じて、構造化された問題解決方法を提供します。この実装は、MCP 2025-06-18 仕様との完全な互換性を維持しながら、公式の TypeScript 版に比べて大幅なパフォーマンス上の利点を提供します。
✨ 特徴
中核機能
- 動的な問題の分解:複雑な問題を対処しやすいステップに分解します
- 内省的な思考:理解が深まるにつれて、思考を見直し、洗練させます
- 分岐ロジック:代替の推論経路を検討します
- 適応型プランニング:思考の総数を動的に調整します
- 解決策の検証:解決策の仮説を生成して検証します
- コンテキストの保持:複数のステップにわたって思考のコンテキストを維持します
パフォーマンス上の利点
- 10~100 倍高速:Rust の実装により、大幅なパフォーマンス向上を実現します
- メモリ効率:大規模な思考セッションの処理に最適化されています
- 並行処理:高スループットの操作を実現する async/await サポート
- 型安全性:プロトコルへの準拠をコンパイル時に保証します
- 本番環境対応:包括的なエラー処理と監視機能を備えています
強化された機能
- 進捗の追跡:長時間の思考セッション中にリアルタイムで進捗を通知します
- キャンセルのサポート:必要に応じて思考プロセスを中断できます
- セッション管理:接続をまたいで思考セッションを保持します
- エクスポート機能:思考セッションをさまざまな形式でエクスポートします
- 分析:思考パターンと効率に関する詳細な分析を提供します
🏗️ アーキテクチャ
サーバーコンポーネント
┌─────────────────────────────────────────────────────────────┐
│ Sequential Thinking Server │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Thinking │ │ Session │ │ Analytics │ │
│ │ Engine │ │ Management │ │ & Metrics │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Branch │ │ Context │ │ Export │ │
│ │ Management │ │ Tracking │ │ Handlers │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ UltraFast MCP Core │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Protocol │ │ Transport │ │ Handlers │ │
│ │ Layer │ │ Layer │ │ System │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
クライアントコンポーネント
┌─────────────────────────────────────────────────────────────┐
│ Sequential Thinking Client │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Session │ │ Progress │ │ Export │ │
│ │ Manager │ │ Tracker │ │ Manager │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Thinking │ │ Branch │ │ Analytics │ │
│ │ Interface │ │ Explorer │ │ Dashboard │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ UltraFast MCP Client │
└─────────────────────────────────────────────────────────────┘
🛠️ インストール
前提条件
- Rust 1.70 以降
- Cargo(Rust パッケージマネージャー)
クイックスタート
1. リポジトリをクローンする
git clone https://github.com/your-org/ultrafast-mcp-sequential-thinking.git
cd ultrafast-mcp-sequential-thinking
2. プロジェクトをビルドする
cargo build --release
3. サーバーを実行する
# STDIO transport (default)
cargo run --bin sequential-thinking-server
# HTTP transport
cargo run --bin sequential-thinking-server -- --transport http --port 8080
4. クライアントを実行する
# Connect to server
cargo run --bin sequential-thinking-client -- --server stdio://
# Connect to HTTP server
cargo run --bin sequential-thinking-client -- --server http://localhost:8080
5. MCP Inspector を使用する(任意)
# Start HTTP server for Inspector
cargo run --bin sequential-thinking-server -- --transport http --port 8080
# Open MCP Inspector and load mcp-inspector-config.json
# Choose "sequential-thinking-server-http" for HTTP transport
Docker を使ったクイックスタート
1. 公式 Docker イメージを使用する
# Pull the latest image from Docker Hub
docker pull techgopal/ultrafast-mcp-sequential-thinking:latest
# Run HTTP server on port 8080
docker run --rm -p 8080:8080 techgopal/ultrafast-mcp-sequential-thinking:latest
# Run with custom configuration
docker run --rm -p 8080:8080 -e MAX_THOUGHTS=200 techgopal/ultrafast-mcp-sequential-thinking:latest
# Run in detached mode
docker run -d --name thinking-server -p 8080:8080 techgopal/ultrafast-mcp-sequential-thinking:latest
2. (任意)Docker イメージをローカルでビルドする
# Build the server image locally (if you want to make changes)
docker build -t sequential-thinking-server .
# Verify the image was created
docker images | grep sequential-thinking-server
3. クライアントを Docker サーバーに接続する
# Connect to HTTP server running in Docker
cargo run --bin sequential-thinking-client -- --server http://localhost:8080
# Or use curl to test the server
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-06-18"},"id":1}'
MCP Inspector の Docker 設定例
MCP Inspector やその他のツールを使用して、分析や最大思考数の増加などの高度なオプションを指定し、Docker コンテナ内でサーバーを起動する場合は、次の設定を使用します。
{
"mcpServers": {
"sequential-thinking": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"techgopal/ultrafast-mcp-sequential-thinking:latest",
"/usr/local/bin/sequential-thinking-server",
"--transport",
"stdio",
"--max-thoughts",
"200",
"--enable-analytics"
],
"env": {}
}
}
}
この設定では、STDIO トランスポートを使用し、分析を有効にして、最大思考数の上限を引き上げた状態で、Docker コンテナ内のサーバーを起動します。用途に応じて引数を調整してください。
4. Docker Compose(任意)
# Create docker-compose.yml for easy deployment
cat > docker-compose.yml << EOF
version: '3.8'
services:
sequential-thinking-server:
build: .
ports:
- "8080:8080"
environment:
- MAX_THOUGHTS=100
- ENABLE_ANALYTICS=true
restart: unless-stopped
EOF
# Start with Docker Compose
docker-compose up -d
# Stop the service
docker-compose down
マルチプラットフォームの Docker サポート
Docker イメージは、幅広い互換性を実現するため、複数のプラットフォームをサポートしています。
サポート対象プラットフォーム
- linux/amd64:Intel/AMD 64 ビットプロセッサ
- linux/arm64:ARM 64 ビットプロセッサ(Apple Silicon、ARM サーバー)
- linux/arm/v7:ARM 32 ビットプロセッサ(Raspberry Pi、旧型 ARM デバイス)
プラットフォーム固有の使用方法
# Pull for specific platform
docker pull --platform linux/amd64 techgopal/ultrafast-mcp-sequential-thinking:latest
docker pull --platform linux/arm64 techgopal/ultrafast-mcp-sequential-thinking:latest
docker pull --platform linux/arm/v7 techgopal/ultrafast-mcp-sequential-thinking:latest
# Run on specific platform
docker run --platform linux/amd64 --rm -p 8080:8080 techgopal/ultrafast-mcp-sequential-thinking:latest
docker run --platform linux/arm64 --rm -p 8080:8080 techgopal/ultrafast-mcp-sequential-thinking:latest
docker run --platform linux/arm/v7 --rm -p 8080:8080 techgopal/ultrafast-mcp-sequential-thinking:latest
マルチプラットフォームイメージをローカルでビルドする
# Set up Docker Buildx for multi-platform builds
docker buildx create --name multiplatform --use
# Build for all supported platforms
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \
-t your-username/ultrafast-mcp-sequential-thinking:latest \
--push .
# Build for specific platform only
docker buildx build --platform linux/arm64 \
-t your-username/ultrafast-mcp-sequential-thinking:arm64 \
--push .
プラットフォーム指定を含む Docker Compose
# docker-compose.yml
version: '3.8'
services:
sequential-thinking:
image: techgopal/ultrafast-mcp-sequential-thinking:latest
platform: linux/arm64 # Specify platform for ARM64
ports:
- "8080:8080"
environment:
- MAX_THOUGHTS=200
- ENABLE_ANALYTICS=true
restart: unless-stopped
CI/CD マルチプラットフォームパイプライン
このプロジェクトには、マルチプラットフォームイメージを自動的にビルドしてプッシュする GitHub Actions ワークフローが含まれています。
- Docker Test:プルリクエストでイメージをビルドしてテストします
- Docker Release:main ブランチでマルチプラットフォームイメージをビルドしてプッシュします
- キャッシュ:GitHub Actions のキャッシュを使用してビルドを高速化します
- プロベナンス:互換性を高めるため無効になっています
ビルドスクリプト
このプロジェクトには、マルチプラットフォームイメージのビルドとテストに便利なスクリプトが含まれています。
# Build multi-platform images locally
./scripts/build-multi-platform.sh --push
# Test multi-platform images
./scripts/test-multi-platform.sh
# Build for specific platforms only
./scripts/build-multi-platform.sh -p linux/amd64,linux/arm64 --push
# Test with custom image and port
./scripts/test-multi-platform.sh -i my-image -t v1.0.0 -p 9090
🔧 設定
MCP Inspector
このプロジェクトには、HTTP と STDIO の両方のトランスポートモードに対応する MCP Inspector 設定ファイル(mcp-inspector-config.json)が含まれています。
MCP Inspector の使用
-
サーバーを起動します(いずれかを選択してください)。
# HTTP transport (recommended for Inspector) cargo run --bin sequential-thinking-server -- --transport http --port 8080 # STDIO transport cargo run --bin sequential-thinking-server -- --transport stdio -
MCP Inspector を開き、設定ファイルを読み込みます。
- プロジェクトディレクトリに移動します
mcp-inspector-config.jsonを選択します- 使用するトランスポートモードを選択します。
- HTTP:
sequential-thinking-server-http(デフォルト) - STDIO:
sequential-thinking-server-stdio
- HTTP:
-
ツールをテストします。
sequential_thinking:問題解決のための主要な思考ツールexport_session:セッションをさまざまな形式でエクスポートしますanalyze_session:分析情報とインサイトを取得しますmerge_sessions:複数のセッションを結合します
設定ファイルの構造
mcp-inspector-config.json には、次の内容が含まれています。
- HTTP サーバー:
http://localhost:8080/mcp - STDIO サーバー:stdio トランスポートを使用する Cargo サブプロセス
- ツールスキーマ:すべてのツールの完全な入出力スキーマ
- ドキュメント:各ツールの詳細な説明
サーバー設定
# config.toml
[server]
name = "ultrafast-sequential-thinking"
version = "1.0.0"
transport = "http"
port = 8080
[thinking]
max_thoughts_per_session = 100
max_branches_per_session = 10
session_timeout_seconds = 3600
enable_analytics = true
[export]
formats = ["json", "markdown", "pdf"]
auto_export = false
クライアント設定
# client_config.toml
[client]
server_url = "http://localhost:8080"
timeout_seconds = 30
retry_attempts = 3
[thinking]
auto_save_interval = 60
enable_progress_tracking = true
show_thought_visualization = true
📊 API リファレンス
コア型
ThoughtData
pub struct ThoughtData {
pub thought: String,
pub thought_number: u32,
pub total_thoughts: u32,
pub next_thought_needed: bool,
pub is_revision: Option<bool>,
pub revises_thought: Option<u32>,
pub branch_from_thought: Option<u32>,
pub branch_id: Option<String>,
pub needs_more_thoughts: Option<bool>,
}
ThinkingSession
pub struct ThinkingSession {
pub session_id: String,
pub title: String,
pub thoughts: Vec<ThoughtData>,
pub branches: HashMap<String, Vec<ThoughtData>>,
pub metadata: SessionMetadata,
}
サーバーエンドポイント
ツール
sequential_thinking:主要な思考ツール(MCP 2025-06-18 に準拠)export_session:思考セッションをさまざまな形式でエクスポートしますanalyze_session:セッションの分析情報とインサイトを取得しますmerge_sessions:複数の思考セッションを統合します
リソース
session_history:思考セッションの履歴にアクセスしますanalytics_data:セッションの分析情報とメトリクスexport_templates:エクスポート形式のテンプレート
🧪 テスト
テストの実行
# Run all tests
cargo test
# Run specific test suite
cargo test --test thinking_tests
# Run with coverage
cargo tarpaulin
統合テスト
# Run integration tests
cargo test --test integration_tests
# Run performance benchmarks
cargo bench
📈 パフォーマンス
ベンチマーク
- 思考の処理:1 思考あたり約 0.1ms(TypeScript では 1~5ms)
- セッションの作成:約 0.5ms(TypeScript では 10~20ms)
- ブランチ管理:1 ブランチあたり約 0.2ms(TypeScript では 2~8ms)
- エクスポート操作:JSON は約 1ms、Markdown は約 5ms(TypeScript では 50~200ms)
メモリ使用量
- セッションあたり:基本約 2KB + 思考ごとに 100 bytes
- サーバーメモリ:基本約 10MB + アクティブなセッションごとに 1KB
- クライアントメモリ:基本約 5MB + セッションごとに 500 bytes
🔒 セキュリティ
機能
- 入力検証:すべての入力を包括的に検証します
- セッション分離:セッション間を完全に分離します
- レート制限:API エンドポイントに組み込みのレート制限を適用します
- 認証:OAuth 2.1 をオプションでサポートします
- 監査ログ:すべての操作の完全な監査証跡を記録します
ベストプラクティス
- すべてのユーザー入力を処理前に検証します
- 適切なセッションのクリーンアップを実装します
- すべての HTTP 通信に HTTPS を使用します
- セキュリティ監査と更新を定期的に実施します
🤝 貢献
開発環境のセットアップ
# Clone repository
git clone https://github.com/techgopal/ultrafast-mcp-sequential-thinking.git
cd ultrafast-mcp-sequential-thinking
# Install dependencies
cargo build
# Run development server
cargo run --bin sequential-thinking-server -- --dev
# Run tests
cargo test
コードスタイル
- Rust のコーディング規約に従います
cargo fmtを使用してフォーマットしますcargo clippyを使用してリントします- 包括的なテストを作成します
プルリクエストの手順
- リポジトリをフォークします
- 機能ブランチを作成します
- 変更を加えます
- テストを追加します
- ドキュメントを更新します
- プルリクエストを送信します
📄 ライセンス
このプロジェクトは MIT License の下でライセンスされています。詳細については、LICENSE ファイルを参照してください。
🙏 謝辞
- Model Context Protocol:優れたプロトコル仕様を提供してくださったことに感謝します
- UltraFast MCP:高性能な Rust フレームワークを提供してくださったことに感謝します
- Official Sequential Thinking Server:オリジナルの TypeScript 実装を提供してくださったことに感謝します
🔄 変更履歴
v1.0.0
- 初回リリース
- MCP 2025-06-18 に完全準拠
- 高性能な Rust 実装
- 包括的なテストスイート
- 本番環境対応の機能
UltraFast MCP を使用して ❤️ を込めて構築
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。