Add the Model Context Protocol integration (#135058)

* Add the Model Context Protocol integration

* Improvements to mcp integration

* Move the API prompt constant

* Update config flow error handling

* Update test descriptions

* Update tests/components/mcp/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/mcp/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Address PR feedback

* Update homeassistant/components/mcp/coordinator.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Move tool parsing to the coordinator

* Update session handling not to use a context manager

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
Allen Porter
2025-01-27 11:38:52 -08:00
committed by GitHub
parent 85540cea3f
commit 58b4556a1d
19 changed files with 1011 additions and 0 deletions

10
mypy.ini generated
View File

@@ -2916,6 +2916,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.mcp.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.mcp_server.*]
check_untyped_defs = true
disallow_incomplete_defs = true