Commit Graph

9 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 dbab86e0ac Fix broken tests. 2025-05-09 12:17:14 +05:30
Hemang 132eedab0a Update tests_ci.yml so that the CI run fails even when unit tests fail. 2025-05-07 02:03:06 +05:30
Hemang 1f6e2ed7fb Update streaming in anthropic route to handle chunks with incomplete events. Introduce an sse_buffer which keeps track of the current incomplete event from the last processed chunk. 2025-05-07 01:08:15 +05:30
Hemang aec7808e3e Fix broken integration tests. 2025-05-07 01:08:15 +05:30
Hemang eced3755b2 Refactor tests. 2025-04-02 13:40:52 +02:00
Hemang 050ec1ba58 Fetch guardrails from explorer. These have higher precedence than than the guardrails from file. 2025-04-02 13:40:52 +02:00
Hemang c4ecc01a59 Remove unnecessary playwright dependency for tests. 2025-03-13 10:12:55 +01:00
Hemang 6558f23604 Add unit tests and move the current integration tests into a separate directory. 2025-03-12 23:57:00 +01:00