LLM Tool-Calling Assistant

by o6-webwork

Integrations

  • Enables interaction with local LLMs running on the user's machine via an HTTP interface or OpenAI-compatible SDK.

  • Allows communication with OpenAI-compatible language models using the OpenAI SDK for tool-calling functionality.

Dieses Projekt verbindet ein lokales LLM (z. B. Qwen) über das MCP- Protokoll mit Tools wie einem Taschenrechner oder einer Wissensdatenbank. Der Assistent erkennt diese Tools automatisch und ruft sie auf, um Benutzeranfragen zu beantworten.


📦 Funktionen

  • 🔧 Toolausführung über MCP-Server
  • 🧠 Lokale LLM-Integration über HTTP oder OpenAI SDK
  • 📚 Wissensdatenbank-Support ( data.json )
  • ⚡ Unterstützt stdio und sse -Transporte

🗂 Projektdateien

DateiBeschreibung
server.pyRegistriert Tools und startet den MCP-Server
client-http.pyVerwendet aiohttp zur Kommunikation mit lokalem LLM
clientopenai.pyVerwendet OpenAI-kompatibles SDK für LLM + Tool-Aufruflogik
client-stdio.pyMCP-Client mit stdio
client-see.pyMCP-Client mit SSE
data.jsonFragen und Antworten-Wissensdatenbank

📥 Installation

Anforderungen

Python 3.8+

Installieren Sie Abhängigkeiten:

pip install -r requirements.txt

requirements.txt

aiohttp==3.11.18 nest_asyncio==1.6.0 python-dotenv==1.1.0 openai==1.77.0 mcp==1.6.0

🚀 Erste Schritte

1. Führen Sie den MCP-Server aus

python server.py

Dadurch wird Ihr Tool-Server mit Funktionen wie „ add , multiply und get_knowledge_base gestartet.

2. Starten Sie einen Client

Option A: HTTP-Client (lokales LLM über Raw-API)
python client-http.py
Option B: OpenAI SDK-Client
python client-openai.py
Option C: Standardtransport
python client-stdio.py
Option D: SSE-Transport

Stellen Sie sicher, dass server.py Folgendes festlegt:

transport = "sse"

Führen Sie dann Folgendes aus:

python client-sse.py

💬 Beispielaufforderungen

Aufruf des Mathe-Tools

What is 8 times 3?

Antwort:

Eight times three is 24.

Wissensdatenbankfrage

What are the healthcare benefits available to employees in Singapore?

Die Antwort enthält die entsprechende Antwort aus data.json .


📁 Beispiel: 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..." } ]

🔧 Konfiguration

Aktualisieren Sie in client-http.py oder clientopenai.py Folgendes:

LOCAL_LLM_URL = "..." TOKEN = "your-api-token" LOCAL_LLM_MODEL = "your-model"

Stellen Sie sicher, dass Ihr LLM OpenAI-kompatible API-Endpunkte bereitstellt.


🧹 Aufräumen

Clients verarbeiten Tool-Aufrufe und -Antworten automatisch. Sie können den Server oder Client mit Ctrl+C stoppen.


🪪 Lizenz

MIT-Lizenz. Siehe LICENSE- Datei.

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

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

Verbindet lokale LLMs über das MCP-Protokoll mit externen Tools (Rechner, Wissensdatenbank) und ermöglicht so die automatische Erkennung und Ausführung von Tools zur Verbesserung der Abfrageantworten.

  1. 🗂 Projektdateien
    1. 📥 Installation
      1. Anforderungen
      2. requirements.txt
    2. 🚀 Erste Schritte
      1. 1. Führen Sie den MCP-Server aus
      2. 2. Starten Sie einen Client
    3. 💬 Beispielaufforderungen
      1. Aufruf des Mathe-Tools
      2. Wissensdatenbankfrage
    4. 📁 Beispiel: data.json
      1. 🔧 Konfiguration
        1. 🧹 Aufräumen
          1. 🪪 Lizenz

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              MCP server for toolhouse.ai. This does not rely on an external llm unlike the official server.
              Last updated -
              1
              Python
              MIT License
            • -
              security
              A
              license
              -
              quality
              A comprehensive toolkit that enhances LLM capabilities through the Model Context Protocol, allowing LLMs to interact with external services including command-line operations, file management, Figma integration, and audio processing.
              Last updated -
              14
              Python
              Apache 2.0
              • Linux
              • Apple
            • -
              security
              A
              license
              -
              quality
              An MCP server that provides tools to load and fetch documentation from any llms.txt source, giving users full control over context retrieval for LLMs in IDE agents and applications.
              Last updated -
              177
              Python
              MIT License
              • Apple
            • -
              security
              -
              license
              -
              quality
              A tool server that processes mathematical expressions via Multi-Chain Protocol (MCP), allowing LLMs to solve math problems through tool integration.
              Last updated -
              Python
              MIT License

            View all related MCP servers

            ID: d0hc6ovns6