
johnrobinsn/askit
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
LLM Function Calling Library and CLI with Support for MCP Servers
Обзор
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. * 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 * Optional Support for Streaming LLM Responses * Securely Store API Keys in Environment Variables To get started with AskIt MCP, you need to have Python 3.11+ installed on your system. A python version manager is recommended.
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",
Установка
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
}
}
}