Skip to main content
Glama
binal182

Binal Digital Twin MCP Server

by binal182
README.md
# Binal's AI-Powered Resume Platform

A modern, interactive resume website with AI-powered chat functionality using Next.js 15, Upstash Vector Database, and MCP (Model Context Protocol) integration for Claude Desktop.

## šŸš€ Features

- **šŸ“± Professional Resume Website**: Modern, responsive design optimized for recruiters
- **šŸ¤– Interactive AI Chat**: Ask questions about Binal's background, skills, and experience
- **šŸ” RAG-Powered Search**: Vector database search through comprehensive professional data
- **šŸ–Øļø Print-Optimized**: Professional PDF generation for download
- **šŸ’» MCP Integration**: Claude Desktop integration for advanced AI interactions

## šŸ› ļø Tech Stack

- **Frontend**: Next.js 15 with React 19, Tailwind CSS, shadcn/ui
- **Backend**: Upstash Vector Database for RAG search
- **AI Integration**: Claude Sonnet via MCP protocol
- **Deployment**: Vercel-ready configuration

## šŸ“ Project Structure

```
binalmcp/
ā”œā”€ā”€ app/
│   ā”œā”€ā”€ actions/          # Server actions for database and MCP
│   ā”œā”€ā”€ api/             # MCP API route
│   ā”œā”€ā”€ resume/          # Professional resume page
│   ā”œā”€ā”€ layout.tsx       # Root layout
│   └── page.tsx         # Main landing page
ā”œā”€ā”€ components/
│   ā”œā”€ā”€ ui/              # shadcn/ui components
│   ā”œā”€ā”€ interactive-resume.tsx
│   ā”œā”€ā”€ mcp-setup-guide.tsx
│   └── test-rag-search.tsx
ā”œā”€ā”€ lib/
│   └── rag-search.ts    # Vector database search logic
ā”œā”€ā”€ .env.local           # Environment variables
└── package.json
```

## šŸ”§ Setup & Installation

### Prerequisites
- Node.js 18+ 
- pnpm package manager
- Upstash Vector Database account

### 1. Environment Setup
Create `.env.local` with your Upstash credentials:
```env
UPSTASH_VECTOR_REST_URL="your_upstash_vector_url"
UPSTASH_VECTOR_REST_TOKEN="your_upstash_vector_token"
OPENAI_API_KEY="your_openai_api_key"
```

### 2. Install Dependencies
```bash
pnpm install
```

### 3. Populate Database
The database is already populated with Binal's professional data. To repopulate if needed, use the MCP Setup Guide on the website.

### 4. Run Development Server
```bash
pnpm dev
```

Visit `http://localhost:3000` to see the application.

## šŸ—ļø How It Works

This application uses **mcp-handler** and **Upstash Vector** to provide seamless RAG-powered search integration between web applications and AI assistants like Claude Desktop.

### Architecture

```
Claude Desktop → Transport Protocol → /api/[transport] → Shared RAG Logic (/lib/rag-search.ts)
Web Interface → Server Actions → Shared RAG Logic (/lib/rag-search.ts)
                                      ↓
                               Upstash Vector Database
```

1. **Claude Desktop** connects via various transport protocols (SSE, stdio, etc.)
2. **Transport Layer** handles the MCP protocol communication
3. **MCP Handler** processes tool calls and invokes shared RAG search logic
4. **RAG Search** (`/lib/rag-search.ts`) contains vector search and result formatting
5. **Upstash Vector** provides semantic search capabilities with embeddings
6. **Server Actions** (for web) call the same shared RAG logic directly

### Key Components

- **`lib/rag-search.ts`**: Shared RAG search logic, schema, and tool definitions
- **`app/api/[transport]/route.ts`**: MCP server endpoint using mcp-handler + shared logic
- **`app/actions/mcp-actions.ts`**: Server actions that use the shared RAG search logic
- **`app/page.tsx`**: Beautiful web interface with setup instructions and testing
- **`components/`**: Reusable shadcn/ui components for the interface
- **`data/`**: Sample data structure and population guidelines

### Web Interface Benefits

The web interface uses **Next.js Server Actions** that import the same shared logic as the MCP server:
- āœ… Same Zod schema validation (`lib/rag-search.ts`)
- āœ… Identical search algorithm (single `searchBinalKnowledge()` function)
- āœ… Consistent output formatting (same result structure)
- āœ… Shared tool definitions (same name, description, schema)
- āœ… True single source of truth architecture
- **MCP Tools**: `search_binal_knowledge` tool with Zod validation for parameters

## šŸš€ Deployment to Vercel

### Option 1: Deploy Button (Recommended)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/binal182/binalmcp)

### Option 2: Manual Deployment

1. **Connect to Vercel**:
   ```bash
   pnpm i -g vercel
   vercel
   ```

2. **Add Environment Variables**:
   In your Vercel dashboard, add:
   - `UPSTASH_VECTOR_REST_URL`
   - `UPSTASH_VECTOR_REST_TOKEN`

3. **Update Claude Desktop Config**:
   Replace `http://localhost:3000` with your Vercel URL:
   ```json
   {
     "mcpServers": {
       "binal-digital-twin": {
         "command": "npx",
         "args": [
           "-y",
           "mcp-remote",
           "https://your-app.vercel.app/api/mcp"
         ]
       }
     }
   }
   ```

4. **Restart Claude Desktop** to use the deployed version

## šŸ› ļø Technology Stack

- **Framework**: [Next.js 15](https://nextjs.org/) with App Router
- **UI Library**: [shadcn/ui](https://ui.shadcn.com/) components
- **Styling**: [Tailwind CSS](https://tailwindcss.com/) with CSS variables
- **Vector Database**: [Upstash Vector](https://upstash.com/docs/vector) for RAG search
- **MCP Integration**: [mcp-handler](https://www.npmjs.com/package/mcp-handler) for HTTP-based MCP protocol
- **MCP Bridge**: [mcp-remote](https://www.npmjs.com/package/mcp-remote) for Claude Desktop connectivity
- **Validation**: [Zod](https://zod.dev/) for type-safe parameter validation
- **Icons**: [Lucide React](https://lucide.dev/) for beautiful icons
- **Deployment**: [Vercel](https://vercel.com/) platform

## šŸŽÆ Use Cases

- **šŸŽ¤ Technical Interviews**: Learn about Binal's technical expertise and experience
- **šŸ¤ Project Collaboration**: Understand Binal's skills for team projects
- **🌐 Professional Networking**: Get to know Binal's background and interests
- **šŸ“Š Skill Assessment**: Evaluate technical competencies and experience levels
- **šŸ¤– AI-Powered CV**: Interactive resume experience via Claude Desktop
- **šŸŽ“ Educational Tool**: Demonstrate RAG and vector search technologies

## šŸ¤ Contributing

Contributions are welcome! This project is open source and MIT licensed.

1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Commit changes: `git commit -m 'Add amazing feature'`
4. Push to branch: `git push origin feature/amazing-feature`
5. Open a Pull Request

## šŸ“š Learn More

- **[Model Context Protocol](https://modelcontextprotocol.io/)** - Official MCP documentation
- **[mcp-handler](https://www.npmjs.com/package/mcp-handler)** - The HTTP-based MCP handler used in this project
- **[mcp-remote](https://www.npmjs.com/package/mcp-remote)** - Bridge tool for Claude Desktop connectivity
- **[Upstash Vector](https://upstash.com/docs/vector)** - Serverless vector database documentation
- **[Claude Desktop](https://claude.ai/download)** - Download and setup guide
- **[Next.js Documentation](https://nextjs.org/docs)** - Learn about the framework

## šŸ“„ License

MIT License - see [LICENSE](LICENSE) file for details.

## šŸ‘Øā€šŸ’» Author

Created by **Binal** as a digital twin RAG search server

⭐ If you find this project useful, please consider giving it a star on GitHub!

---

*Built with ā¤ļø using Next.js, shadcn/ui, Upstash Vector, and the Model Context Protocol*