Backends
The Backends screen is a central location for development server entry points and launch script configurations.
Presets for OpenBB API & OpenBB MCP are created with default settings during the initial environment installation.
Features
- Configure, control, and monitor multiple application servers from a simple interface.
- Use any executable available to the selected environment from the command line.
- User-friendly environment variable management.
- Start services on operating system login.
- Generate X.509 certificates and PKCS#12 bundles to easily run over HTTPS.
- All backends terminate on application exit.
A JavaScript server can be started from the openbb
environment by using the npm
executable.
Node can be added to any envrionment as a Conda package, nodejs
, independent of any global installations.
Configuration
Each backend created will appear on the screen as a new box, with details about its status and configuration.
When the backend is running, the display will update to the server's URL after startup is complete.
Edit the settings for an existing backend by clicking the gear icon, on the right-side of the panel.
The configuration panels for creating or editing a service allows setting runtime arguments, environment variables, and the working directory.
Create New
- Click New Backend.
- Fill the Backend Name (required).
- Select the Environment that contains the required packages.
- Executable – anything you would type in a shell, e.g.
openbb-api
,uvicorn myapp:app --reload
,python feed.py --ws
. - (Optional) Working Directory – folder from which the command is executed.
- (Optional) Environment File – path to a
.env
file whose variables are exported before launch. - (Optional) Environment Variables - multi-line text input where each line should be a KEY=VALUE pair.
- Exported after the
.env
file.
- Exported after the
- Enable Start Automatically, if desired.
- Enable
Start at Login
, in the tray icon menu, to start on operating system login.
- Enable
- Press Create.
The new backend appears in the list. Use the Start button to launch it.
Logs
Pressing the Logs
button opens a window with the console output (colors removed) from the running backend.
Each backend will buffer up to 10K of the most recent lines, in memory, and are discarded on application quit.
Experiencing problems with a backend? Press the Logs
button to see errors.
Self-Signed Certificate
Self-signed certificates can enable backends to run securely over HTTPS. This feature is the simplest way for anyone to generate the required files. No additional software, or technical knowledge, is required.
X.509 certificates and files are generated by standard OpenSSL binaries, compiled from the most recent version. No other encryption tools, or parameters beyond what is available in the screen, are available.
How To Generate
- Click Generate Certificate
- Enter the required fields:
- Common Name (e.g., 127.0.0.1)
- Address for which the certificate is valid.
- Organization Name (e.g., My Organization)
- Output Directory
- Where the files will be created.
- Common Name (e.g., 127.0.0.1)
- Enter any optional fields:
- Alternative Names (e.g., localhost,0.0.0.0)
- Aliases for the
Common Name
- Aliases for the
- Password (set for PKCS#12 bundle)
- Days Valid (default 1 year)
- Alternative Names (e.g., localhost,0.0.0.0)
- Check the box to also add the certificate to the user's trust store.
- An operating system dialog will open to confirm adding the certificate.
- This allows making HTTPS requests to the server, from the machine, without any additional configuration.
- Press Generate
- Open the folder to inspect the results and move the
private.key
file to a secure destination.
- Open the folder to inspect the results and move the
- Return to the
Backends
screen by clicking X, in the top-right.
How To Use
Do not store the private.key
file in the same location as the public certificate.
Use environment variables, or a .env
file, to configure the backend for HTTPS. For backends using uvicorn
or openbb-api
as the executable, set the items below.
UVICORN_SSL_CERTFILE = "/pathto/public_folder/certificate.pem"
UVICORN_SSL_KEYFILE = "/pathto/private_folder/private.key"
When opening a server URL (i.e. /docs
) in a browser, you will need to manually allow the certificate through the warning dialog.
Example: MCP Server
The REST API generated by the ODP python packages can be run as a MCP server, which can be added to the Agent Chat Interface in OpenBB Workspace.
Before creating the backend, install the openbb-mcp-server
extension to the target environment (openbb
).
- Press the New Backend button.
- Select
openbb
as the environment. - Give it a name like,
OpenBB MCP
. - Enter executable as,
openbb-mcp --port 6950
.- See the documentation for additional configuration options.
- Click Create.
- Start the backend.
- Open Workspace from the tray icon menu and add the MCP server address - i.e,
http://127.0.0.1:6950/mcp/
- from the chat window.- The server URL showing after startup will be missing the transport path,
/mcp/
. Be sure to include it as part of the URL.
- The server URL showing after startup will be missing the transport path,
Troubleshooting & FAQ
Backend server management is intended for single-user, desktop operating systems. The operating system may close network connections when the machine sleeps, backend services may not reflect their status.
Question | Answer |
---|---|
Backend stuck at starting. | After 30s, if an error is not detected the status will update as running. |
Backend URL displayed is incorrect. | The UI looks for a host:port pattern from the application startup. Check the logs for errors and report unexpected outcomes on Github. |
Startup traceback. | The GUI captures the full traceback and stops the service; open logs for details, fix code, then Start again. |
Port already in use. | Edit the backend and set the --port runtime argument, or stop the conflicting process. |
Port different than expected. | Launchers such as, openbb-api , will find the next available port. Is a service already running? |
How do I expose the API to my LAN? | Set the --host runtime argument as, 0.0.0.0 , and ensure the firewall allows the chosen port. |
Can I run non-Python services? | Yes – any executable/script is allowed as long as it runs inside the selected Conda environment. |
Status shows as running, but backend failed to start. | Refresh the window by right-clicking and selecting reload. Does the status change? Press Stop. Is the process terminated? Consult the logs and report unexpected outcomes on Github. |
Backend fails to terminate on ODP exit. | This is likely a bug, please report on Github, with context. |