shoutout-labs/document-sync
If you are the rightful owner of document-sync and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
Document Sync is a comprehensive solution for syncing project files to Google's Gemini File Search API, enabling AI-powered code understanding and chat capabilities across various platforms.
Document Sync
A comprehensive solution for syncing your project files to Google's Gemini File Search API, enabling AI-powered code understanding and chat capabilities across VS Code, Cursor, MCP servers, and web interfaces.
Overview
Document Sync consists of three main components:
- VS Code/Cursor Extension - Sync files from your workspace to Gemini File Search
- MCP Server - Enable AI agents to query your project files via Model Context Protocol
- Web Client - Chat with your project files through a React web interface
Demo
Direct link: [resources/Document_Sync__Living_Brain.mp4](resources/Document_Sync__Living_Brain.mp4)Features
- 🔄 Automatic File Syncing - Sync your project files to Gemini File Search API
- 🤖 AI-Powered Queries - Ask questions about your codebase using Gemini
- 📁 Project Management - Organize files by project name
- 🎯 Selective Syncing - Choose specific directories to watch and sync
- 🔌 MCP Integration - Use with Claude Desktop, Cursor, and other MCP-compatible tools
- 🌐 Web Interface - Chat with your projects through a modern React UI
Prerequisites
- Node.js (v18 or higher)
- VS Code or Cursor (v1.85.0 or higher)
- Google Gemini API Key - Get yours from Google AI Studio
Installation
VS Code/Cursor Extension
- Install the extension from the VS Code marketplace or build from source:
cd extension
npm install
npm run compile
- Press
F5to open a new window with the extension loaded, or package it:
npm run package
- Install the generated
.vsixfile in VS Code/Cursor.
MCP Server
The MCP server is available as an npm package:
npm install -g @shoutoutlabs/document-sync-mcp
Or use it directly with npx:
npx @shoutoutlabs/document-sync-mcp
Web Client
cd web-client
npm install
Create a .env file:
VITE_GEMINI_API_KEY=your_api_key_here
Start the development server:
npm run dev
Usage
VS Code/Cursor Extension
-
First Time Setup:
- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Run
Gemini File Search: Sync Files - Enter your Gemini API Key when prompted
- Enter a project name for your workspace
- Select a directory to watch (or use the workspace root)
- Open Command Palette (
-
Syncing Files:
- Use the "Gemini Sync" activity bar icon
- Click "Sync Files" to upload files to Gemini File Search
- Files are automatically synced when you save changes
-
Commands:
Gemini File Search: Sync Files- Manually trigger a syncGemini File Search: Login to Gemini- Update your API keyGemini File Search: Change Project Name- Update project nameGemini File Search: Change Watch Location- Change the directory to watch
-
Configuration:
- Settings are stored in
document-sync.jsonin your workspace root - Contains
projectNameandwatchLocationsettings
- Settings are stored in
MCP Server
Running the Server
Set your API key and run:
export GEMINI_API_KEY="your_api_key_here"
npx @shoutoutlabs/document-sync-mcp
Adding to Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"gemini-file-search": {
"command": "npx",
"args": [
"-y",
"@shoutoutlabs/document-sync-mcp"
],
"env": {
"GEMINI_API_KEY": "your_api_key_here"
}
}
}
}
Adding to Cursor
- Open Cursor Settings
- Navigate to Features > MCP
- Click Add New MCP Server
- Configure:
- Name:
gemini-file-search - Type:
command - Command:
npx -y @shoutoutlabs/document-sync-mcp - Environment Variables:
GEMINI_API_KEY=your_api_key_here
- Name:
Available Tools
ask_project(query: string, projectName?: string)- Ask questions about your project files
Web Client
- Start the development server (see Installation above)
- Open the app in your browser (usually
http://localhost:5173) - Select a project from the list
- Start chatting with your project files!
Project Structure
document-sync/
├── extension/ # VS Code/Cursor extension
│ ├── extension.ts # Main extension code
│ ├── geminiService.ts # Gemini API integration
│ ├── package.json # Extension manifest
│ └── resources/ # Extension assets
├── mcp-server/ # MCP server for AI agents
│ ├── src/
│ │ ├── index.ts # MCP server entry point
│ │ └── gemini.ts # Gemini integration
│ └── package.json
└── web-client/ # React web application
├── src/
│ ├── App.tsx
│ ├── components/
│ └── services/
└── package.json
Development
Building the Extension
cd extension
npm install
npm run compile # Compile TypeScript
npm run watch # Watch mode for development
npm run package # Create .vsix package
Building the MCP Server
cd mcp-server
npm install
npm run build
Building the Web Client
cd web-client
npm install
npm run dev # Development server
npm run build # Production build
npm run preview # Preview production build
Configuration
Extension Settings
The extension creates a document-sync.json file in your workspace root:
{
"projectName": "my-project",
"watchLocation": "/path/to/watch"
}
Environment Variables
MCP Server:
GEMINI_API_KEY(required) - Your Gemini API keyPROJECT_PATH(optional) - Absolute path to project root
Web Client:
VITE_GEMINI_API_KEY(required) - Your Gemini API key
How It Works
- File Syncing: The extension watches your specified directory and uploads files to Gemini File Search API when they change
- File Search: Files are indexed by Gemini and can be queried using natural language
- AI Queries: The MCP server and web client use Gemini's File Search to answer questions about your codebase
- Project Organization: Files are organized by project name, allowing multiple projects to coexist
Troubleshooting
Extension Issues
- Files not syncing: Check that your API key is set and the watch location is correct
- API errors: Verify your Gemini API key is valid and has File Search enabled
- Project not found: Ensure
document-sync.jsonexists in your workspace root
MCP Server Issues
- Server not starting: Check that
GEMINI_API_KEYis set correctly - Project not found: Ensure
document-sync.jsonexists in your project root, or setPROJECT_PATHenvironment variable
Web Client Issues
- API key error: Ensure
VITE_GEMINI_API_KEYis set in your.envfile - No projects found: Make sure you've synced at least one project using the extension
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions, please open an issue on the GitHub repository.