mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-07 01:41:17 +00:00
* [BugFix] MCP - expose correct header for session id * Pin FastMCP to <2.9 The update casued problems with converting tools from OpenAPI specs * Update default settings * Add exclusion for all POST requests in route filtering * fix compress input and output schemas with newer fastmcp versions * Add unit tests for MCP server, utilities and settings * add missing init file * skip tests for python 3.9 * Add setup instructions for VS Code * update fastmcp version and lock file --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: DidierRLopes <didierrlopes@gmail.com>
28 lines
852 B
Python
28 lines
852 B
Python
"""Unit tests for MCPSettings model."""
|
|
|
|
from openbb_mcp_server.utils.settings import MCPSettings
|
|
|
|
|
|
def test_mcp_settings_defaults():
|
|
settings = MCPSettings()
|
|
assert settings.name == "OpenBB MCP"
|
|
assert settings.default_tool_categories == ["all"]
|
|
assert settings.allowed_tool_categories is None
|
|
assert settings.enable_tool_discovery is True
|
|
assert settings.describe_responses is False
|
|
|
|
|
|
def test_mcp_settings_validation():
|
|
settings = MCPSettings(
|
|
default_tool_categories="cat1,cat2", allowed_tool_categories="cat3"
|
|
)
|
|
assert settings.default_tool_categories == ["cat1", "cat2"]
|
|
assert settings.allowed_tool_categories == ["cat3"]
|
|
|
|
|
|
def test_mcp_settings_repr():
|
|
settings = MCPSettings(name="Test")
|
|
repr_str = repr(settings)
|
|
assert "MCPSettings" in repr_str
|
|
assert "name: Test" in repr_str
|