LLM Tool-Calling Assistant
このプロジェクトは、 MCPプロトコルを介してローカルLLM(例:Qwen)を電卓やナレッジベースなどのツールに接続します。アシスタントはこれらのツールを自動的に検出して呼び出し、ユーザーのクエリに回答します。
📦 機能
🔧 MCP サーバーを介したツール実行
🧠 HTTP または OpenAI SDK 経由のローカル LLM 統合
📚 ナレッジベースのサポート (
data.json)⚡
stdioおよびsseトランスポートをサポート
Related MCP server: MCP Server with Local LLM
🗂 プロジェクトファイル
ファイル | 説明 |
| ツールを登録し、MCP サーバーを起動します |
|
|
| LLM + ツール呼び出しロジックに OpenAI 互換の SDK を使用 |
| stdio を使用する MCP クライアント |
| SSEを使用したMCPクライアント |
| Q&Aナレッジベース |
📥 インストール
要件
Python 3.8以上
依存関係をインストールします:
pip install -r requirements.txtrequirements.txt
aiohttp==3.11.18
nest_asyncio==1.6.0
python-dotenv==1.1.0
openai==1.77.0
mcp==1.6.0🚀 はじめに
1. MCPサーバーを実行する
python server.pyこれにより、 add 、 multiply 、 get_knowledge_baseなどの関数を含むツール サーバーが起動します。
2. クライアントを開始する
オプション A: HTTP クライアント (生の API 経由のローカル LLM)
python client-http.pyオプションB: OpenAI SDKクライアント
python client-openai.pyオプションC: stdioトランスポート
python client-stdio.pyオプションD: SSEトランスポート
server.pyが以下を設定していることを確認します。
transport = "sse"次に以下を実行します:
python client-sse.py💬 プロンプトの例
数学ツールの呼び出し
What is 8 times 3?応答:
Eight times three is 24.ナレッジベースの質問
What are the healthcare benefits available to employees in Singapore?応答には、 data.jsonからの関連する回答が含まれます。
📁 例: data.json
[
{
"question": "What is Singapore's public holiday schedule?",
"answer": "Singapore observes several public holidays..."
},
{
"question": "How do I apply for permanent residency in Singapore?",
"answer": "Submit an online application via the ICA website..."
}
]🔧 構成
client-http.pyまたはclientopenai.py内で、以下を更新します。
LOCAL_LLM_URL = "..."
TOKEN = "your-api-token"
LOCAL_LLM_MODEL = "your-model"LLM が OpenAI 互換の API エンドポイントを提供していることを確認します。
🧹 クリーンアップ
クライアントはツールの呼び出しと応答を自動的に処理します。Ctrl Ctrl+Cでサーバーまたはクライアントを停止できます。
🪪 ライセンス
MITライセンス。LICENSEファイルを参照してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
LLM Orchestration Agent (Mcp)
Related MCP Servers
- FlicenseCqualityCmaintenanceA multi-tool MCP server that enhances local LLMs with web search, document reading, scholarly research, Wikipedia access, and calculator functions. Provides comprehensive tools for information retrieval and computation without requiring API keys by default.221-
- FlicenseNot gradedqualityDmaintenanceIntegrates local language models (like Qwen3-8B) with MCP clients, providing tools for chat, code analysis, text generation, translation, and content summarization using your own hardware.-
- AlicenseNot gradedqualityDmaintenanceAutomatically converts CLI tools, APIs, and programs into MCP servers for LLM and agentic use, enabling rapid integration without manual server implementation.1MIT
- FlicenseNot gradedqualityDmaintenanceExposes MCP tools that enable remote LLMs to query local Docker containers, OS processes, and system services in real time.-