Skip to content

Commit 41e7ba7

Browse files
committed
Update the workspace MCP docs to feature hosted MCP vs sidecar
1 parent 9698f86 commit 41e7ba7

7 files changed

Lines changed: 164 additions & 394 deletions

File tree

content/agents/app-builder-resources.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,34 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
1616

1717
<HeadTitle title="App Builder Resources | OpenBB Workspace Docs" />
1818

19-
The OpenBB app-builder instructions are maintained in the
20-
[Workspace MCP repository](https://github.com/OpenBB-finance/workspace-mcp).
21-
They help agents build custom OpenBB Workspace applications, including backend
22-
endpoints, `widgets.json`, `apps.json`, dashboard layouts, thumbnails, widget
23-
parameters, validation, and semantic output checks.
19+
The OpenBB app-builder instructions are maintained in the [Workspace MCP repository](https://github.com/OpenBB-finance/workspace-mcp). They help agents build custom OpenBB Workspace applications, including backend endpoints, `widgets.json`, `apps.json`, dashboard layouts, thumbnails, widget parameters, validation, and semantic output checks.
2420

2521
## Source of truth
2622

27-
When your agent is connected to Workspace MCP, ask it to read the live MCP
28-
resource index:
23+
When your agent is connected to Workspace MCP, ask it to read the live MCP resource index:
2924

3025
```text
3126
openbb://workspace/app-builder/index
3227
```
3328

34-
The index routes the agent to the right app-builder spec, guide, example, or
35-
validation resource for the task.
29+
The index routes the agent to the right app-builder spec, guide, example, or validation resource for the work.
3630

3731
## Installable skill package
3832

39-
For agents that support installable skills, but are not using Workspace MCP
40-
resources directly, install the generated `openbb-app-builder` skill from the
41-
Workspace MCP repository:
33+
For agents that support installable skills, but are not using Workspace MCP resources directly, install the generated `openbb-app-builder` skill from the Workspace MCP repository:
4234

4335
```bash
4436
npx skills add https://github.com/OpenBB-finance/workspace-mcp --skill openbb-app-builder
4537
```
4638

47-
This skill package is generated from the same Workspace MCP resource catalog.
48-
It is a compatibility artifact, not a separate source of truth.
39+
This skill package is generated from the same Workspace MCP resource catalog. It is a compatibility artifact, not a separate source of truth.
4940

5041
## Main resource entry points
5142

52-
| Task | Resource |
43+
| Use case | Resource |
5344
|------|----------|
54-
| Start any app-building task | `openbb://workspace/app-builder/index` |
55-
| Build a new app backend | `openbb://workspace/guides/build-an-app` |
45+
| Start app-building work | `openbb://workspace/app-builder/index` |
46+
| Build an app backend | `openbb://workspace/guides/build-an-app` |
5647
| Review an existing app | `openbb://workspace/guides/review-app` |
5748
| Debug a broken app | `openbb://workspace/guides/debug-app` |
5849
| Convert an endpoint to a widget | `openbb://workspace/guides/convert-endpoint-to-widget` |

content/agents/workspace-mcp-overview.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import TutorialVideo from '@site/src/components/General/TutorialVideo.tsx';
1616

1717
<HeadTitle title="Workspace MCP Overview | OpenBB Docs" />
1818

19-
The OpenBB Workspace MCP is a local companion server that exposes your active Workspace browser session as Model Context Protocol (MCP) tools. An external MCP-capable agent can use those tools to inspect dashboards, fetch widget data, create widgets, manage tabs, register backends, and instantiate Workspace apps.
19+
The OpenBB Workspace MCP exposes your active Workspace browser session as Model Context Protocol (MCP) tools through a hosted backend endpoint. An external MCP-capable agent can use those tools to inspect dashboards, fetch widget data, create widgets, manage tabs, register backends, and instantiate Workspace apps.
2020

2121
Use it when an agent needs structured access to Workspace state. It avoids brittle browser automation because the agent calls Workspace commands directly instead of clicking through the UI.
2222

@@ -41,14 +41,14 @@ This demo shows Codex using the Workspace MCP to interact with an active OpenBB
4141

4242
## Architecture
4343

44-
The Workspace MCP runs as a local sidecar process:
44+
The Workspace MCP is served by the OpenBB backend:
4545

4646
```text
4747
MCP client or agent
4848
|
4949
| streamable HTTP MCP
5050
v
51-
Workspace MCP sidecar
51+
OpenBB backend `/mcp`
5252
|
5353
| WebSocket bridge
5454
v
@@ -59,13 +59,13 @@ OpenBB Workspace browser tab
5959
Dashboards, widgets, apps, data backends, and skills
6060
```
6161

62-
The sidecar exposes a stateless MCP endpoint at `http://127.0.0.1:8787/mcp` by default. Workspace connects to the same sidecar through a browser bridge. Tool calls sent by the agent are forwarded to the connected browser tab, executed by Workspace, and returned as structured results.
62+
OpenBB Workspace shows the hosted MCP endpoint in the Workspace MCP Companion. The endpoint path is `/mcp` on the same backend host used by Workspace. Workspace connects to the backend through a browser bridge. Tool calls sent by the agent are forwarded to the connected browser tab, executed by Workspace, and returned as structured results.
6363

64-
The browser must stay open and connected. If the Workspace tab disconnects, the sidecar remains running but tool calls return an unavailable error until the browser reconnects.
64+
The browser must stay open and connected. If the Workspace tab disconnects, tool calls return an unavailable error until the browser reconnects. Each user has one active Workspace MCP bridge; connecting another browser bridge replaces the previous one.
6565

6666
## What agents can do
6767

68-
The current tool surface covers the main Workspace authoring and inspection workflows:
68+
Workspace MCP covers the main Workspace authoring and inspection workflows:
6969

7070
| Area | Examples |
7171
|------|----------|
@@ -77,7 +77,7 @@ The current tool surface covers the main Workspace authoring and inspection work
7777
| Widget authoring | Create widgets from backend definitions, update widget parameters, resize or move widgets, read widget state, and delete individual widgets. |
7878
| Generated artifacts | Add generated notes, tables, charts, and HTML widgets without a backend connection. |
7979
| Backend and app workflows | Register data backends, refresh backends, list app templates, and instantiate apps into dashboards. |
80-
| Agent and skill workflows | Delegate tasks to configured Workspace agents and load skills from the Workspace skill library. |
80+
| Agent and skill workflows | Delegate work to configured Workspace agents and load skills from the Workspace skill library. |
8181

8282
The MCP server also publishes app-builder resources under `openbb://workspace/...`. Agents can read these resources when they are building or reviewing Workspace backends, `widgets.json`, or `apps.json` files.
8383

@@ -114,21 +114,20 @@ This is useful for development workflows where the agent owns both the backend c
114114

115115
Treat any MCP client connected to the Workspace MCP as trusted. The tool server can read Workspace state and mutate dashboards in the connected browser session.
116116

117-
Keep the sidecar local:
117+
Workspace MCP uses a Workspace MCP personal access token:
118118

119-
- Bind to `127.0.0.1`, which is the default.
120-
- Do not expose it on `0.0.0.0`, a LAN address, a tunnel, or a public reverse proxy.
121-
- Use local HTTP for `localhost` or `127.0.0.1`; HTTPS is not required for the local sidecar.
119+
- Send the token as `Authorization: Bearer <token>`.
120+
- Store the token in your MCP client configuration.
121+
- Revoke the token from Workspace when it should stop working.
122122
- Connect only MCP clients you trust to read and change your Workspace.
123123

124-
The Workspace MCP operates inside an existing authenticated browser session. It does not log in for you, manage authentication tokens, change billing, change organization settings, invite users, or share dashboards.
124+
The Workspace MCP personal access token authenticates the `/mcp` endpoint only. It is not accepted by normal Workspace API routes, and it does not change billing, organization settings, user invites, or dashboard sharing.
125125

126126
## Requirements
127127

128128
- An OpenBB Workspace browser tab.
129-
- The Workspace MCP sidecar running locally.
129+
- The Workspace MCP Companion connected in Workspace.
130130
- An MCP client that can connect to a streamable HTTP MCP server.
131-
- Python 3.13 when installing or running the sidecar directly.
132-
- `uv` for the recommended install path. The helper script installs `uv` if it is not already available.
131+
- A Workspace MCP personal access token created in Workspace.
133132

134133
See [Workspace MCP Quickstart](/agents/workspace-mcp-quickstart) for setup steps and [Workspace MCP Tools](/agents/workspace-mcp-tools) for the tool reference.
Lines changed: 41 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Workspace MCP Quickstart
33
sidebar_position: 2
4-
description: Run the OpenBB Workspace MCP sidecar, connect Workspace, and attach an external MCP client.
4+
description: Create a Workspace MCP token, connect the browser bridge, and attach an external MCP client.
55
keywords:
66
- OpenBB Workspace MCP
77
- Workspace MCP quickstart
@@ -16,102 +16,21 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
1616

1717
<HeadTitle title="Workspace MCP Quickstart | OpenBB Docs" />
1818

19-
This guide starts the Workspace MCP sidecar on your machine, connects it to an OpenBB Workspace browser tab, and configures an MCP client to call Workspace tools.
19+
This guide connects an external MCP client to an active OpenBB Workspace browser session through the hosted Workspace MCP endpoint.
2020

2121
## Prerequisites
2222

2323
Before you start:
2424

2525
- OpenBB Workspace is available in your browser.
2626
- Your MCP client supports HTTP MCP servers.
27-
- Your machine can run Python 3.13.
28-
- You can install or run tools with `uv`.
27+
- You can edit your MCP client configuration.
2928

30-
The helper script installs `uv` when it is missing. If you manage Python environments manually, install `uv` first and use the direct command shown below.
29+
The Workspace tab must stay open and connected while the external agent uses Workspace MCP tools.
3130

32-
## 1. Start the sidecar
31+
## 1. Open Workspace MCP Companion
3332

34-
Install the sidecar from the [Workspace MCP repository](https://github.com/OpenBB-finance/workspace-mcp), or use one of the one-line installers below.
35-
36-
**macOS, Linux, WSL, and Git Bash:**
37-
38-
```bash
39-
curl -LsSf https://raw.githubusercontent.com/OpenBB-finance/workspace-mcp/main/scripts/run.sh | sh
40-
```
41-
42-
**Windows PowerShell:**
43-
44-
```powershell
45-
powershell -ExecutionPolicy Bypass -Command "Invoke-RestMethod https://raw.githubusercontent.com/OpenBB-finance/workspace-mcp/main/scripts/run.ps1 | Invoke-Expression"
46-
```
47-
48-
<div style={{display: 'flex', justifyContent: 'center'}}>
49-
<img
50-
className="pro-border-gradient"
51-
alt="Terminal showing the Workspace MCP sidecar running correctly"
52-
src="https://openbb-cms.directus.app/assets/2ed50bec-4bf9-4aed-99ef-9a1b7348901d.png"
53-
width="1000"
54-
/>
55-
</div>
56-
57-
The default server listens on:
58-
59-
```text
60-
http://127.0.0.1:8787
61-
```
62-
63-
The MCP endpoint is:
64-
65-
```text
66-
http://127.0.0.1:8787/mcp
67-
```
68-
69-
The script installs `uv` if needed, then runs `workspace-mcp` from the OpenBB Workspace MCP source archive.
70-
71-
### Passing options to the installer
72-
73-
The one-line installers forward any arguments after `--` straight to `workspace-mcp`, so you can set options like `--cors-allow`, `--host`, or `--port` without installing the binary separately.
74-
75-
**macOS, Linux, WSL, and Git Bash** — add `-s --` after `sh`, then the flags:
76-
77-
```bash
78-
curl -LsSf https://raw.githubusercontent.com/OpenBB-finance/workspace-mcp/main/scripts/run.sh \
79-
| sh -s -- --cors-allow https://your-origin.openbb.co
80-
```
81-
82-
**Windows PowerShell** — append the flags to the run command:
83-
84-
```powershell
85-
powershell -ExecutionPolicy Bypass -Command "Invoke-RestMethod https://raw.githubusercontent.com/OpenBB-finance/workspace-mcp/main/scripts/run.ps1 | Invoke-Expression" -- --cors-allow https://your-origin.openbb.co
86-
```
87-
88-
See the [configuration reference](#configuration-reference) for the full list of options you can pass this way. For other advanced options (forks, branches, or local checkouts), see the [Workspace MCP repository](https://github.com/OpenBB-finance/workspace-mcp).
89-
90-
## 2. Check sidecar health
91-
92-
In another terminal, call the health endpoint:
93-
94-
```bash
95-
curl http://127.0.0.1:8787/health
96-
```
97-
98-
Before Workspace connects, the response should show that the sidecar is running and no browser is attached:
99-
100-
```json
101-
{
102-
"ok": true,
103-
"browser_connected": false,
104-
"pending_commands": 0,
105-
"session": null
106-
}
107-
```
108-
109-
After Workspace connects, `browser_connected` should be `true` and `session` should include the current browser session metadata.
110-
111-
112-
## 3. Connect Workspace to the sidecar
113-
114-
Open OpenBB Workspace in your browser and connect the local companion:
33+
Open OpenBB Workspace in your browser and open the hosted companion:
11534

11635
1. Open Workspace.
11736
2. Click the hamburger icon in the top-left corner.
@@ -126,77 +45,71 @@ Open OpenBB Workspace in your browser and connect the local companion:
12645
/>
12746
</div>
12847

129-
4. Set the companion base URL to `http://127.0.0.1:8787`.
130-
5. Click the connect action after the sidecar is running.
131-
48+
The companion shows the hosted MCP endpoint. The endpoint path is `/mcp` on the same backend host used by Workspace.
13249

133-
<div style={{display: 'flex', justifyContent: 'center'}}>
134-
<img
135-
className="pro-border-gradient"
136-
alt="Workspace MCP Companion connected to the local sidecar"
137-
src="https://openbb-cms.directus.app/assets/0df1ae5d-d391-42b7-8c36-25b9be5d6dfc.png"
138-
width="800"
139-
/>
140-
</div>
50+
## 2. Create a Workspace MCP token
14151

142-
By default, the sidecar allows CORS requests from `https://pro.openbb.co` and loopback origins such as `http://localhost:1420` and `http://127.0.0.1:1420`.
52+
In the companion modal:
14353

144-
For a different Workspace origin, pass `--cors-allow`. If you started the sidecar with the one-line installer, forward the flag through `sh -s --`:
54+
1. Enter a token name.
55+
2. Click **Create token**.
56+
3. Copy the token shown in the success message.
14557

146-
```bash
147-
curl -LsSf https://raw.githubusercontent.com/OpenBB-finance/workspace-mcp/main/scripts/run.sh \
148-
| sh -s -- --cors-allow https://example.openbb.dev
149-
```
58+
The raw token is shown once. Existing tokens are listed by name and prefix, and can be revoked from the same modal.
15059

151-
If you run the binary directly, pass it the same way:
60+
Workspace MCP tokens are personal access tokens for MCP. They are sent as bearer tokens to `/mcp`, remain valid until revoked, and do not authenticate normal Workspace API routes.
15261

153-
```bash
154-
workspace-mcp --cors-allow https://example.openbb.dev
155-
```
62+
## 3. Connect the browser bridge
15663

157-
Repeat `--cors-allow` or pass a comma-separated list to allow more than one origin:
64+
Click **Connect** in the Workspace MCP Companion. This connects the active browser tab to the hosted MCP service.
15865

159-
```bash
160-
workspace-mcp \
161-
--cors-allow https://one.example.openbb.dev,https://two.example.openbb.dev \
162-
--cors-allow http://localhost:1420
163-
```
66+
Each user has one active Workspace MCP browser bridge. If you connect from another tab or device, the latest bridge replaces the previous one.
16467

16568
## 4. Configure your MCP client
16669

167-
Point your MCP client at:
70+
Use the endpoint copied from Workspace MCP Companion and send the token as an HTTP authorization header:
16871

16972
```text
170-
http://127.0.0.1:8787/mcp
73+
Authorization: Bearer obb_mcp_...
17174
```
17275

173-
For clients that read a project `.mcp.json` file, use an HTTP server entry:
76+
For clients that read a project `.mcp.json` file, use an HTTP server entry with headers:
17477

17578
```json
17679
{
17780
"mcpServers": {
17881
"workspace_mcp": {
17982
"type": "http",
180-
"url": "http://127.0.0.1:8787/mcp"
83+
"url": "https://pro.openbb.co/mcp",
84+
"headers": {
85+
"Authorization": "Bearer obb_mcp_..."
86+
}
18187
}
18288
}
18389
}
18490
```
18591

186-
If your client has an `mcp add` command or settings UI, choose the HTTP transport and use the same `/mcp` URL.
92+
Replace the URL with the endpoint shown in Workspace MCP Companion.
18793

188-
For Codex:
94+
For Codex, store the token in an environment variable and point Codex at the hosted `/mcp` endpoint:
18995

19096
```bash
191-
codex mcp add workspace_mcp --url http://127.0.0.1:8787/mcp
97+
export OPENBB_WORKSPACE_MCP_TOKEN=obb_mcp_...
98+
codex mcp add workspace_mcp \
99+
--url https://pro.openbb.co/mcp \
100+
--bearer-token-env-var OPENBB_WORKSPACE_MCP_TOKEN
192101
```
193102

194103
For Claude Code:
195104

196105
```bash
197-
claude mcp add --transport http workspace_mcp http://127.0.0.1:8787/mcp
106+
claude mcp add --transport http workspace_mcp \
107+
https://pro.openbb.co/mcp \
108+
--header "Authorization: Bearer obb_mcp_..."
198109
```
199110

111+
If your client has an `mcp add` command or settings UI, choose the HTTP transport, use the hosted `/mcp` URL, and configure the same `Authorization` header.
112+
200113
## 5. Validate the connection
201114

202115
Ask the agent to call `get_workspace_snapshot`. A successful call should return the active Workspace state, including dashboard metadata and the current dashboard composition when available.
@@ -207,7 +120,7 @@ A practical validation prompt is:
207120
Call get_workspace_snapshot and tell me the active dashboard id and the visible tabs.
208121
```
209122

210-
If the agent can list the dashboard and tabs, the MCP client, sidecar, and browser bridge are connected.
123+
If the agent can list the dashboard and tabs, the MCP client, hosted MCP endpoint, and browser bridge are connected.
211124

212125
## 6. Try common Workspace actions
213126

@@ -243,25 +156,12 @@ Analyze my current portfolio exposure and add a markdown note widget with that a
243156
/>
244157
</div>
245158

246-
## Configuration reference
247-
248-
| Option | Default | Description |
249-
|--------|---------|-------------|
250-
| `--host` | `127.0.0.1` | Host interface for the sidecar HTTP server. Keep this on loopback for normal use. |
251-
| `--port` | `8787` | Port for the sidecar HTTP server. |
252-
| `--mcp-path` | `/mcp` | Path for the streamable HTTP MCP endpoint. |
253-
| `--command-timeout-seconds` | `15.0` | Seconds to wait for one browser command result. |
254-
| `--cors-allow` | production Workspace and loopback origins | Extra browser origins allowed to call the sidecar. |
255-
| `--reload` | disabled | Restart the local development server when source files change. |
256-
257-
In reload mode, the CLI also maps options to `OPENBB_WORKSPACE_MCP_*` environment variables so Uvicorn can recreate the app.
258-
259159
## Troubleshooting
260160

261161
| Symptom | What to check |
262162
|---------|---------------|
263-
| `No Workspace browser is connected.` | Open Workspace, open Workspace MCP Companion, and connect it to the sidecar base URL. |
264-
| `browser_connected` is `false` in `/health` | The sidecar is running, but the browser bridge has not connected or has disconnected. |
265-
| Browser CORS error | Add the Workspace browser origin with `--cors-allow`. |
266-
| Tool call times out | Keep the Workspace tab open and active enough to execute commands. Increase `--command-timeout-seconds` for slower operations. |
267-
| MCP client cannot connect | Confirm the client supports HTTP MCP servers and uses `http://127.0.0.1:8787/mcp`, not the sidecar base URL. |
163+
| `Could not validate Workspace MCP credentials` | Confirm the MCP client sends `Authorization: Bearer <token>` and that the token has not been revoked. |
164+
| `No active Workspace browser connected` | Open Workspace, open Workspace MCP Companion, and click **Connect**. |
165+
| Tool call times out | Keep the Workspace tab open and active enough to execute commands. |
166+
| MCP client cannot connect | Confirm the client supports HTTP MCP servers and uses the hosted `/mcp` URL copied from Workspace MCP Companion. |
167+
| Agent sees out-of-date dashboard state | Call `get_workspace_snapshot` again after navigation or reconnect the browser bridge. |

0 commit comments

Comments
 (0)