MCP Server Demo

Integrations
  • Integrates with Ollama to provide local LLM capabilities (using Llama 3 or other compatible models) for processing natural language queries and responding to free-form conversation.

  • Manages user data in a PostgreSQL database, supporting CRUD operations (add, delete, modify, query) for user profiles with details like names and email addresses.

  • Provides a web-based chat interface built with Streamlit, allowing users to interact with the system through natural language commands for database operations and free conversation.

MCP-Server-Demo mit Streamlit und Ollama

Dieses Projekt ist eine Demo eines Python MCP-Servers (Model Context Protocol), integriert mit einer in Streamlit erstellten Web-Chat-Schnittstelle und einem lokalen Sprachmodell mit Ollama. Ermöglicht Ihnen die Verwaltung von Benutzern in einer PostgreSQL-Datenbank (Hinzufügen, Löschen, Ändern, Abfragen) sowohl vom Chat als auch von externen MCP-Tools aus.

Eigenschaften

  • Web-Chat mit Streamlit.
  • Lokales LLM mit Ollama (Llama 3 oder ein anderes kompatibles Modell).
  • MCP-Server mit Tools für Benutzer-CRUD.
  • PostgreSQL-Datenbank zum Speichern von Benutzern.
  • Flexible Integration : Sie können nur den Chat, nur den MCP-Server oder beides verwenden.

Anforderungen

  • Python 3.9+
  • PostgreSQL läuft und ist zugänglich
  • Ollama installiert und ausgeführt (für lokales LLM)
  • Virtuelle Umgebung (empfohlen)
  • Abhängigkeiten in der Datei requirements.txt

Einrichtung

  1. Klonen Sie das Repository:
    git clone https://github.com/tu-usuario/mcp-server-demo.git cd mcp-server-demo
  2. Erstellen und aktivieren Sie eine virtuelle Umgebung:
    python -m venv .venv source .venv/bin/activate # En Linux/Mac .venv\\Scripts\\activate # En Windows
  3. Installieren Sie die Abhängigkeiten:
    pip install -r requirements.txt
  4. Konfigurieren Sie Ihre PostgreSQL-Datenbank und konfigurieren Sie die Verbindungsdetails in server.py .
  5. (Optional) Erstellen Sie eine .env Datei, wenn Sie API-Schlüssel verwenden.

Verwenden

1. Levanta Ollama und das LLM-Modell

ollama run llama3

2. Öffnen Sie den Streamlit-Chat

streamlit run streamlit.py

Öffnen Sie Ihren Browser unter http://localhost:8501 .

3. (Optional) Starten Sie den MCP-Server

mcp run server.py

entweder

uv run --with mcp mcp run server.py

Chat-Funktionen

  • Benutzer hinzufügen:
    Schreiben Sie: agregar usuario Juan juan@mail.com clave123
  • Benutzer löschen:
    Geben Sie ein: eliminar usuario juan@mail.com
  • Benutzer ändern:
    Geben Sie ein: modificar usuario juan@mail.com nombre=Juan Perez contraseña=nuevaClave
  • Benutzer konsultieren:
    Schreiben Sie: consultar usuarios oder consultar usuario juan@mail.com
  • Freies Gespräch:
    Wenn es sich bei der Nachricht nicht um eine Aktion handelt, antwortet das lokale LLM.

Credits


Beiträge und Anregungen sind willkommen!

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Ein Python-basierter Model Context Protocol-Server mit Streamlit-Chat-Schnittstelle, der es Benutzern ermöglicht, eine PostgreSQL-Datenbank sowohl über die Web-Benutzeroberfläche als auch über MCP-Tools zu verwalten, unterstützt von Ollama für die lokale LLM-Integration.

  1. Eigenschaften
    1. Anforderungen
      1. Einrichtung
        1. Verwenden
          1. Levanta Ollama und das LLM-Modell
          2. Öffnen Sie den Streamlit-Chat
          3. (Optional) Starten Sie den MCP-Server
        2. Chat-Funktionen
          1. Credits

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              An interactive chat interface that combines Ollama's LLM capabilities with PostgreSQL database access through the Model Context Protocol (MCP). Ask questions about your data in natural language and get AI-powered responses backed by real SQL queries.
              Last updated -
              28
              TypeScript
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server providing both read and write access to PostgreSQL databases, enabling LLMs to query data, modify records, and manage database schemas.
              Last updated -
              4
              JavaScript
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables powerful PostgreSQL database management capabilities including analysis, schema management, data migration, and monitoring through natural language interactions.
              Last updated -
              58
              21
              TypeScript
              AGPL 3.0
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables performing PostgreSQL database operations (create, read, update, delete) on User and Post entities through MCP tools.
              Last updated -
              TypeScript

            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/IgnacioFucksmann/MCP-SERVER-DEMO'

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