スパイラルMCPサーバー
これは、Pythonを使用したSpiral APIのモデルコンテキストプロトコル(MCP)サーバー実装です。Spiralの言語モデルと対話するための標準化されたインターフェースを提供します。
インストール
設定
- 仮想環境を作成してアクティブ化します。
- 依存関係をインストールします:
- ルート ディレクトリに
.env
ファイルを作成し、Spiral API キーを追加します。
APIキーはhttps://app.spiral.computer/apiから取得できます。
サーバーの実行
サーバーを起動します。
サーバーはデフォルトでポート3000で動作します。PORT環境変数PORT
設定することでこれを変更できます。
ツールのテスト
MCP ツールを直接テストするには:
これにより、利用可能なすべてのツールのテストが実行され、その機能が検証されます。
MCPツール
サーバーは 4 つの強力な MCP ツールを実装します。
リストモデル
利用可能なすべてのスパイラル モデルとその機能およびメタデータを一覧表示します。
応答例:
生成する
指定されたスパイラル モデルを使用してテキストを生成します。
パラメータ:
model
: 使用するスパイラルモデルのIDまたはスラッグprompt
: 生成する入力テキスト
例:
ファイルから生成
ファイルからの入力に基づき、スパイラルモデルを用いてテキストを生成します。これは、大規模なドキュメントの処理や、一貫した書式設定の維持に役立ちます。
パラメータ:
model
: 使用するスパイラルモデルのIDまたはスラッグfile_path
: 入力として使用するファイルへのパス
例:
生成元URL
URLからの入力に基づき、スパイラルモデルを用いてテキストを生成します。このツールは、Webページから記事のコンテンツを自動的に抽出できます。
パラメータ:
model
: 使用するスパイラルモデルのIDまたはスラッグurl
: コンテンツを取得するURLextract_article
: 記事の内容を抽出するか、完全な HTML を使用するか (デフォルト: true)
例:
エラー処理
サーバーは、次のようなさまざまなエラーケースを処理します。
- 無効なAPIキー
- モデルが見つかりません
- 入力が長すぎます
- レート制限を超えました
- URL 取得の失敗
- ファイル読み取りエラー
- サーバーエラー
- リクエストタイムアウト
各エラーは、問題の診断に役立つ明確なエラー メッセージを返します。
環境変数
SPIRAL_API_KEY
: Spiral APIキー(必須)PORT
: サーバーポート(オプション、デフォルトは3000)TIMEOUT
: リクエストのタイムアウト(秒)(オプション、デフォルトは30)
特徴
- 堅牢なエラー処理: すべての操作に対する包括的なエラー処理とログ記録
- 記事抽出: Webページから記事のコンテンツをスマートに抽出します
- 柔軟な入力ソース: テキスト、ファイル、URLを入力としてサポート
- 非同期操作: パフォーマンス向上のため、すべての操作は非同期です。
- 型安全性: すべてのパラメータに対して完全なPydantic型検証を実施
- ログ記録: トラブルシューティングのための詳細なデバッグログ
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Spiral の言語モデルと対話するための標準化されたインターフェースを提供し、プロンプト、ファイル、または Web URL からテキストを生成するツールを提供するモデル コンテキスト プロトコル サーバー実装。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools for code modification and generation via Large Language Models, allowing users to create, modify, rewrite, and delete files using structured XML instructions.Last updated -12PythonMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server providing utility tools for development and testing, offering functionalities like personalized greetings, random card drawing, and datetime formatting with an extensible architecture.Last updated -192152TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server implementation that provides a standardized interface for applications to interact with OpenRouter's language models through a unified conversation management system.Last updated -TypeScriptMIT License
- -security-license-qualityA simple implementation of a Model Context Protocol server that demonstrates core functionality including mathematical tools (add, subtract) and personalized greeting resources.Last updated -3PythonGPL 3.0
Appeared in Searches
- Information about SSE (possible meanings: Scottish and Southern Energy, Server-Sent Events, etc.)
- Understanding and Techniques for Summarizing Information
- Automating document interaction, download, and conversion for AI-driven answers
- Retrieve Website Titles Based on Given URLs
- A server for finding language exercises