External MCP Server Setup - Schema.org Implementation
Quick Summary
You now have a fully configured Schema.org MCP server ready for external deployment with NGINX reverse proxy support.
What Has Been Set Up
1. MCP Server with SSE Transport
- Modified
src/index.tsto support Server-Sent Events (SSE) for external HTTP/HTTPS access - Supports both stdio mode (local) and SSE mode (external)
- Environment variables:
USE_SSE=trueandSSE_PORT=3000
2. Systemd Service
- File:
schema-org-mcp.service - Automatically starts on boot
- Runs as non-root user (ubuntu)
- Configured for SSE mode on port 3000
3. NGINX Reverse Proxy Configuration
- File:
nginx-schema-org-mcp.conf - Domain:
json-ld-schema-mcp.serptransformer.com - SSL/TLS enabled (HTTPS only)
- CORS headers configured
- Connection pooling and keepalive enabled
- Endpoints:
/health- Health check/sse- SSE connection endpoint/messages- Message POST endpoint
4. Documentation
DEPLOYMENT.md- Detailed deployment instructionsSETUP_GUIDE.md- Step-by-step setup walkthroughCLIENT_EXAMPLE.md- Client integration examplesEXTERNAL_MCP_SETUP.md- This file
5. Quick Start Script
- File:
quick-start.sh - Automates installation and systemd setup
- Usage:
sudo ./quick-start.sh
Key Files Modified/Created
/home/ubuntu/CascadeProjects/schema-org-mcp/
├── src/
│ ├── index.ts (MODIFIED - Added SSE transport support)
│ └── schema-org-client.ts (unchanged)
├── dist/ (compiled output)
├── schema-org-mcp.service (NEW - Systemd service)
├── nginx-schema-org-mcp.conf (NEW - NGINX config)
├── quick-start.sh (NEW - Quick setup script)
├── DEPLOYMENT.md (NEW - Deployment guide)
├── SETUP_GUIDE.md (NEW - Complete setup walkthrough)
├── CLIENT_EXAMPLE.md (NEW - Client examples)
└── EXTERNAL_MCP_SETUP.md (NEW - This file)Deployment Steps (Quick Reference)
Prerequisites
- SSL certificate for
json-ld-schema-mcp.serptransformer.com(via Let's Encrypt) - NGINX installed
- Node.js 18+ installed
- Sudo access
Installation
cd /home/ubuntu/CascadeProjects/schema-org-mcp
sudo ./quick-start.shManual Installation
# Install dependencies
npm install
npm run build
# Install systemd service
sudo cp schema-org-mcp.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable schema-org-mcp
# Configure NGINX
sudo cp nginx-schema-org-mcp.conf /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-available/nginx-schema-org-mcp.conf /etc/nginx/sites-enabled/
# Verify and start
sudo nginx -t
sudo systemctl start schema-org-mcp
sudo systemctl reload nginxVerification
# Test health endpoint
curl https://json-ld-schema-mcp.serptransformer.com/health
# Check service status
sudo systemctl status schema-org-mcp
# View logs
sudo journalctl -u schema-org-mcp -fArchitecture
┌─────────────────────────────────────────────────────────────┐
│ External Clients │
│ (Claude Desktop, Custom Apps, etc) │
└──────────────────────┬──────────────────────────────────────┘
│ HTTPS
▼
┌─────────────────────────────────────────────────────────────┐
│ NGINX Reverse Proxy │
│ json-ld-schema-mcp.serptransformer.com │
│ (SSL/TLS, CORS, Connection Pooling, Load Balancing) │
└──────────────────────┬──────────────────────────────────────┘
│ HTTP (localhost)
▼
┌─────────────────────────────────────────────────────────────┐
│ Schema.org MCP Server (SSE) │
│ Port 3000 │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ /sse endpoint - SSE connection │ │
│ │ /messages endpoint - Message POST │ │
│ │ /health endpoint - Health check │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
│ Available Tools: │
│ • get_schema_type │
│ • search_schemas │
│ • get_type_hierarchy │
│ • get_type_properties │
│ • generate_example │
└─────────────────────────────────────────────────────────────┘Environment Variables
| Variable | Default | Purpose |
|---|---|---|
USE_SSE | false | Enable SSE mode for external access |
SSE_PORT | 3000 | Port for SSE server |
API Endpoints
Health Check
GET /health
Response: {"status":"ok"}SSE Connection
GET /sse
Content-Type: text/event-streamMessage Endpoint
POST /messages
Content-Type: application/jsonAvailable MCP Tools
- get_schema_type - Get detailed schema type information
- search_schemas - Search for schema types by keyword
- get_type_hierarchy - Get type inheritance relationships
- get_type_properties - List all properties for a type
- generate_example - Generate example JSON-LD
Security Features
✓ HTTPS/TLS encryption
✓ CORS headers configured
✓ Security headers (HSTS, X-Frame-Options, etc.)
✓ Non-root service execution
✓ Connection pooling and keepalive
✓ Input validation
Monitoring & Maintenance
View Logs
sudo journalctl -u schema-org-mcp -f
sudo tail -f /var/log/nginx/schema-org-mcp-access.log
sudo tail -f /var/log/nginx/schema-org-mcp-error.logRestart Service
sudo systemctl restart schema-org-mcpCheck Status
sudo systemctl status schema-org-mcpSSL Certificate Renewal
sudo certbot renew
sudo systemctl reload nginxIntegration Examples
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"schema-org": {
"url": "https://json-ld-schema-mcp.serptransformer.com"
}
}
}Node.js Client
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
const transport = new SSEClientTransport({
url: 'https://json-ld-schema-mcp.serptransformer.com/sse',
});
const client = new Client({...}, {...});
await client.connect(transport);cURL
# Health check
curl https://json-ld-schema-mcp.serptransformer.com/health
# Establish SSE connection
curl -N https://json-ld-schema-mcp.serptransformer.com/sseTroubleshooting
Service won't start
sudo journalctl -u schema-org-mcp -n 50
USE_SSE=true SSE_PORT=3000 node /home/ubuntu/CascadeProjects/schema-org-mcp/dist/index.jsNGINX connection issues
sudo nginx -t
sudo netstat -tlnp | grep 3000
curl -v http://127.0.0.1:3000/healthSSL certificate errors
sudo certbot certificates
openssl s_client -connect json-ld-schema-mcp.serptransformer.com:443Performance Tuning
NGINX Connection Pool
Edit nginx-schema-org-mcp.conf:
upstream schema_org_mcp {
server 127.0.0.1:3000;
keepalive 64; # Increase for higher concurrency
}SSE Timeout
Edit nginx-schema-org-mcp.conf:
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;Backup Strategy
# Create backup
sudo tar -czf ~/schema-org-mcp-backup-$(date +%Y%m%d).tar.gz \
/home/ubuntu/CascadeProjects/schema-org-mcp \
/etc/nginx/sites-available/nginx-schema-org-mcp.conf \
/etc/systemd/system/schema-org-mcp.service
# Restore backup
sudo tar -xzf ~/schema-org-mcp-backup-YYYYMMDD.tar.gz -C /
sudo systemctl daemon-reload
sudo systemctl restart schema-org-mcp nginxNext Steps
- Complete Setup: Follow
SETUP_GUIDE.mdfor detailed instructions - Test Integration: Use examples in
CLIENT_EXAMPLE.md - Monitor: Set up monitoring and alerting
- Optimize: Tune performance based on usage patterns
- Document: Keep deployment notes for your team
Support & Resources
- MCP Protocol: https://modelcontextprotocol.io/ (opens in a new tab)
- Schema.org: https://schema.org/ (opens in a new tab)
- NGINX: https://nginx.org/en/docs/ (opens in a new tab)
- Let's Encrypt: https://letsencrypt.org/ (opens in a new tab)
- Node.js: https://nodejs.org/en/docs/ (opens in a new tab)
Summary
Your Schema.org MCP server is now ready for external deployment. All necessary files, configurations, and documentation have been created. The server supports:
- ✅ External HTTPS access via NGINX reverse proxy
- ✅ SSE (Server-Sent Events) transport for MCP protocol
- ✅ Systemd service management
- ✅ SSL/TLS encryption
- ✅ CORS support
- ✅ Health monitoring
- ✅ Comprehensive logging
Follow the SETUP_GUIDE.md to complete the deployment on your server.