You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Feature] openbb-mcp-server: Refactor for FastMCP V3 (#7380)
* add developer and user interface skills to baseline openbb-mcp server
* pylint
* tests
* refactor for fastmcp v3
* pylint
* fix some v3 syntax and add tools for list and read resources
* more deprecated imports
* too-many-lines
* add name slug and use description from below the title instead of short sentence
* add VSCodeSkillsProvider to imports and vendor skills providers map
* replace custom prompt tools with PromptsAsTools transform
* use ResourcesAsTools transforms instead of manual list/read functions
* replace ToolRegistry with CategoryIndex
* update readme and skill files
* use in docstring..
* clean docstring
* codespell
* more pyproject.toml
* fix merge conflict
---------
Co-authored-by: deeleeramone <>
Copy file name to clipboardExpand all lines: openbb_platform/extensions/mcp_server/README.md
+83-28Lines changed: 83 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,11 @@
2
2
3
3
This extension enables LLM agents to interact with OpenBB Platform's REST API endpoints through the MCP protocol.
4
4
5
-
The server provides discovery tools that allow agents to explore different options and dynamically adjust their active toolset.
6
-
This prevents agents from being overwhelmed with too many tools while allowing them to discover and activate only the tools they need for specific tasks.
5
+
The server provides discovery tools that allow agents to explore available categories and dynamically activate only the tools they need.
6
+
This keeps the initial tool list small — preventing token bloat — while still giving agents access to the full platform on demand.
7
7
8
-
Using dynamic tool discovery has one major drawback, it makes the server a single-user server.
9
-
The tool updates are global, so if one user updates a tool, it will be updated for all users.
10
-
11
-
If you plan to serve multiple users, you should disable tool discovery,
12
-
and instead use the `allowed_tool_categories` and `default_tool_categories` settings to control the tools that are available to the users.
8
+
Tool visibility changes are **per-session**: each connected client has its own active toolset.
9
+
Multiple agents can connect simultaneously and independently activate different tools without interfering with each other.
13
10
14
11
## Installation & Usage
15
12
@@ -90,7 +87,7 @@ The server can be configured through multiple methods, with settings applied in
90
87
1.**Command Line Arguments**: Highest priority, overriding all other methods.
91
88
2.**Environment Variables**: Each setting can be controlled by an environment variable, which will override the configuration file.
92
89
3.**Configuration File**: A JSON file at `~/.openbb_platform/mcp_settings.json` provides the base configuration.
93
-
- If the cnofiguration file does not exist, one will be populated with the defaults.
90
+
- If the configuration file does not exist, one will be populated with the defaults.
94
91
95
92
> **Note:** For some data providers you need to set your API key in the `~/.openbb_platform/user_settings.json` file.
96
93
@@ -221,21 +218,24 @@ All settings in the `MCPSettings` model can be configured via the `mcp_settings.
221
218
|`name`|`OPENBB_MCP_NAME`| string |`"OpenBB MCP"`| Server name. |
222
219
|`description`|`OPENBB_MCP_DESCRIPTION`| string || Server description. |
223
220
|`version`|`OPENBB_MCP_VERSION`| string |`None`| Server version. |
221
+
|`instructions`|`OPENBB_MCP_INSTRUCTIONS`| string |`None`| Server instructions sent during the MCP `initialize` handshake. Auto-populated from system prompt if not set. |
224
222
|`default_tool_categories`|`OPENBB_MCP_DEFAULT_TOOL_CATEGORIES`| list[string]|`["all"]`| Default active tool categories on startup. |
225
223
|`allowed_tool_categories`|`OPENBB_MCP_ALLOWED_TOOL_CATEGORIES`| list[string]|`None`| Restricts available tool categories to this list. |
|`list_page_size`|`OPENBB_MCP_LIST_PAGE_SIZE`| integer |`None`| Max items per page in MCP list responses. `None` disables pagination. |
227
226
|`describe_responses`|`OPENBB_MCP_DESCRIBE_RESPONSES`| boolean |`False`| Include response types in tool descriptions. |
228
227
|`system_prompt_file`|`OPENBB_MCP_SYSTEM_PROMPT_FILE`| string |`None`| Path to a text file for the system prompt. |
229
228
|`server_prompts_file`|`OPENBB_MCP_SERVER_PROMPTS_FILE`| string |`None`| Path to a JSON file with a list of server prompt definitions. |
229
+
|`default_skills_dir`|`OPENBB_MCP_DEFAULT_SKILLS_DIR`| string |*(bundled skills dir)*| Path to a directory of bundled skill files. Set to `null` to disable. |
230
+
|`skills_reload`|`OPENBB_MCP_SKILLS_RELOAD`| boolean |`False`| Reload skill files on every read (useful during development). |
|`on_duplicate_resources`|`OPENBB_MCP_ON_DUPLICATE_RESOURCES`| string |`None`| Behavior for duplicate resources. |
233
235
|`on_duplicate_prompts`|`OPENBB_MCP_ON_DUPLICATE_PROMPTS`| string |`None`| Behavior for duplicate prompts. |
234
236
|`resource_prefix_format`|`OPENBB_MCP_RESOURCE_PREFIX_FORMAT`| string |`None`| Format for resource URI prefixes (`protocol` or `path`). |
235
237
|`mask_error_details`|`OPENBB_MCP_MASK_ERROR_DETAILS`| boolean |`None`| Mask error details from user functions. |
236
238
|`dependencies`|`OPENBB_MCP_DEPENDENCIES`| list[string]|`None`| List of dependencies to install. |
237
-
|`include_tags`|`OPENBB_MCP_INCLUDE_TAGS`| set[string]|`None`| Only expose components with these tags. |
238
-
|`exclude_tags`|`OPENBB_MCP_EXCLUDE_TAGS`| set[string]|`None`| Exclude components with these tags. |
239
239
|`module_exclusion_map`|`OPENBB_MCP_MODULE_EXCLUSION_MAP`| dict[str, str]|`None`| Map API tags to Python module names for exclusion. |
240
240
|`uvicorn_config`|`OPENBB_MCP_UVICORN_CONFIG`| dict |`{"host": "127.0.0.1", "port": "8001"}`| Configuration for the Uvicorn server. |
241
241
|`httpx_client_kwargs`|`OPENBB_MCP_HTTPX_CLIENT_KWARGS`| dict |`{}`| Configuration for the async httpx client. |
@@ -269,36 +269,43 @@ Each category contains subcategories that group related functionality (e.g., `eq
269
269
270
270
An additional set of tools are tagged as "admin", or "prompt".
271
271
272
-
- available_categories
272
+
-**available_categories**: List all tool categories with subcategory names and tool counts.
273
+
274
+
-**available_tools**: List tools in a specific category (and optional subcategory).
275
+
-`category`: Category of tools to list.
276
+
-`subcategory`: Optional subcategory. Use `general` for tools directly under the category.
277
+
- Inactive tools still show a short description so they remain discoverable.
273
278
274
-
- available_tools: List all tools by category.
275
-
-`category`: Category of tool to list.
276
-
-`subcategory`: Optional subcategory. Use 'general' for tools directly under the category.
279
+
-**activate_tools**: Activate one or more tools by name for this session.
280
+
-`tool_names`: List of tool names to activate.
277
281
278
-
-activate_tools: Activate a tool for use.
279
-
-`tool_names`: Names of tools to activate. Comma-separated string for multiple.
282
+
-**deactivate_tools**: Deactivate one or more tools by name for this session.
283
+
-`tool_names`: List of tool names to deactivate.
280
284
281
-
- deactivate_tools: Deactivate a tool after use.
282
-
-`tool_names`: Names of tools to deactivate. Comma-separated string for multiple.
285
+
-**activate_category**: Activate all tools in a category (or subcategory) at once.
286
+
-`category`: Category name.
287
+
-`subcategory`: Optional subcategory to narrow the activation.
283
288
284
-
- list_prompts: Lists all available prompts in the server.
289
+
-**list_prompts**: Lists all available prompts in the server.
285
290
286
-
- execute_prompt: Execute a prompt with arguments, if any.
291
+
-**execute_prompt**: Execute a prompt with arguments, if any.
287
292
-`prompt_name`: Name of the prompt to execute.
288
293
-`arguments`: Dictionary of argument:value for the prompt.
289
294
290
295
## Tool Discovery
291
296
292
-
When `enable_tool_discovery` is enabled (default), the server provides discovery tools that allow agents to:
297
+
When `enable_tool_discovery` is enabled (default), the server registers a small set of admin tools that let agents progressively discover and activate what they need:
293
298
294
-
- Discover available tool categories and subcategories
295
-
- See tool counts and descriptions before activating
296
-
- Enable/disable specific tools dynamically during a session
297
-
- Start with minimal tools and progressively add more as needed
299
+
1.**Browse** — `available_categories` returns the category tree with tool counts.
300
+
2.**Inspect** — `available_tools` lists every tool in a category with its active/inactive state and a short description.
301
+
3.**Activate** — `activate_tools` or `activate_category` enables specific tools (or an entire category) for the current session.
302
+
4.**Deactivate** — `deactivate_tools` removes tools when they are no longer needed.
298
303
299
-
To take full advantage of minimal startup tools, you should set the `--default-categories` argument to `admin`. This will enable only the discovery tools at startup.
304
+
All visibility changes are **per-session** — each client maintains its own active toolset, so the server is safe for multi-user deployments.
300
305
301
-
For multi-client deployments or scenarios where you want a fixed toolset, disable tool discovery with `--no-tool-discovery`.
306
+
To take full advantage of minimal startup tools, set `--default-categories admin` so only the discovery tools are active on connect.
307
+
308
+
For scenarios where you want a completely fixed toolset (no discovery overhead), disable it with `--no-tool-discovery` and control the available tools via `allowed_tool_categories` and `default_tool_categories`.
302
309
303
310
## System Prompt
304
311
@@ -309,6 +316,54 @@ The system prompt is made available as a resource, `resource://system_prompt`, a
309
316
310
317
Clients will not automatically use the system prompt, instruct them to use it as part of their onboarding and orientation.
311
318
319
+
## Skills
320
+
321
+
The server ships with a set of bundled **skill guides** — Markdown documents that teach an agent how to perform complex multi-step tasks with the OpenBB Platform.
322
+
Skills are exposed as MCP resources and are discoverable via `list_resources()`.
323
+
324
+
Each skill is available at a URI of the form `skill://<name>/SKILL.md`.
325
+
326
+
### Bundled Skills
327
+
328
+
| Skill | URI | Description |
329
+
|---|---|---|
330
+
|`develop_extension`|`skill://develop_extension/SKILL.md`| Step-by-step guide for building an OpenBB Platform extension. |
331
+
|`build_workspace_app`|`skill://build_workspace_app/SKILL.md`| Guide for building and running OpenBB Workspace applications. |
332
+
|`configure_mcp_server`|`skill://configure_mcp_server/SKILL.md`| Reference for configuring and customising the OpenBB MCP Server. |
333
+
|`work_with_server`|`skill://work_with_server/SKILL.md`| Practical guide for working with the OpenBB MCP Server as an agent. |
334
+
335
+
When any skills are loaded and no `system_prompt_file` is configured, the server automatically adds a brief default system prompt that nudges the agent to discover available skills.
336
+
337
+
### Skill Settings
338
+
339
+
| Setting | Description |
340
+
|---|---|
341
+
|`default_skills_dir`| Path to the bundled skills directory. Set to `null` or an empty string to disable loading the built-in skills. |
342
+
|`skills_reload`| Set to `true` to reload skill files from disk on every read — useful when authoring or iterating on skill content. |
343
+
|`skills_providers`| A list of vendor skill provider short-names. Supported values: `claude`, `cursor`, `vscode`, `copilot`, `codex`, `gemini`, `goose`, `opencode`. |
344
+
345
+
**Example — disable bundled skills:**
346
+
347
+
```json
348
+
{
349
+
"default_skills_dir": null
350
+
}
351
+
```
352
+
353
+
**Example — load vendor skill providers:**
354
+
355
+
```json
356
+
{
357
+
"skills_providers": ["claude", "cursor"]
358
+
}
359
+
```
360
+
361
+
**Example — enable skill reload during development:**
362
+
363
+
```env
364
+
OPENBB_MCP_SKILLS_RELOAD=true
365
+
```
366
+
312
367
## Server Prompts
313
368
314
369
A system prompt file can be added on initialization, or defined in the configuration file, or as an environment variable.
0 commit comments