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.
使用 Streamlit 和 Ollama 的 MCP 服务器演示
该项目是 Python MCP(模型上下文协议)服务器的演示,集成了用 Streamlit 制作的网络聊天界面和使用 Ollama 的本地语言模型。允许您从聊天和外部 MCP 工具管理 PostgreSQL 数据库中的用户(添加、删除、修改、查询)。
特征
- 使用 Streamlit 进行网络聊天。
- 使用 Ollama(Llama 3 或其他兼容型号)的本地 LLM 。
- MCP 服务器带有供用户 CRUD 的工具。
- 用于存储用户的PostgreSQL 数据库。
- 灵活集成:您可以只使用聊天、只使用 MCP 服务器或两者兼用。
要求
- Python 3.9+
- PostgreSQL 正在运行且可访问
- Ollama已安装并正在运行(适用于本地 LLM)
- 虚拟环境(推荐)
requirements.txt
文件中的依赖项
设施
- 克隆存储库:
- 创建并激活虚拟环境:
- 安装依赖项:
- 配置您的 PostgreSQL 数据库并在
server.py
中配置连接详细信息。 - (可选)如果您使用 API 密钥,请创建一个
.env
文件。
使用
1. Levanta Ollama 和法学硕士 (LLM) 模式
2.打开Streamlit聊天
打开浏览器,访问http://localhost:8501 。
3. (可选)启动 MCP 服务器
任何一个
聊天功能
- 添加用户:
写入:agregar usuario Juan juan@mail.com clave123
- 删除用户:
类型:eliminar usuario juan@mail.com
- 修改用户:
类型:modificar usuario juan@mail.com nombre=Juan Perez contraseña=nuevaClave
- 咨询用户:
写信至:consultar usuarios
或consultar usuario juan@mail.com
- 自由交谈:
如果消息不是一个动作,本地 LLM 会做出响应。
致谢
欢迎贡献和建议!
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
基于 Python 的模型上下文协议服务器,具有 Streamlit 聊天界面,允许用户通过 Web UI 和 MCP 工具管理 PostgreSQL 数据库,由 Ollama 提供支持,可实现本地 LLM 集成。
Related MCP Servers
- -securityFlicense-qualityAn 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 -28TypeScript
- -securityFlicense-qualityA 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 -4JavaScript
- -securityAlicense-qualityA 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 -5821TypeScriptAGPL 3.0
- -securityFlicense-qualityA 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