Multi-User MCP Server with Chatbot and Agent

by r16academy

151 downloads
Not rated
GitHub

About

Multi user Full Stack App with Chatbot and Agent in Javascript, FastAPI and PyMongo

Details

Author
r16academy
Downloads
151
Categories
AI

- User authentication with registration, login, and password recovery.
- Dual AI interfaces: Chatbot for Q&A, Agent for tool usage.
- Real-time WebSocket-based chat messaging.
- Persistent, user-specific conversation history.
- File upload for document analysis during chat.
- Responsive, mobile-friendly HTML/CSS/JS frontend.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Multi-User MCP Server with Chatbot and Agent
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install Python dependencies with pip install -r requirements.txt, set environment variables (OpenAI key, MongoDB URI, email credentials) in a .env file, optionally install MCP server dependencies with npm install, then run python main.py. The app becomes available at http://localhost:5000/. Use the /register, /login, /chatbot, and /agent endpoints for respective features.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "multi-user mcp server with chatbot and agent": {
            "mcp-server-beginner-app": {
                "command": "python",
                "args": [
                    "main.py"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-server-beginner-app": {
        "command": "python",
        "args": [
            "main.py"
        ]
    }
}

Multi-User MCP Server with Chatbot and Agent

Python
FastAPI
MongoDB
Heroku

---

πŸš€ Overview

A full-stack web application implementing the Model Context Protocol (MCP) to provide two AI assistant experiences: - Chatbot: Conversational Q&A - Agent: Tool-using AI agent

Features include user authentication, persistent chat history, real-time WebSocket messaging, and file upload for document analysis. The app is production-ready and deployable on Heroku.

---

✨ Features

- User Authentication: Registration, login, password recovery, email verification - Dual AI Interfaces: Chatbot and Agent, each with unique capabilities - Real-Time Chat: WebSocket-based instant messaging - Conversation History: Persistent, user-specific chat logs - File Upload: Analyze documents in chat - MCP Server Integration: Connects to multiple MCP servers for tool execution - Responsive UI: Clean, mobile-friendly HTML/CSS/JS frontend - Heroku Deployment: Ready for cloud deployment

---

πŸ› οΈ Tech Stack

- Backend: Python 3.10+, FastAPI, MongoDB, Uvicorn - Frontend: HTML, CSS, Vanilla JavaScript (see static/) - AI Integration: OpenAI API or compatible LLM providers - Real-Time: WebSocket - Deployment: Heroku (Procfile included)

---

πŸ“ Project Structure

.
β”œβ”€β”€ main.py                # FastAPI app entry point
β”œβ”€β”€ routes/                # API route handlers (auth, chatbot, agent, feedback)
β”œβ”€β”€ static/                # Frontend HTML, CSS, JS for all pages
β”‚   β”œβ”€β”€ chatbot/           # Chatbot interface
β”‚   β”œβ”€β”€ agent/             # Agent interface
β”‚   β”œβ”€β”€ login/             # Login page
β”‚   β”œβ”€β”€ register/          # Registration page
β”‚   └── ...                # Other static assets
β”œβ”€β”€ tools/                 # MCP server integration logic
β”œβ”€β”€ email_config.py        # Email settings for verification
β”œβ”€β”€ config.py              # General configuration
β”œβ”€β”€ servers_config.json    # MCP server connection details
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ Procfile               # Heroku process file
└── README.md              # This file

---

⚑ Getting Started

Prerequisites

- Python 3.10+ - MongoDB (local or Atlas) - Node.js (for MCP server dependencies) - Heroku CLI (for deployment)

Installation

1. Clone the repository:
   git clone <your-repo-url>
   cd <repo-folder>
   
2. Install Python dependencies:
   pip install -r requirements.txt
   
3. Set up environment variables: - Copy .env.example to .env and fill in your secrets (OpenAI key, MongoDB URI, email credentials). 4. Install MCP server dependencies (if needed):
   npm install
   
5. Run the server locally:
   python main.py
   
The app will be available at http://localhost:5000/.

---

πŸ’‘ Usage

- Register: /register to create a new account - Login: /login to sign in - Chatbot: /chatbot for general Q&A - Agent: /agent for advanced tool-using AI - File Upload: Use the file input in chat to upload documents - Conversation History: View and revisit past conversations in the sidebar

---

☁️ Deployment

- Heroku: Ready for Heroku deployment. Use the included Procfile and set environment variables in the Heroku dashboard. - Static Files: All frontend assets are served from the static/ directory.

---

πŸ”’ Security & Best Practices

- Authentication tokens stored securely (cookies/localStorage) - Passwords hashed before storage - Email verification required for new accounts - CORS enabled for cross-origin requests

---

🀝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

---

πŸ“„ License

This project is licensed under the MIT License.

---

πŸ™ Acknowledgements

- FastAPI - MongoDB - OpenAI - Heroku
No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.