Skip to content

🐍 Local Deployment¢

This guide walks you through running ContextForge on your local machine using a virtual environment or directly via Python.


πŸš€ One-Liner SetupΒΆ

The easiest way to start the server in development mode:

make venv install-dev serve

This does the following:

  1. Creates a .venv/ virtual environment
  2. Installs all dependencies (including dev tools)
  3. Launches Gunicorn on http://localhost:4444

πŸ§ͺ Development Mode with Live ReloadΒΆ

If you want auto-reload on code changes:

make dev        # hot-reload (Uvicorn) on :8000
# or:
./run.sh --reload --log debug

Ensure your .env file includes:

DEV_MODE=true
RELOAD=true
DEBUG=true

πŸ—„ Database ConfigurationΒΆ

By default, ContextForge uses SQLite for simplicity. You can configure alternative databases via the DATABASE_URL environment variable:

# .env file
DATABASE_URL=sqlite:///./mcp.db
# .env file
DATABASE_URL=postgresql+psycopg://postgres:changeme@localhost:5432/mcp

Database Recommendation

Use SQLite for development and testing. For production deployments, use PostgreSQL for better concurrency, performance, and reliability.


πŸ§ͺ Health TestΒΆ

curl http://localhost:4444/health

Expected output:

{"status": "healthy"}

πŸ” Admin UIΒΆ

Visit http://localhost:4444/admin and login using your PLATFORM_ADMIN_EMAIL and PLATFORM_ADMIN_PASSWORD from .env.


πŸ” Quick JWT SetupΒΆ

export MCPGATEWAY_BEARER_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token -u admin@example.com)
curl -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" http://localhost:4444/tools