dynamic-mcp-server

dynamic-mcp-server

3.3

A web application for creating project-specific knowledge bases accessible to Large Language Models (LLMs) via the Model Context Protocol (MCP) standard.

Dynamic Knowledge Base Platform

A web application for creating project-specific knowledge bases accessible to Large Language Models (LLMs) via the Model Context Protocol (MCP) standard.

Overview

The Dynamic Knowledge Base Platform enables users to upload documents in various formats, processes and structures the data, and hosts a custom MCP server that allows LLMs to access this information as context for generating more accurate and relevant responses.

Key Features

  • Document Processing: Upload and process documents in various formats (PDFs, Word docs, text, code, etc.)
  • Dynamic Context: Continuously update knowledge bases with new or modified documents
  • MCP Server: Compliant with the Model Context Protocol standard for LLM access
  • Security: Strong authentication, authorization, and data protection
  • Responsive UI: Intuitive interface that works on both desktop and mobile devices

Technology Stack

  • Backend: Go
  • Frontend: React with TypeScript
  • Database: PostgreSQL with pgvector extension
  • Authentication: JWT tokens and API keys
  • Protocol: Model Context Protocol (MCP)

Project Structure

dynamic_knowledge_base/
ā”œā”€ā”€ backend/               # Go backend
│   ā”œā”€ā”€ cmd/               # Application entry points
│   │   └── server/        # Main server application
│   └── internal/          # Internal packages
│       ā”œā”€ā”€ api/           # API handlers and routing
│       ā”œā”€ā”€ auth/          # Authentication and authorization
│       ā”œā”€ā”€ document/      # Document processing
│       ā”œā”€ā”€ knowledge/     # Knowledge base management
│       ā”œā”€ā”€ mcp/           # MCP server implementation
│       └── storage/       # Database and storage
ā”œā”€ā”€ frontend/              # React frontend
│   ā”œā”€ā”€ public/            # Static files
│   └── src/               # Source code
│       ā”œā”€ā”€ components/    # React components
│       ā”œā”€ā”€ pages/         # Page components
│       ā”œā”€ā”€ services/      # API services
│       ā”œā”€ā”€ hooks/         # Custom React hooks
│       └── utils/         # Utility functions
ā”œā”€ā”€ docs/                  # Documentation
│   ā”œā”€ā”€ architecture_design.md      # System architecture
│   ā”œā”€ā”€ project_documentation.md    # Technical documentation
│   ā”œā”€ā”€ requirements_analysis.md    # Requirements analysis
│   └── user_guide.md               # User guide
└── README.md              # Project overview

Getting Started

Prerequisites

  • Go 1.18 or higher
  • Node.js 16 or higher
  • PostgreSQL 14 or higher with pgvector extension

Backend Setup

  1. Clone the repository
  2. Navigate to the backend directory
  3. Install dependencies:
    go mod download
    
  4. Run the server:
    go run cmd/server/main.go
    

Frontend Setup

  1. Navigate to the frontend directory
  2. Install dependencies:
    npm install
    
  3. Start the development server:
    npm start
    

Deployment

Backend Deployment

  1. Build the backend:
    cd backend
    go build -o server cmd/server/main.go
    
  2. Run the server:
    ./server
    

Frontend Deployment

  1. Build the frontend:
    cd frontend
    npm run build
    
  2. Serve the build directory with a web server of your choice

Documentation

  • : System architecture and component interactions
  • : Technical implementation details
  • : Project requirements and specifications
  • : Instructions for using the platform

MCP Integration

To connect an LLM to your knowledge base:

  1. Create an MCP connection in the platform UI
  2. Configure your LLM to use the WebSocket endpoint: ws://your-server-address/ws?api_key=YOUR_API_KEY
  3. The LLM will now have access to your project's documents and can use them as context for generating responses

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • The MCP standard specification
  • Go and React communities for their excellent documentation and tools