- Overview
- Main Features
- Architecture
- Getting Started
- MCP Integration
- Environment Variables
- API Documentation
- Contributors
- License
LangConnect Client is a modern, Next.js-based GUI interface for managing vector databases powered by PostgreSQL with pgvector extension. It provides an intuitive web interface for document management, vector search capabilities, and seamless integration with AI assistants through the Model Context Protocol (MCP).
- Create, read, update, and delete document collections
- Organize documents with custom metadata
- Real-time statistics for documents and chunks
- Bulk operations support
- Multi-format support (PDF, TXT, MD, DOCX, HTML)
- Batch upload capabilities with drag-and-drop interface
- Automatic text extraction and chunking
- Document-level and chunk-level management
- Metadata customization for enhanced searchability
- Semantic Search: Vector similarity search using OpenAI embeddings
- Keyword Search: Traditional full-text search
- Hybrid Search: Combines semantic and keyword search for best results
- Metadata filtering with JSON support
- Real-time search results with relevance scores
- Supabase integration for secure user authentication
- JWT-based API access
- Session persistence
- Role-based access control
- Direct integration with AI assistants (Claude Desktop, Cursor)
- 9 comprehensive tools for document management
- Both stdio and SSE transport support
- Automated configuration generation
- Responsive design with Tailwind CSS
- Dark/Light theme support
- Multi-language support (English, Korean)
- Real-time updates and notifications
- Interactive API testing interface
βββββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Next.js Frontend ββββββΆβ FastAPI Backend ββββββΆβ PostgreSQL β
β (Port 3000) β β (Port 8080) β β + pgvector β
βββββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β
βββββββββββββ¬ββββββββββββββββ
β
ββββββββΌβββββββββββ
β Supabase Auth β
βββββββββββββββββββ
- Docker and Docker Compose
- Node.js 20+ (for MCP inspector)
- Python 3.11+ with UV package manager
- Supabase account
-
Clone the repository
git clone https://github.com/your-username/langconnect.git cd langconnect
-
Set up environment variables
cp .env.example .env
-
Configure Supabase
a. Create a new project at supabase.com
b. Get your API credentials:
- Go to Project Settings β API
- Copy the
URL
andanon public
key
c. Update
.env
file:SUPABASE_URL=https://your-project.supabase.co SUPABASE_KEY=your-anon-public-key # Also update these for Next.js NEXTAUTH_SECRET=your-secret-key-here NEXTAUTH_URL=http://localhost:3000 NEXT_PUBLIC_API_URL=http://localhost:8080
-
Build the application
./install.sh
This script will:
- Install frontend dependencies using pnpm
- Build the Next.js application
- Build all Docker images
-
Start all services
docker compose up -d
-
Access the services
- π¨ Frontend: http://localhost:3000
- π API Documentation: http://localhost:8080/docs
- π Health Check: http://localhost:8080/health
-
Stop services
docker compose down
-
Generate MCP configuration
uv run python mcp/create_mcp_json.py
This command will:
- Prompt for your Supabase credentials
- Automatically obtain an access token
- Update
.env
with the token - Generate
mcp/mcp_config.json
-
Integration with AI Assistants
For Claude Desktop:
- Copy the contents of
mcp/mcp_config.json
- Paste into Claude Desktop's MCP settings
For Cursor:
- Copy the MCP configuration
- Add to Cursor's settings under MCP integrations
- Copy the contents of
search_documents
- Perform semantic/keyword/hybrid searchlist_collections
- List all collectionsget_collection
- Get collection detailscreate_collection
- Create new collectiondelete_collection
- Delete collectionlist_documents
- List documents in collectionadd_documents
- Add text documentsdelete_document
- Delete documentsget_health_status
- Check API healthmulti_query
- Generate multiple search queries from a single question
# Use the convenient launcher script
./run_mcp_sse.sh
This script will:
- Check if all requirements are met (uv, .env file)
- Verify API server is running
- Start the MCP SSE server with automatic authentication
# Or run directly
uv run python mcp/mcp_sse_server.py
The server now includes automatic authentication:
- Tests existing token validity on startup
- Prompts for login if token is expired or missing
- Automatically updates
.env
with new token - Starts the SSE server on port 8765
# Test with MCP Inspector
npx @modelcontextprotocol/inspector
In the Inspector:
- Select "SSE" as transport type
- Enter
http://localhost:8765
as URL - Connect and test the available tools
Variable | Description | Required |
---|---|---|
OPENAI_API_KEY |
OpenAI API key for embeddings | Yes |
SUPABASE_URL |
Supabase project URL | Yes |
SUPABASE_KEY |
Supabase anon public key | Yes |
NEXTAUTH_SECRET |
NextAuth.js secret key | Yes |
NEXTAUTH_URL |
NextAuth URL (default: http://localhost:3000) | Yes |
NEXT_PUBLIC_API_URL |
Public API URL for frontend | Yes |
POSTGRES_HOST |
PostgreSQL host (default: postgres) | No |
POSTGRES_PORT |
PostgreSQL port (default: 5432) | No |
POSTGRES_USER |
PostgreSQL user (default: teddynote) | No |
POSTGRES_PASSWORD |
PostgreSQL password | No |
POSTGRES_DB |
PostgreSQL database name | No |
SSE_PORT |
MCP SSE server port (default: 8765) | No |
The API provides comprehensive endpoints for document and collection management:
POST /auth/signup
- Create new accountPOST /auth/signin
- Sign inPOST /auth/refresh
- Refresh tokenGET /auth/me
- Get current user
GET /collections
- List collectionsPOST /collections
- Create collectionGET /collections/{id}
- Get collectionPUT /collections/{id}
- Update collectionDELETE /collections/{id}
- Delete collection
GET /collections/{id}/documents
- List documentsPOST /collections/{id}/documents
- Upload documentsDELETE /collections/{id}/documents
- Bulk deletePOST /collections/{id}/documents/search
- Search documents
Teddy Lee π |
fbwndrud π |
jikime π |
This project is licensed under the MIT License - see the LICENSE file for details.