claude-sync
Cross-machine context sharing MCP server for Claude Code, enabling shared memory of decisions, patterns, and knowledge across multiple Claude Code instances on different machines.
README
claude-sync
Cross-machine context sharing MCP server for Claude Code. Share decisions, patterns, and knowledge across multiple Claude Code instances running on different machines.
What it does
When you use Claude Code on multiple machines (backend server, frontend laptop, ideas tablet), each instance is isolated. claude-sync gives them a shared memory — push a decision on one machine, search for it on another.
Quick Start
1. Clone and configure
git clone https://github.com/YOUR_USERNAME/claude-sync.git
cd claude-sync
cp .env.example .env
Edit .env and set:
API_KEY_HASH— see below for generating
2. Generate an API key
# Generate a random key
KEY=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
echo "Your API key: $KEY"
# Hash it for .env
HASH=$(echo -n "$KEY" | shasum -a 256 | cut -d' ' -f1)
echo "API_KEY_HASH=$HASH"
Add the hash to your .env file.
3. Start with Docker Compose
docker compose up -d
The server will be available at http://localhost:3001.
4. Connect Claude Code
Add to your ~/.claude/settings.json:
{
"mcpServers": {
"claude-sync": {
"type": "streamable-http",
"url": "http://localhost:3001/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
For remote access (e.g., deployed on Railway), replace localhost:3001 with your server URL.
Deploy on Railway
- Fork this repo
- Create a new project on Railway
- Add a PostgreSQL database (select the pgvector template)
- Add a new service from your forked repo
- Set environment variables:
API_KEY_HASH,DATABASE_URL(auto-set by Railway) - Deploy
MCP Tools
| Tool | Description |
|---|---|
push_context |
Store a new context entry (decision, discovery, pattern, etc.) |
search_context |
Semantic search across all shared entries |
list_recent |
List recent entries, optionally filtered by machine or type |
get_entry |
Get full details of a specific entry |
delete_entry |
Soft-delete an entry |
list_machines |
See which machines have contributed and their activity |
Entry Types
context— general contextdecision— architectural or design decisionsdiscovery— learning about existing systemsbugfix— something broken, now fixedpattern— reusable approachesarchitecture— structural decisionsgotcha— traps and edge casestrade-off— pros/cons analysis
Multi-Key Mode (Teams)
For teams, use database-backed API keys instead of API_KEY_HASH:
- Remove
API_KEY_HASHfrom.env - Run migrations:
docker compose up -d - Generate keys:
npm run create-key -- --project my-project --label "Alice's laptop"
npm run create-key -- --project my-project --label "Bob's desktop"
Each key is scoped to a project. Team members using the same project see shared context.
Development
npm install
cp .env.example .env # configure your env
# Start Postgres with pgvector
docker compose up db -d
# Run in development mode
npm run dev
Architecture
- TypeScript + Express + MCP SDK
- PostgreSQL + pgvector for storage and vector similarity search
- Local embeddings via
all-MiniLM-L6-v2(runs in-process, no external API calls) - Stateless MCP transport — each request is independent
- Bearer token auth — single-key or multi-key modes
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.