π¦
Mylocalai
MCP server: Mylocalai
0 installs
8 stars
1 forks
Trust: 47 β Fair
Devtools
Installation
npx mylocalaiAsk AI about Mylocalai
Powered by Claude Β· Grounded in docs
I know everything about Mylocalai. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Loading tools...
Reviews
Documentation
Local AI Chat with LangGraph & MCP Tools
β οΈ Project Discontinued
This project is no longer being maintained. I'm moving on to work on something more interesting that people are actually excited about. Thanks to everyone who checked it out!
A Next.js chat application powered by LangGraph with MCP (Model Context Protocol) tools for real-time web search and data access. Features Server-Sent Events (SSE) streaming for real-time AI responses. Completely local and open source.
Architecture
Core Components
- Next.js 15 - Modern React framework with App Router
- LangGraph - AI agent framework for complex reasoning workflows
- MCP Tools - Google search, web scraping, and data access tools
- SSE Streaming - Real-time response streaming via Server-Sent Events
- Ollama - Local LLM hosting (Qwen 3 14B recommended)
Data Flow
User Message β LangGraph Agent β MCP Tools (Web Search) β LLM β SSE Stream β UI
Features
π Advanced AI Capabilities
- β LangGraph Agent - Complex reasoning and tool usage
- β Real-time Web Search - Current information via Google Search
- β Web Scraping - Extract content from specific URLs
- β SSE Streaming - Real-time response updates
- β Tool Call Visibility - See when AI uses external tools
π¬ Chat Interface
- β Markdown Rendering - Rich text responses with code highlighting
- β Conversation History - Persistent chat threads
- β Multiple Sessions - Manage multiple conversations
- β Real-time Status - Live updates during processing
π Privacy & Performance
- β Completely Local - AI runs on your hardware
- β No API Keys Required - Uses local Ollama instance
- β Thread Management - SQLite-based conversation storage
- β Debug Mode - Detailed logging and performance metrics
Quick Start
1. Install Ollama
# macOS
brew install ollama
# Windows/Linux
# Visit https://ollama.com for installer
2. Install Required Model
ollama pull qwen3:4b
# Alternative: ollama pull qwen3:4b
3. Start Ollama Service
ollama serve
4. Run the Application
make prod
5. Open Browser
Navigate to http://localhost:3000
Technical Requirements
Hardware
- RAM: 16GB+ (recommended for Qwen 3 14B)
- CPU: Modern multi-core processor
- Storage: 10GB+ free space for models
Software
- Node.js: v18+ (v20+ recommended)
- Ollama: Latest version
- Modern Browser: Chrome, Firefox, Safari, Edge
Key Dependencies
- Next.js 15 - React framework with App Router
- LangGraph - AI agent framework (@langchain/langgraph ^0.4.9)
- MCP SDK - Model Context Protocol (@modelcontextprotocol/sdk ^1.18.1)
- Ollama LangChain - Local LLM integration (@langchain/ollama ^0.2.4)
- SQLite Checkpointer - Conversation persistence (@langchain/langgraph-checkpoint-sqlite ^0.2.1)
Configuration
Model Configuration
Edit app/page.tsx to change the model:
const requiredModel = 'qwen3:4b';
// or 'qwen3:4b', 'llama3.1:70b', etc.
MCP Tools Available
Google Search (google_search)
- Purpose: Get current information from web search
- Usage: Automatically used for current events, facts, news
- Parameters:
query(string)
Web Scraper (scrape)
- Purpose: Extract content from specific URLs
- Usage: Get detailed information from websites
- Parameters:
url(string)
Dice Roller (roll_dice)
- Purpose: Generate random numbers
- Usage: Games, randomization, decision making
- Parameters:
sides(number),count(number)
Development
Available Commands
make prod # Install, build, and start production server
make dev # Development server with hot reload
make clean # Clean build artifacts
make help # Show all available commands
Project Structure
app/
βββ components/ # React components
β βββ ChatInterface.tsx # Main chat UI
β βββ ChatList.tsx # Conversation sidebar
β βββ StatusBanner.tsx # Connection status indicator
βββ langraph_backend/ # LangGraph API routes
β βββ route.ts # Main SSE streaming endpoint
β βββ schemas.ts # Request/response validation
β βββ lib/ # Utilities and checkpointer
β βββ conversations/ # Thread management API
β βββ route.ts # List conversations
β βββ [thread_id]/route.ts # Get/delete specific conversation
βββ mcp_server/ # MCP tool implementations
β βββ [transport]/ # MCP protocol handler
β β βββ route.ts # Tool registration and routing
β βββ tools/ # Individual tool definitions
β β βββ googleSearch.ts # Google search tool
β β βββ scrape.ts # Web scraping tool
β β βββ rollDice.ts # Random number generator
β βββ search/ # Google search implementation
β βββ scrape/ # Web scraping implementation
βββ utils/ # Shared utilities
β βββ localStorage.ts # Browser storage helpers
βββ layout.tsx # Root layout component
βββ page.tsx # Main chat page
Adding New MCP Tools
- Create tool definition in
app/mcp_server/tools/ - Register in
app/mcp_server/[transport]/route.ts - Tool will be automatically available to LangGraph agent
Troubleshooting
Ollama Issues
# Check if Ollama is running
curl http://localhost:11434/api/tags
# List installed models
ollama list
# Check model installation
ollama pull qwen3:4b
Performance Optimization
- Reduce Model Size: Use
qwen3:7borqwen3:4bfor lower memory usage - Close Applications: Free up RAM for better model performance
- Check Resources: Monitor CPU/RAM usage during chat
SSE Streaming Issues
- Check browser console for connection errors
- Verify LangGraph backend is running on port 3000
- Ensure no firewall blocking Server-Sent Events
MCP Tool Errors
- Verify MCP server is connected in logs
- Check tool implementation in
app/mcp_server/tools/ - Ensure Google search API is accessible
API Endpoints
Chat Streaming
- POST
/langraph_backend- SSE streaming chat endpoint - Headers:
Content-Type: application/json,Accept: text/event-stream
Conversation Management
- GET
/langraph_backend/conversations- List all conversations - GET
/langraph_backend/conversations/[id]- Get specific conversation - DELETE
/langraph_backend/conversations/[id]- Delete conversation
MCP Tools
- POST
/mcp_server/mcp- MCP protocol endpoint for tools
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT License - See LICENSE file for details.
Acknowledgments
- Ollama - Local LLM hosting
- LangGraph - AI agent framework
- Model Context Protocol - Tool integration standard
- Next.js - React framework
