Commit Graph

11 Commits

Author SHA1 Message Date
Luca Beurer-Kellner e18c6b5bdb Add an option to add extra metadata that is pushed and passed to Guardrails during an MCP session (#47)
* use select() before readline

* support for setting static metadata for MCP sessions

* nest extra mcp metadata in metadata object

* unify session metadata

* extra metadata tests

* use empty object as parameters, if None

* list_tools as tool call

* offset indices in tests

* test: adjust addresses

* mcp: make error reporting configurable

* line logging

* log version

* verbose logging + loud exception failure

* add server and client name to policy get

* append trace even if not pushing

* port tools/list message support to SSE

* use python -m build

* adjust guardrail failure address

* support for blocking tools/list in SSE

* use error-based failure response format by default

* tools/list test

* don't list_tools in stdio connect

* flaky test: handle second possible result in anthropic streaming case

---------

Co-authored-by: knielsen404 <kristian@invariantlabs.ai>
2025-05-19 13:44:37 +02:00
Hemang 876eb44c78 Make MCP stdio gateway fully async. With sync and async mixed behaviour for running background tasks we were running into issues. 2025-05-16 14:33:00 +05:30
Hemang Sarkar a6c1124076 Update test_mcp.py 2025-05-15 15:00:31 +05:30
Hemang Sarkar 0ffde69391 Fix test_mcp_sse_with_gateway_hybrid_guardrails so that we don't rely on order of annotations. 2025-05-15 15:00:31 +05:30
Hemang Sarkar fefc22eea0 Update test_mcp.py to include the transport parameter in the hybrid guardrails test. 2025-05-14 15:32:05 +02:00
Hemang ed50670bef Add MCP gateway tests with hybrid guardrails (both blocking and logging). Also refactor tests so that we can parameterize the transport type - stdio or sse. 2025-05-14 18:05:14 +05:30
Hemang 8eae198eb0 Add integration tests for MCP SSE via gateway with guardrails. 2025-05-14 14:21:48 +05:30
Hemang 88ba17a803 Move MCP testing stdio server and client into a separate folder. 2025-04-29 15:56:37 +05:30
Hemang dbeb4bc660 Add blocking guardrails based test for MCP gateway. 2025-04-29 09:00:04 +02:00
Hemang d877e5a1e6 Add logging guardrails based test for MCP gateway. 2025-04-29 09:00:04 +02:00
Hemang d983b7431b Add tests for MCP integration in gateway. 2025-04-29 09:00:04 +02:00