The initial setup includes a demo database. To connect your own database:
-
Access DreamFactory Admin:
open http://localhost:8080
Login with the email/password from your
.envfile -
Navigate to Services:
- Click "Services" in the sidebar
- Click "Create" button
-
Select Database Type:
- Choose your database (PostgreSQL, MySQL, MongoDB, etc.)
- Note: Oracle, SQL Server, Snowflake require DreamFactory Commercial
-
Enter Connection Details:
- Service Name:
my_database(used in API URLs) - Host: Your database hostname (e.g.,
localhost,db.example.com) - Port: Database port (e.g.,
5432for PostgreSQL) - Database Name: Your database name
- Username: Database user
- Password: Database password
- Service Name:
-
Test & Save:
- Click "Test Connection"
- If successful, click "Save"
-
Access Your API:
# List tables curl http://localhost:8080/api/v2/my_database/_table # Query data curl http://localhost:8080/api/v2/my_database/_table/users
To add a database to your Docker Compose setup:
Edit docker-compose.yml, add to web service environment:
environment:
# ... existing vars ...
EXTERNAL_DB_DRIVER: pgsql
EXTERNAL_DB_HOST: db.yourcompany.com
EXTERNAL_DB_PORT: 5432
EXTERNAL_DB_DATABASE: production_db
EXTERNAL_DB_USERNAME: readonly_user
EXTERNAL_DB_PASSWORD: "your_secure_password"Then configure the service via Admin UI (see Quick Method above).
After adding your database:
-
Update MCP config to point to your new service:
Claude Desktop (
~/.config/Claude/claude_desktop_config.json):{ "mcpServers": { "my-database": { "url": "http://localhost:8080/api/v2/mcp/my_database", "headers": { "X-DreamFactory-API-Key": "YOUR_API_KEY" } } } }Claude Code (
.mcp.jsonin your project):{ "mcpServers": { "my-database": { "command": "node", "args": ["./mcp-proxy/proxy.js"], "env": { "DF_BASE_URL": "http://localhost:8080", "DF_INTERNAL_URL": "http://localhost", "DF_ADMIN_EMAIL": "admin@example.com", "DF_ADMIN_PASSWORD": "your_password", "DF_MCP_SERVICE": "mcp_my_database", "DF_OAUTH_CLIENT_ID": "your_client_id", "DF_OAUTH_CLIENT_SECRET": "your_client_secret" } } } } -
Restart Claude Desktop or restart MCP servers
Simplified database connection with one command:
npx @dreamfactory/connect
# Interactive wizard for database setupSee ROADMAP.md for details.
Connection failed:
- Verify database is accessible from Docker container
- Check firewall rules
- For
localhostdatabases, usehost.docker.internal(Mac/Windows) or172.17.0.1(Linux)
API key not working:
- Generate new API key in Admin UI → Apps → Create
- Update MCP configuration with new key
Can't see tables:
- Check database user permissions
- Verify schema/database name is correct
- Review DreamFactory logs:
docker compose logs web
More help: Troubleshooting Guide