This guide explains how to run and test the MultiSynq MCP integration locally.
- Node.js 18+ and pnpm installed
- PostgreSQL 14+ (for local development)
- Docker and Docker Compose (optional, for containerized setup)
- Git repository cloned
# Ubuntu/Debian
sudo apt update
sudo apt install postgresql postgresql-contrib
# macOS
brew install postgresql
brew services start postgresql
# Start PostgreSQL service
sudo systemctl start postgresql # Linux
brew services start postgresql # macOS# Access PostgreSQL prompt
sudo -u postgres psql
# Create user and database
CREATE USER metamcp_user WITH PASSWORD 'm3t4mcp';
CREATE DATABASE metamcp_db OWNER metamcp_user;
GRANT ALL PRIVILEGES ON DATABASE metamcp_db TO metamcp_user;
\q# Start PostgreSQL container
docker run -d \
--name metamcp-postgres \
-e POSTGRES_USER=metamcp_user \
-e POSTGRES_PASSWORD=m3t4mcp \
-e POSTGRES_DB=metamcp_db \
-p 5432:5432 \
postgres:16-alpine# From project root
cd multimcp # or wherever you cloned the repo
# Create local environment file
cat > .env.local << EOF
# Database Configuration (Local PostgreSQL)
DATABASE_URL=postgresql://metamcp_user:m3t4mcp@localhost:5432/metamcp_db
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=metamcp_user
POSTGRES_PASSWORD=m3t4mcp
POSTGRES_DB=metamcp_db
# Application Configuration
APP_URL=http://localhost:12008
NEXT_PUBLIC_APP_URL=http://localhost:12008
NODE_ENV=development
# Authentication (use a secure key in production!)
BETTER_AUTH_SECRET=dev-secret-key-change-in-production-at-least-32-chars
# Optional: Enable debug logging
LOG_LEVEL=debug
EOF
# Copy to root .env for convenience
cp .env.local .env# From project root
pnpm install
# Build all packages
pnpm build# From project root, you can use the convenience script
pnpm db:push:dev
# OR navigate to backend and run directly
cd apps/backend
pnpm db:push:dev
# Optional: Open database GUI (from project root)
pnpm db:studio:dev# Option 1: From project root (opens two terminals)
pnpm dev:backend # Terminal 1
pnpm dev:frontend # Terminal 2
# Option 2: Navigate to each app
cd apps/backend && pnpm dev # Terminal 1
cd apps/frontend && pnpm dev # Terminal 2# Test health endpoint
curl http://localhost:12008/api/health
# Expected response:
{
"status": "ok",
"timestamp": "2024-07-25T...",
"multisynq": {
"endpoint": "/sse",
"status": "ready"
}
}# From project root
docker compose up -d
# Check logs
docker compose logs -f app
# Wait for: "✅ MultiSynq root endpoint initialized successfully"The Docker configuration is designed to work seamlessly with Railway:
- Database: Railway automatically provisions PostgreSQL
- Environment Variables: Railway injects
DATABASE_URLand other variables - Migrations: The
docker-entrypoint.shscript runs migrations automatically - Health Checks: Built-in health check endpoint at
/api/health
# Test SSE endpoint
curl http://localhost:12008/sse
# Test MCP endpoint
curl http://localhost:12008/mcp
# Test API documentation
curl http://localhost:12008/api
# Test health with MultiSynq status
curl http://localhost:12008/api/health-
Open MCP Inspector:
- Navigate to http://localhost:12008/mcp-inspector
-
Configure connection:
- Transport: SSE
- URL:
http://localhost:12008/sse - No authentication required
-
Test operations:
- Click "Connect"
- List available tools
- Search for "multisynq" in tools
- Execute
searchtool with query "what is multisynq"
-
Edit Claude Desktop config:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- Windows:
-
Add MultiSynq MCP server:
{ "mcpServers": { "multisynq-local": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-sse", "http://localhost:12008/sse"] } } } -
Restart Claude Desktop and look for "multisynq-local" in the MCP servers list
-
Install Cline extension in VS Code
-
Open Cline settings (Ctrl+Shift+P → "Cline: Open Settings")
-
Add MCP server:
{ "multisynq-local": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-sse", "http://localhost:12008/sse"] } }
Once connected via MCP Inspector or an AI tool, test these queries:
// Example tool calls to test
{
"tool": "search",
"query": "what is multisynq"
}
{
"tool": "search",
"query": "how to use activities in multisynq"
}
{
"tool": "search",
"query": "multisynq authentication"
}# Development
pnpm dev # Start both frontend and backend with hot reload
pnpm dev:backend # Start only backend
pnpm dev:frontend # Start only frontend
# Building
pnpm build # Build all packages
pnpm clean # Clean all build artifacts
# Database (convenience scripts)
pnpm db:push:dev # Push schema to local database
pnpm db:studio:dev # Open Prisma Studio GUI
pnpm db:push # Push schema (uses .env)
pnpm db:studio # Open Prisma Studio (uses .env)
# Testing
pnpm test:multisynq # Run MultiSynq tests
pnpm test:playwright # Run browser tests
# Docker
pnpm docker:up # Start with docker compose
pnpm docker:down # Stop docker services
pnpm docker:logs # View docker logs
# Linting
pnpm lint # Run linting
pnpm lint:fix # Fix linting issues# Development
pnpm dev # Start development server with hot reload
# Database Management
pnpm db:push:dev # Push schema to local database
pnpm db:studio:dev # Open Prisma Studio GUI
pnpm db:generate:dev # Generate Prisma client
pnpm db:migrate:dev # Run migrations
pnpm db:reset # Reset and seed database
# Testing
pnpm test:multisynq # Run MultiSynq tests
pnpm test # Run all tests
pnpm test:playwright # Run browser tests
# Building
pnpm build # Build for production
pnpm start # Start production build# From project root
pnpm db:studio:dev
# OR from backend directory
cd apps/backend
pnpm db:studio:dev
# Opens at http://localhost:5555cd apps/backend
pnpm db:reset# Connect to PostgreSQL
psql -U metamcp_user -d metamcp_db -h localhost
# Common queries
\dt # List all tables
\d+ "table_name" # Describe table
SELECT * FROM users; # Query data-
Port 12008 already in use:
# Find and kill process lsof -i :12008 kill -9 <PID>
-
Database connection errors:
# Check PostgreSQL is running sudo systemctl status postgresql # Linux brew services list # macOS # Check connection psql -U metamcp_user -d metamcp_db -h localhost -c "SELECT 1" # Common fix: ensure PostgreSQL is listening on localhost # Edit postgresql.conf and set: listen_addresses = 'localhost'
-
pnpm command not found:
# Install pnpm npm install -g pnpm # or curl -fsSL https://get.pnpm.io/install.sh | sh -
-
Build errors:
# Clean and rebuild pnpm clean pnpm install pnpm build -
MultiSynq endpoint not initialized:
- Check backend logs for errors
- Ensure database is accessible
- Verify Context7 MCP server is installed in Docker image
- The initialization should happen automatically on startup
-
"Cannot find module" errors:
# Ensure all packages are built pnpm build # If specific package fails, build it directly cd packages/zod-types && pnpm build cd packages/trpc && pnpm build
# Backend logs (development)
# Check the terminal where you ran `pnpm dev`
# Docker logs
docker compose logs -f app
# PostgreSQL logs
sudo journalctl -u postgresql # Linux
tail -f /opt/homebrew/var/log/postgresql*.log # macOS
# Check specific initialization
docker compose logs app | grep -i multisynqThe local setup is designed to work seamlessly with Railway deployment:
- Database: Railway provides PostgreSQL automatically
- Environment Variables: Railway injects DATABASE_URL and other vars
- Docker: The Dockerfile handles both local and Railway environments
- Health Checks: Same endpoints work locally and on Railway
-
Hot Reload: Both frontend and backend support hot reload in development mode
-
Environment Variables:
- Use
.env.localfor local development - Use
.envfor Docker - Never commit these files to git
- Use
-
API Testing: Use the Swagger UI at http://localhost:12008/api
-
Rate Limiting: In local development, rate limiting is set to 100 requests/minute
-
Security Headers: Relaxed in development for easier testing
-
Database GUI: Prisma Studio provides a visual interface for your data
# Stop local development servers
# Press Ctrl+C in each terminal
# Stop Docker services
docker compose down
# Stop and remove volumes (clean slate)
docker compose down -v
# Stop PostgreSQL
sudo systemctl stop postgresql # Linux
brew services stop postgresql # macOS
# Stop PostgreSQL Docker container
docker stop metamcp-postgres
docker rm metamcp-postgresNeed Help?
- Check the logs first
- Verify PostgreSQL is running and accessible
- Ensure all dependencies are installed with
pnpm install - Make sure all packages are built with
pnpm build - Check the troubleshooting section above