# Deployment Guide
This guide explains how to deploy the Oracle Fusion AR MCP Server to various cloud platforms.
## Overview
The server is designed as a **remote MCP server** that can be accessed via HTTP/SSE (Server-Sent Events). Once deployed, users can connect to it using the deployment URL.
## Prerequisites
- GitHub account
- Oracle Fusion Cloud credentials
- Cloud platform account (Railway, Render, or similar)
## Option 1: Deploy to Railway (Recommended)
Railway provides free tier and automatic deployments from GitHub.
### Step 1: Prepare Your Repository
1. Push your code to GitHub:
```bash
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/oracle-ar-mcp-server.git
git push -u origin main
```
### Step 2: Deploy to Railway
1. Go to [railway.app](https://railway.app)
2. Click "Start a New Project"
3. Select "Deploy from GitHub repo"
4. Choose your `oracle-ar-mcp-server` repository
5. Railway will automatically detect the configuration from `railway.json`
### Step 3: Configure Environment Variables
In Railway dashboard, add these environment variables:
```
ORACLE_BASE_URL=https://fa-euth-dev46-saasfademo1.ds-fa.oraclepdemos.com
PORT=8000
```
### Step 4: Get Your Deployment URL
Railway will provide a URL like: `https://oracle-ar-mcp-server-production-abc123.up.railway.app`
### Step 5: Test Your Deployment
```bash
# Health check
curl https://your-app.railway.app/health
# Service info
curl https://your-app.railway.app/
```
## Option 2: Deploy to Render
Render also offers free tier with automatic deployments.
### Step 1: Create render.yaml
Already included in the project.
### Step 2: Deploy
1. Go to [render.com](https://render.com)
2. Click "New" → "Web Service"
3. Connect your GitHub repository
4. Render will auto-detect the Python app
5. Set environment variables:
- `ORACLE_BASE_URL`: Your Oracle Fusion URL
- `PORT`: 8000
### Step 3: Get Your URL
Render provides a URL like: `https://oracle-ar-mcp-server.onrender.com`
## Option 3: Deploy to Heroku
### Step 1: Install Heroku CLI
```bash
# Install Heroku CLI
curl https://cli-assets.heroku.com/install.sh | sh
# Login
heroku login
```
### Step 2: Create and Deploy
```bash
# Create Heroku app
heroku create oracle-ar-mcp-server
# Set environment variables
heroku config:set ORACLE_BASE_URL=https://fa-euth-dev46-saasfademo1.ds-fa.oraclepdemos.com
# Deploy
git push heroku main
```
## Option 4: Deploy to Docker (Any Platform)
Build and deploy using Docker:
```bash
# Build image
docker build -t oracle-ar-mcp-server .
# Run locally to test
docker run -p 8000:8000 \
-e ORACLE_BASE_URL=https://fa-euth-dev46-saasfademo1.ds-fa.oraclepdemos.com \
oracle-ar-mcp-server
# Push to Docker Hub
docker tag oracle-ar-mcp-server YOUR_USERNAME/oracle-ar-mcp-server
docker push YOUR_USERNAME/oracle-ar-mcp-server
```
Then deploy to:
- **AWS ECS/Fargate**
- **Google Cloud Run**
- **Azure Container Apps**
- **DigitalOcean App Platform**
## Connecting Clients to Your Deployed Server
Once deployed, users can connect to your server using the deployment URL.
### For Claude Desktop
Users add this to their `claude_desktop_config.json`:
```json
{
"mcpServers": {
"oracle-ar": {
"url": "https://your-deployment-url.railway.app/sse",
"transport": "sse"
}
}
}
```
### For MCP Inspector
```bash
npx @modelcontextprotocol/inspector --url https://your-deployment-url.railway.app/sse
```
### For Custom MCP Clients
```python
from mcp import ClientSession
from mcp.client.sse import sse_client
async with sse_client("https://your-deployment-url.railway.app/sse") as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Use the tools
```
## Sharing Your Server
Once deployed, you can share your server with others by providing:
1. **Deployment URL**: `https://your-app.railway.app`
2. **SSE Endpoint**: `https://your-app.railway.app/sse`
3. **API Documentation**: Point them to your README.md
Users will need:
- The SSE endpoint URL
- Their own Oracle Fusion credentials (passed per-request)
## Security Considerations
### ✅ What's Secure
- No credentials stored on server
- Each request authenticates independently
- HTTPS encryption (provided by hosting platform)
- Stateless design
### ⚠️ Important Notes
- Users must provide their own Oracle credentials with each request
- Credentials are not logged or stored
- Server only proxies requests to Oracle API
- Consider adding rate limiting for production use
## Monitoring
### Health Check Endpoint
```bash
curl https://your-app.railway.app/health
```
Returns:
```json
{
"status": "healthy",
"service": "oracle-fusion-ar-mcp-server",
"version": "1.0.0"
}
```
### Service Info Endpoint
```bash
curl https://your-app.railway.app/
```
Returns service information and available tools.
## Troubleshooting
### Deployment Fails
- Check logs in platform dashboard
- Verify `pyproject.toml` has all dependencies
- Ensure `Procfile` or `railway.json` is correct
### Health Check Fails
- Check `ORACLE_BASE_URL` environment variable
- Verify network connectivity to Oracle API
- Check platform logs for errors
### Connection Issues
- Verify SSE endpoint URL is correct
- Check HTTPS is enabled (required)
- Test with curl or MCP Inspector first
## Cost Estimates
### Free Tiers
- **Railway**: $5 credit/month (enough for light use)
- **Render**: 750 hours/month free
- **Heroku**: 1000 dyno hours/month free (with credit card)
### Paid Plans (for production)
- **Railway**: ~$5-10/month for small workloads
- **Render**: ~$7/month for starter plan
- **Heroku**: ~$7/month for hobby plan
## Updating Your Deployment
### Auto-Deploy from GitHub
Most platforms support automatic deployments:
1. Push changes to GitHub
2. Platform automatically rebuilds and deploys
3. Zero downtime deployment
```bash
git add .
git commit -m "Update feature"
git push origin main
```
### Manual Deploy
Railway:
```bash
railway up
```
Render: Automatically deploys on git push
Heroku:
```bash
git push heroku main
```
## Support
For deployment issues:
- Check platform documentation
- Review deployment logs
- Open an issue on GitHub