|
--- |
|
title: 'Installation Guide' |
|
description: 'Detailed installation instructions for all platforms' |
|
--- |
|
|
|
|
|
|
|
Before installing MCPHub, ensure you have the following prerequisites: |
|
|
|
- **Node.js** 18+ (for local development) |
|
- **Docker** (recommended for production) |
|
- **pnpm** (for local development) |
|
|
|
Optional for Smart Routing: |
|
|
|
- **PostgreSQL** with pgvector extension |
|
- **OpenAI API Key** or compatible embedding service |
|
|
|
|
|
|
|
<Tabs> |
|
<Tab title="Docker (Recommended)"> |
|
|
|
|
|
Docker is the recommended way to deploy MCPHub in production. |
|
|
|
|
|
|
|
```bash |
|
|
|
docker pull samanhappy/mcphub:latest |
|
|
|
|
|
docker run -d \ |
|
--name mcphub \ |
|
-p 3000:3000 \ |
|
samanhappy/mcphub:latest |
|
``` |
|
|
|
|
|
|
|
```bash |
|
|
|
cat > mcp_settings.json << 'EOF' |
|
{ |
|
"mcpServers": { |
|
"fetch": { |
|
"command": "uvx", |
|
"args": ["mcp-server-fetch"] |
|
}, |
|
"playwright": { |
|
"command": "npx", |
|
"args": ["@playwright/mcp@latest", "--headless"] |
|
} |
|
} |
|
} |
|
EOF |
|
|
|
|
|
docker run -d \ |
|
--name mcphub \ |
|
-p 3000:3000 \ |
|
-v $(pwd)/mcp_settings.json:/app/mcp_settings.json \ |
|
samanhappy/mcphub:latest |
|
``` |
|
|
|
|
|
|
|
```bash |
|
docker run -d \ |
|
--name mcphub \ |
|
-p 3000:3000 \ |
|
-e PORT=3000 \ |
|
-e BASE_PATH="" \ |
|
-e REQUEST_TIMEOUT=60000 \ |
|
samanhappy/mcphub:latest |
|
``` |
|
|
|
|
|
|
|
Create a `docker-compose.yml` file: |
|
|
|
```yaml |
|
version: '3.8' |
|
services: |
|
mcphub: |
|
image: samanhappy/mcphub:latest |
|
ports: |
|
- "3000:3000" |
|
volumes: |
|
- ./mcp_settings.json:/app/mcp_settings.json |
|
environment: |
|
- PORT=3000 |
|
- BASE_PATH="" |
|
- REQUEST_TIMEOUT=60000 |
|
restart: unless-stopped |
|
|
|
|
|
postgres: |
|
image: pgvector/pgvector:pg16 |
|
environment: |
|
POSTGRES_DB: mcphub |
|
POSTGRES_USER: mcphub |
|
POSTGRES_PASSWORD: mcphub_password |
|
volumes: |
|
- postgres_data:/var/lib/postgresql/data |
|
ports: |
|
- "5432:5432" |
|
|
|
volumes: |
|
postgres_data: |
|
``` |
|
|
|
Run with: |
|
```bash |
|
docker-compose up -d |
|
``` |
|
|
|
</Tab> |
|
|
|
<Tab title="npm Package"> |
|
|
|
|
|
Install MCPHub as a global npm package: |
|
|
|
|
|
|
|
```bash |
|
|
|
npm install -g @samanhappy/mcphub |
|
|
|
|
|
yarn global add @samanhappy/mcphub |
|
|
|
|
|
pnpm add -g @samanhappy/mcphub |
|
``` |
|
|
|
|
|
|
|
```bash |
|
|
|
mcphub |
|
|
|
|
|
PORT=8080 mcphub |
|
|
|
|
|
MCP_SETTINGS_PATH=/path/to/mcp_settings.json mcphub |
|
``` |
|
|
|
|
|
|
|
You can also install MCPHub locally in a project: |
|
|
|
```bash |
|
|
|
mkdir my-mcphub |
|
cd my-mcphub |
|
|
|
|
|
npm init -y |
|
|
|
|
|
npm install @samanhappy/mcphub |
|
|
|
|
|
echo '#!/bin/bash\nnpx mcphub' > start.sh |
|
chmod +x start.sh |
|
|
|
|
|
./start.sh |
|
``` |
|
|
|
</Tab> |
|
|
|
<Tab title="Local Development"> |
|
|
|
|
|
For development, customization, or contribution: |
|
|
|
|
|
|
|
```bash |
|
|
|
git clone https://github.com/samanhappy/mcphub.git |
|
cd mcphub |
|
``` |
|
|
|
|
|
|
|
```bash |
|
|
|
pnpm install |
|
|
|
|
|
npm install |
|
|
|
|
|
yarn install |
|
``` |
|
|
|
|
|
|
|
```bash |
|
|
|
pnpm dev |
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
```bash |
|
|
|
pnpm build |
|
|
|
|
|
pnpm start |
|
``` |
|
|
|
|
|
|
|
```bash |
|
|
|
pnpm backend:dev |
|
|
|
|
|
pnpm frontend:dev |
|
|
|
|
|
pnpm test |
|
|
|
|
|
pnpm lint |
|
|
|
|
|
pnpm format |
|
``` |
|
|
|
<Note> |
|
On Windows, you may need to run backend and frontend separately: |
|
```bash |
|
|
|
pnpm backend:dev |
|
|
|
|
|
pnpm frontend:dev |
|
``` |
|
</Note> |
|
|
|
</Tab> |
|
|
|
<Tab title="Kubernetes"> |
|
|
|
|
|
Deploy MCPHub on Kubernetes with these manifests: |
|
|
|
|
|
|
|
```yaml |
|
apiVersion: v1 |
|
kind: ConfigMap |
|
metadata: |
|
name: mcphub-config |
|
data: |
|
mcp_settings.json: | |
|
{ |
|
"mcpServers": { |
|
"fetch": { |
|
"command": "uvx", |
|
"args": ["mcp-server-fetch"] |
|
}, |
|
"playwright": { |
|
"command": "npx", |
|
"args": ["@playwright/mcp@latest", "--headless"] |
|
} |
|
} |
|
} |
|
``` |
|
|
|
|
|
|
|
```yaml |
|
apiVersion: apps/v1 |
|
kind: Deployment |
|
metadata: |
|
name: mcphub |
|
spec: |
|
replicas: 1 |
|
selector: |
|
matchLabels: |
|
app: mcphub |
|
template: |
|
metadata: |
|
labels: |
|
app: mcphub |
|
spec: |
|
containers: |
|
- name: mcphub |
|
image: samanhappy/mcphub:latest |
|
ports: |
|
- containerPort: 3000 |
|
env: |
|
- name: PORT |
|
value: "3000" |
|
volumeMounts: |
|
- name: config |
|
mountPath: /app/mcp_settings.json |
|
subPath: mcp_settings.json |
|
volumes: |
|
- name: config |
|
configMap: |
|
name: mcphub-config |
|
``` |
|
|
|
|
|
|
|
```yaml |
|
apiVersion: v1 |
|
kind: Service |
|
metadata: |
|
name: mcphub-service |
|
spec: |
|
selector: |
|
app: mcphub |
|
ports: |
|
- port: 80 |
|
targetPort: 3000 |
|
type: ClusterIP |
|
``` |
|
|
|
|
|
|
|
```yaml |
|
apiVersion: networking.k8s.io/v1 |
|
kind: Ingress |
|
metadata: |
|
name: mcphub-ingress |
|
annotations: |
|
nginx.ingress.kubernetes.io/proxy-buffering: "off" |
|
spec: |
|
rules: |
|
- host: mcphub.yourdomain.com |
|
http: |
|
paths: |
|
- path: / |
|
pathType: Prefix |
|
backend: |
|
service: |
|
name: mcphub-service |
|
port: |
|
number: 80 |
|
``` |
|
|
|
Deploy with: |
|
```bash |
|
kubectl apply -f mcphub-configmap.yaml |
|
kubectl apply -f mcphub-deployment.yaml |
|
kubectl apply -f mcphub-service.yaml |
|
kubectl apply -f mcphub-ingress.yaml |
|
``` |
|
|
|
</Tab> |
|
</Tabs> |
|
|
|
|
|
|
|
Smart Routing provides AI-powered tool discovery using vector semantic search. |
|
|
|
|
|
|
|
1. **PostgreSQL with pgvector** |
|
2. **OpenAI API Key** (or compatible embedding service) |
|
|
|
|
|
|
|
<Tabs> |
|
<Tab title="Docker PostgreSQL"> |
|
```bash |
|
|
|
docker run -d \ |
|
--name mcphub-postgres \ |
|
-e POSTGRES_DB=mcphub \ |
|
-e POSTGRES_USER=mcphub \ |
|
-e POSTGRES_PASSWORD=your_password \ |
|
-p 5432:5432 \ |
|
pgvector/pgvector:pg16 |
|
``` |
|
</Tab> |
|
|
|
<Tab title="Existing PostgreSQL"> |
|
If you have an existing PostgreSQL instance: |
|
|
|
```sql |
|
-- Connect to your PostgreSQL instance |
|
-- Create database |
|
CREATE DATABASE mcphub; |
|
|
|
-- Connect to the mcphub database |
|
\c mcphub; |
|
|
|
-- Enable pgvector extension |
|
CREATE EXTENSION IF NOT EXISTS vector; |
|
``` |
|
|
|
</Tab> |
|
|
|
<Tab title="Cloud PostgreSQL"> |
|
For cloud providers (AWS RDS, Google Cloud SQL, etc.): |
|
|
|
1. Enable the pgvector extension in your cloud provider's console |
|
2. Create a database named `mcphub` |
|
3. Note down the connection details |
|
|
|
</Tab> |
|
</Tabs> |
|
|
|
|
|
|
|
Set the following environment variables: |
|
|
|
```bash |
|
|
|
DATABASE_URL=postgresql://mcphub:your_password@localhost:5432/mcphub |
|
|
|
|
|
OPENAI_API_KEY=your_openai_api_key |
|
|
|
|
|
EMBEDDING_MODEL=text-embedding-3-small |
|
|
|
|
|
ENABLE_SMART_ROUTING=true |
|
``` |
|
|
|
|
|
|
|
After installation, verify MCPHub is working: |
|
|
|
|
|
|
|
```bash |
|
curl http://localhost:3000/api/health |
|
``` |
|
|
|
Expected response: |
|
|
|
```json |
|
{ |
|
"status": "ok", |
|
"version": "x.x.x", |
|
"uptime": 123 |
|
} |
|
``` |
|
|
|
|
|
|
|
Open your browser and navigate to: |
|
|
|
``` |
|
http://localhost:3000 |
|
``` |
|
|
|
|
|
|
|
```bash |
|
curl -X POST http://localhost:3000/mcp \ |
|
-H "Content-Type: application/json" \ |
|
-d '{ |
|
"jsonrpc": "2.0", |
|
"id": 1, |
|
"method": "tools/list", |
|
"params": {} |
|
}' |
|
``` |
|
|
|
|
|
|
|
<AccordionGroup> |
|
<Accordion title="Docker Issues"> |
|
**Port already in use:** |
|
```bash |
|
|
|
lsof -i :3000 |
|
|
|
|
|
docker run -p 8080:3000 samanhappy/mcphub |
|
``` |
|
|
|
**Container won't start:** |
|
```bash |
|
|
|
docker logs mcphub |
|
|
|
|
|
docker run -it --rm samanhappy/mcphub /bin/bash |
|
``` |
|
|
|
</Accordion> |
|
|
|
<Accordion title="npm Installation Issues"> |
|
**Permission errors:** |
|
```bash |
|
|
|
npx @samanhappy/mcphub |
|
|
|
|
|
npm config set prefix ~/.npm-global |
|
export PATH=~/.npm-global/bin:$PATH |
|
``` |
|
|
|
**Node version issues:** |
|
```bash |
|
|
|
node --version |
|
|
|
|
|
nvm install 18 |
|
nvm use 18 |
|
``` |
|
|
|
</Accordion> |
|
|
|
<Accordion title="Network Issues"> |
|
**Can't access dashboard:** |
|
- Check if MCPHub is running: `ps aux | grep mcphub` |
|
- Verify port binding: `netstat -tlnp | grep 3000` |
|
- Check firewall settings |
|
- Try accessing via `127.0.0.1:3000` instead of `localhost:3000` |
|
|
|
**AI clients can't connect:** |
|
- Ensure the endpoint URL is correct |
|
- Check if MCPHub is behind a proxy |
|
- Verify network policies in Kubernetes/Docker environments |
|
|
|
</Accordion> |
|
|
|
<Accordion title="Smart Routing Issues"> |
|
**Database connection failed:** |
|
```bash |
|
|
|
psql $DATABASE_URL -c "SELECT 1;" |
|
|
|
|
|
psql $DATABASE_URL -c "CREATE EXTENSION IF NOT EXISTS vector;" |
|
``` |
|
|
|
**Embedding service errors:** |
|
- Verify OpenAI API key is valid |
|
- Check internet connectivity |
|
- Monitor rate limits |
|
|
|
</Accordion> |
|
</AccordionGroup> |
|
|
|
|
|
|
|
<CardGroup cols={2}> |
|
<Card title="Configuration" icon="cog" href="/configuration/mcp-settings"> |
|
Configure your MCP servers and settings |
|
</Card> |
|
<Card title="Quick Start" icon="rocket" href="/quickstart"> |
|
Get up and running in 5 minutes |
|
</Card> |
|
<Card title="Server Management" icon="server" href="/features/server-management"> |
|
Learn how to manage your MCP servers |
|
</Card> |
|
<Card title="API Reference" icon="code" href="/api-reference/introduction"> |
|
Explore the complete API documentation |
|
</Card> |
|
</CardGroup> |
|
|