JA

johnrobinsn/askit

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

21 stars 4 forks 品質 64 トレンド 10Apache-2.0

LLM 機能 MCP サーバーのサポートでライブラリと CLI を呼び出す

概要

AskItは、さまざまなLLMモデルがモデルコンテキストプロトコル(MCP)サーバーからサービスを呼び出すことで、さまざまな機能を拡張し、ローカルで定義されたPython関数を呼び出すことで、柔軟な非同期PythonライブラリとCLIツールです。 * シンプルで軽量 * 複数のMCPサーバーに同時に接続 * STDIO、SSEおよびストリーミング可能なHTTP MCPサーバーをサポート * ツール使用/MCPサーバーと呼び出すためのサポート * ローカル定義のPython機能を使用したツール使用/機能コールのサポート * サポート 複数のLMプロバイダー * OpenAIとXAI(Grok) 現在サポート * 不適切、Ollama、およびLMStudioサポート * セキュアなレスポンス APIをストリーミングするためのオプション * 設定可能なオプション * AskIt MCP を使い始めるためには、システムに Python 3.11+ をインストールする必要があります。 python版管理者が推奨されます.

概要(AI 翻訳)

AskItは、さまざまなLLMモデルがモデルコンテキストプロトコル(MCP)サーバーからサービスを呼び出すことで、さまざまな機能を拡張し、ローカルで定義されたPython関数を呼び出すことで、柔軟な非同期PythonライブラリとCLIツールです。

##特徴

  • シンプルで軽量 *複数のMCPサーバーを同時に接続
  • STDIO、SSE、およびストリーミング可能なHTTP MCPサーバーをサポート
  • MCP サーバーとあらゆる言語で書かれたツールの使用/機能の呼び出しのサポート *ローカルで定義された Python 機能と呼ぶ用具の使用/機能のためのサポート *複数のLMを支えて下さい プロバイダー
  • OpenAIとXAI(Grok)が現在サポート
  • Anthropic, Ollama, LMStudio サポート Coming soon
  • LLM応答をストリーミングするためのオプションのサポート *環境変数にAPIキーを安全に保存

インストール

AskIt MCP を使い始めるためには、システムに Python 3.11+ をインストールする必要があります。 python版管理者が推奨されます。 pip を使用してパッケージをインストールします。

AskIt CLIで始める

AskItで始める最も簡単な方法は、統合されたコマンドラインインターフェイス(CLI)ツールを使用することです.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

AskIt MCP Client and Library - Apache License 2.0

AskIt is a flexible asyncio Python library and CLI tool that allows various LLM models to extend their abilities by invoking services from Model Context Protocol (MCP) servers and by calling locally-defined Python functions.

Features

  • Simple and Lightweight
  • Connect to multiple MCP servers simultaneously
  • Supports STDIO, SSE and Streamable-HTTP MCP Servers
  • Support for Tool Use/Function Calling with MCP Servers Written in any Language
  • Support for Tool Use/Function Calling with Locally-Defined Python Functions
  • Supports Multiple LLM Providers
    • OpenAI and XAI (Grok) Currently Supported
    • Anthropic, Ollama, and LMStudio Support Coming Soon
  • Optional Support for Streaming LLM Responses
  • Securely Store API Keys in Environment Variables

Installation

To get started with AskIt MCP, you need to have Python 3.11+ installed on your system. A python version manager is recommended. You can then install the package using pip:

pip install git+https://github.com/johnrobinsn/askit.git

Getting Started with the AskIt CLI

The easiest way to get started with AskIt is to use its integrated command-line interface (CLI) tool. The CLI allows you to interact with MCP servers and LLMs using natural language queries, making it easy to access and manipulate data from various sources.

The following command will leverage the default OpenAI model (gpt-4o-mini) to enter into a “chat-eval” loop with the configured LLM.

You just need to provide your OpenAI API key as a command line argument.

eg.

python -m askit --api_key="your_openai_api_key_here"

You can also provide the OpenAI API key as a provider specific environment variable.

OPENAI_API_KEY="your_openai_api_key_here" python -m askit

You can specify a different model or provider using command-line options. Here is an example using the XAI provider (Grok) with a specific model. You will need to provide your XAI API key as an environment variable or command line argument.

python -m askit --model="grok-4-latest" --provider="XAI" --api_key="your_xai_api_key_here"

Find out more about Provider Specific Environment Variables.

Connect MCP Servers to Askit

You can connect to multiple MCP servers by creating a mcp_config.json file in your current working directory. This file should contain the configuration for the MCP servers you want to connect to. The AskIt CLI will automatically load this configuration and connect to the specified MCP servers.

eg.

{
    "mcpServers": {
      "example-stdio": {
        "command" : "node",
        "cwd" : "/mnt2/code/mcpcalc",
        "args": [
          "mcpcalc.mjs"
        ],
        "env": {
          "debug_log": "false"
        }
      },
      "example-streamable-http": {
        "transport" : "http",
        "url" : "http://127.0.0.1:8000/mcp",
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "example-stdio": { "command" : "node", "cwd" : "/mnt2/code/mcpcalc", "args": [ "mcpcalc.mjs" ], "env": { "debug_log": "false" } }, "example-streamable-http": { "transport" : "http", "url" : "http://127.0.0.1:8000/mcp", "disabled" : false } } }