Skip to main content
Glama

LLM Tool-Calling Assistant

by o6-webwork

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

Datei

Beschreibung

server.py

Registriert Tools und startet den MCP-Server

client-http.py

Verwendet

aiohttp

zur Kommunikation mit lokalem LLM

clientopenai.py

Verwendet OpenAI-kompatibles SDK für LLM + Tool-Aufruflogik

client-stdio.py

MCP-Client mit stdio

client-see.py

MCP-Client mit SSE

data.json

Fragen 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
              F
              license
              -
              quality
              An MCP server that allows Claude to interact with local LLMs running in LM Studio, providing access to list models, generate text, and use chat completions through local models.
              Last updated -
              10
            • -
              security
              F
              license
              -
              quality
              A customized MCP server that enables integration between LLM applications and documentation sources, providing AI-assisted access to LangGraph and Model Context Protocol documentation.
              Last updated -
              1
              • Linux
              • Apple
            • -
              security
              A
              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 -
              MIT License
            • -
              security
              F
              license
              -
              quality
              A tool that connects to local MySQL databases and enables large language models (LLMs) to execute SQL queries through the Model Context Protocol (MCP).
              Last updated -
              288
              1
              • Linux
              • Apple

            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/o6-webwork/mcp-template'

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