Skip to main content
Glama

Spiral MCP Server

by jxnl

スパイラルMCPサーバー

これは、Pythonを使用したSpiral APIのモデルコンテキストプロトコル(MCP)サーバー実装です。Spiralの言語モデルと対話するための標準化されたインターフェースを提供します。

インストール

mcp install src/server.py --name "spiral-writing-tool" --with pydantic --with requests --with beautifulsoup4 --with httpx

設定

  1. 仮想環境を作成してアクティブ化します。
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
  1. 依存関係をインストールします:
uv pip install -r requirements.txt
  1. ルート ディレクトリに.envファイルを作成し、Spiral API キーを追加します。
SPIRAL_API_KEY=your_api_key_here

APIキーはhttps://app.spiral.computer/apiから取得できます。

サーバーの実行

サーバーを起動します。

python src/server.py

サーバーはデフォルトでポート3000で動作します。PORT環境変数PORT設定することでこれを変更できます。

ツールのテスト

MCP ツールを直接テストするには:

python src/test_tools.py

これにより、利用可能なすべてのツールのテストが実行され、その機能が検証されます。

MCPツール

サーバーは 4 つの強力な MCP ツールを実装します。

リストモデル

利用可能なすべてのスパイラル モデルとその機能およびメタデータを一覧表示します。

応答例:

{ "models": [ { "id": "model-id", "name": "model-name", "description": "Model description", "input_format": "text", "output_format": "text", "capabilities": { "completion": true } } ] }

生成する

指定されたスパイラル モデルを使用してテキストを生成します。

パラメータ:

  • model : 使用するスパイラルモデルのIDまたはスラッグ
  • prompt : 生成する入力テキスト

例:

{ "model": "model_id_or_slug", "prompt": "Your input text here" }

ファイルから生成

ファイルからの入力に基づき、スパイラルモデルを用いてテキストを生成します。これは、大規模なドキュメントの処理や、一貫した書式設定の維持に役立ちます。

パラメータ:

  • model : 使用するスパイラルモデルのIDまたはスラッグ
  • file_path : 入力として使用するファイルへのパス

例:

{ "model": "model_id_or_slug", "file_path": "path/to/your/input.txt" }

生成元URL

URLからの入力に基づき、スパイラルモデルを用いてテキストを生成します。このツールは、Webページから記事のコンテンツを自動的に抽出できます。

パラメータ:

  • model : 使用するスパイラルモデルのIDまたはスラッグ
  • url : コンテンツを取得するURL
  • extract_article : 記事の内容を抽出するか、完全な HTML を使用するか (デフォルト: true)

例:

{ "model": "model_id_or_slug", "url": "https://example.com/article", "extract_article": true }

エラー処理

サーバーは、次のようなさまざまなエラーケースを処理します。

  • 無効なAPIキー
  • モデルが見つかりません
  • 入力が長すぎます
  • レート制限を超えました
  • URL 取得の失敗
  • ファイル読み取りエラー
  • サーバーエラー
  • リクエストタイムアウト

各エラーは、問題の診断に役立つ明確なエラー メッセージを返します。

環境変数

  • SPIRAL_API_KEY : Spiral APIキー(必須)
  • PORT : サーバーポート(オプション、デフォルトは3000)
  • TIMEOUT : リクエストのタイムアウト(秒)(オプション、デフォルトは30)

特徴

  • 堅牢なエラー処理: すべての操作に対する包括的なエラー処理とログ記録
  • 記事抽出: Webページから記事のコンテンツをスマートに抽出します
  • 柔軟な入力ソース: テキスト、ファイル、URLを入力としてサポート
  • 非同期操作: パフォーマンス向上のため、すべての操作は非同期です。
  • 型安全性: すべてのパラメータに対して完全なPydantic型検証を実施
  • ログ記録: トラブルシューティングのための詳細なデバッグログ
-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Spiral の言語モデルと対話するための標準化されたインターフェースを提供し、プロンプト、ファイル、または Web URL からテキストを生成するツールを提供するモデル コンテキスト プロトコル サーバー実装。

  1. インストール
    1. 設定
      1. サーバーの実行
        1. ツールのテスト
          1. MCPツール
            1. リストモデル
            2. 生成する
            3. ファイルから生成
            4. 生成元URL
          2. エラー処理
            1. 環境変数
              1. 特徴

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A 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 -
                  12
                  Python
                  MIT License
                  • Linux
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A 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 -
                  19
                  215
                  2
                  TypeScript
                  MIT License
                  • Apple
                  • Linux
                • -
                  security
                  A
                  license
                  -
                  quality
                  A 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 -
                  TypeScript
                  MIT License
                • -
                  security
                  -
                  license
                  -
                  quality
                  A simple implementation of a Model Context Protocol server that demonstrates core functionality including mathematical tools (add, subtract) and personalized greeting resources.
                  Last updated -
                  3
                  Python
                  GPL 3.0

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/jxnl/spiral-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server