Commit Graph

156 Commits

Author SHA1 Message Date
Vincenzo Reina 6c4252e43b Merge commit from fork 2025-10-27 10:36:32 +01:00
pietrozullo 503f7cace1 chore: remove python cli 2025-10-22 17:41:23 +02:00
Vincenzo Reina 7d3a3040a9 feat: Adapter integrations (#325)
* feat: openai, anthropic, google adapters

* feat: adapters examples and documentation

* feat: update imports

* fix: release drafter action

* docs: header change

* chore: locked langchain dependencies in pyproject.toml (#321)

* python/release/1.3.13

* feat: Update langchain adapter

* feat: Update MCPAgent

* feat: General fixes

* feat: Correct naming

* feat: Fix formatting

* feat: Add genai dependency

* feat: Fix documentation

* feat: Fix imports

* logo

* icons

* Update docs/python/integration/google.mdx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>

* feat: Critical bug fixes

* chore: local logos

* chore: moved icons

* fix: Lambda closure issue

* docs: Add steps

* docs: Fix documentation

* fix docs action

* fix attempt 2

* docs: update

* chore: google optional dependency

* chore: minor docs changes

* fix generate docs script

* fix: lint

* import guard in __init__ file

* ci: install google-genai in docs workflow

* chore: print diffs

* chore: fix action checkout ref

---------

Signed-off-by: Vincenzo Reina <vincenzoreinaa05@gmail.com>
Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: pietrozullo <pietro.zullo@gmail.com>
Co-authored-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-22 07:37:29 +02:00
Pietro Zullo be89397fe8 fix: python: docs: astream removed (#320) 2025-10-17 20:16:07 +02:00
Pietro Zullo 18f51eddb8 Feat: python/restructure (#318)
* move: session

* move: client

* move:config

* move: exceptions

* move: connectors -> client.connectors

* move: task_managers -> client.task_managers

* move: observability -> agents.observability

* move: middleware -> client.middleware

* move: managers -> agents.managers

* move: auth -> client.auth

* move: adapters -> agents.adapters

* test: bc test

* test: bc test

* chore: remove relative imports

* fix tests

* chore: update docs

* chore: deprecation warnings

* chore: fix dangerous non absolute import

* fix: remove legacy imports

* telemetry
2025-10-17 20:09:19 +02:00
pietrozullo ec760c9a91 feat: enhance RemoteAgent to handle structured final events
- Added functionality to process structured final events prefixed with f:.
- Improved error handling for JSON parsing of structured events.
2025-10-16 09:33:00 +02:00
Pietro Zullo 122533b4db Feat/streaming consumption of remote endpoint (#304)
* Remote agent consumes streams not execute

* chore: logs

* chore: docs
2025-10-14 10:53:55 +02:00
Harshith VH 3d69b84068 refactor: middleware metrics (#299)
* refactor metrics for quality and consistency

* fix formatting
2025-10-13 11:09:25 +02:00
Luigi Pederzani bb5de3af95 fix: Return tool result in standard format (#288)
* return tool result directly

* fix type
2025-10-07 14:07:23 +02:00
Vincenzo Reina 822b0b72fc feat: Middleware (#269)
* Middlware first commit
* Add context to middleware
- Add context to middleware with mcp types
- Update logging middleware with new implementation
- Add hooks for every type of action
* Update example and metrics
* Adapt tests to middleware
* Fix metrics and example
* Update docs and new add_middleware function
* Fix metrics property
* Fix on add_middleware function
* Fix formatting
* chore: nicer example
* chore: remove global exports for middleware
* chore: middleware blog

---------

Signed-off-by: Vincenzo Reina <vincenzoreinaa05@gmail.com>
Co-authored-by: pietrozullo <pietro.zullo@gmail.com>
2025-10-07 11:37:08 +02:00
Kinda Hall 4d270d8909 Fix: Fix some bugs about chat_history (#232)
* fix: 🐛 add the query after astream_events

* fix: 🐛 remove the system_prompt from the chat_history

* style: 💄 lint
2025-10-06 18:03:18 +02:00
Harshith VH e8b74768f7 fix: duplicate user message (#287)
* fix duplicate human message

* fix prompt template and move add_to_history after stream
2025-10-06 17:55:37 +02:00
Harshith VH 673bea304a normalize agent outputs across providers (#280) 2025-10-02 11:58:56 +02:00
Vincenzo Reina ea5a12f35a Fix http connector error handling (#279) 2025-09-27 12:22:20 +02:00
Vincenzo Reina 3f6cb669c1 fix: accept empty tool result (#273) 2025-09-23 19:14:19 +02:00
pietrozullo 23069cc45a chore: remove forced output format from neutral prompt template 2025-09-23 15:09:18 +02:00
Amrithesh Kakkoth c60bbf5e17 Fix enum validation issue in jsonschema_to_pydantic (#270)
* Fix enum validation issue in jsonschema_to_pydantic

- Enhanced fix_schema method to automatically add 'type': 'string' to enum fields without explicit type
- This resolves validation errors when passing string values to enum fields in FastMCP tools
- Added comprehensive unit tests for enum handling scenarios
- Fix is backward compatible and preserves existing functionality
- Resolves issue where enum fields without explicit type caused Pydantic validation errors

* Fix linting issues

- Remove whitespace from blank lines
- Sort imports according to project standards
- All ruff checks now pass

* Apply ruff formatting to test file

- Format test_enum_handling.py according to project standards
- All formatting checks now pass

* Fix enum validation test to reflect actual jsonschema-pydantic behavior

- Replace test that expected strict enum validation with test that verifies valid values are accepted
- jsonschema-pydantic doesn't enforce strict enum validation as expected
- Focus on testing that our fix allows valid enum values to pass validation
- This addresses the test failure in CI

---------

Co-authored-by: Amrithesh Kakkoth <amritheshkakkoth@gmail.com>
2025-09-23 14:20:31 +02:00
Pietro Zullo 86be45c2dd feat/authorization (#149)
* Auth 1.0

* Defualt to DCR

* Fix client list server names

* Fix oauth problems with no oauth servers, enhance documentation and comments

* Add OAuth metadata provider and specific fixes

- Remove auth field to reduce API verbosity
- Add "auth" support for MCPClient's config
- Add "oauth_provider" key to MCPClient's config to provide metadata
- Fix no OAuth servers' errors

* Relocate authentication doc

* Fix ruff formatting as usual

* Fix http connectors tests with oauth support

* Fix test_config unit tests

* Final fix for tests

* Add integration for auth

- Add auth server for testing
- Add test for complete auth flow with mock on OAuth callback
- Add test for custom client auth
- Add test for bearer auth token

* Add further test and update README

- Add OAuth metadata provider (no discovery)
- Update README with new auth badge

* Format fixes

* Remove redefined exception

* Add auth test on GH action

* Update docs with correct example

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>

* Update mcp_use/auth/oauth.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>

* Add custom callback port feature

- Add customizable port for callback
- Remove dynamic port
- Fix bug of registration before checking port

* Add GitHub MCP support

* Update docs

* chore: highlight hack

* chore: change wording in docs

* Add authlib on project dependencies

* Remove useless example

* Fix formatting as usual

---------

Signed-off-by: Vincenzo Reina <vincenzoreinaa05@gmail.com>
Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: renvins <vincenzoreinaa05@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-11 16:01:14 -07:00
Het Saraiya cf88404190 Enhance MCPAgent execution flow to track success status. Added logic to differentiate between successful agent completion and reaching maximum iterations, improving logging for both scenarios. (#254) 2025-09-01 18:56:23 -07:00
lorenss 3179aa6c86 Fix subprocess cleanup for multiple MCP clients (#231)
* init

* add logging callback

* cleaner shutdown of multiple clients

* linting

* do not clear manager and fix stop for http error

* http fallback change

* Update mcp_use/connectors/http.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: lorenss <31991968+lorenss-m@users.noreply.github.com>

---------

Signed-off-by: lorenss <31991968+lorenss-m@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-26 22:26:36 -07:00
Pietro Zullo b0e9a7c04e feat: abstracted server manager and allow to pass one (#240) 2025-08-17 17:19:46 -07:00
Vincenzo Reina 9669744c10 Add LLMs logging reasoning (#226) 2025-08-17 16:38:02 -07:00
Luigi Pederzani 8083df73df Feat: Add observability system with callback management for MCP agents (#238)
* improve logging

* import logging first

* make callback functions for observability + observability manager for mcp agent

* improve runner callbacks logic

* use laminar auto instrumentation + remove opentelemetry callbacks from laminar
2025-08-18 01:22:57 +02:00
Pietro Zullo 7a952a0c4d feat: expose chat creation (#239)
* feat: update chat creation requirement

* fix: correct doctrings
2025-08-17 14:16:18 -07:00
Pietro Zullo 1d40f3f9cd feat: starter CLI (#235)
* cliv1

* fix: prevent dashes in project name
2025-08-17 14:01:33 -07:00
pietrozullo d70dd27640 fix: rename variable 2025-08-15 13:48:48 -07:00
pietrozullo 56ea505162 feat: retry on errors when calling tool that do not belong to the tool itself. for instance, validation errors of their inputs 2025-08-15 13:44:41 -07:00
pietrozullo e907370763 fix: global logging enabled 2025-08-12 10:31:28 -07:00
pietrozullo 75fefdfacd Remote agent execution creation 2025-08-10 16:18:05 -07:00
Pietro Zullo 0c6c7663d3 chore: cleanup (#225)
* Honor deprecation

* Better handling of access methods when method is not supported by server
2025-08-10 11:48:55 -07:00
Pietro Zullo 2a165e7379 feat: notification & logging (#223)
* Add message handler function

* Notification test

* feat: logging callback

* Separate logging tests

* Documentation

* Remove duplicate

* rename notidfication test

* Discovery - client reacts to tools,resources,prompts update notifications

* integration test

* unit tests

* Fix, remove asyncio task creation, if we do not cache the tools it is not necessary to refresh. I wonder if it caching them tools (etc) is any important for somebody

* Fix type names in the docs
2025-08-10 10:27:20 -07:00
Pietro Zullo 01f8069269 feat: improve client docs (#212)
* Clean up session/connector API

* Improved docs, pormpts resources and promts

* minor fixes
2025-08-09 17:01:42 -07:00
Vincenzo Reina e0face5986 feat: Improve error handling (#215)
* Add error helper function

* Update error formatting for adapters

* Add custom args for error and add formatted in tools

* Add docs in error formatting and improve observability

* Fix and add more properties on adapters

* Fix on folder name, conflict with utils file

* Final fix for the utils problem

* Try to sort imports in correct order

* Add line at end of the error formatting file

* Fix with imports with ruff

* Fix also ruff formatting error
2025-08-07 12:50:14 -07:00
Kevin Montoya 540588624c fix: outdated create session from config functionality (#217)
remove import and details of undefined method
2025-08-06 11:25:57 -07:00
NandhuKishore24 6176392c09 feat: Implementing logic to create sessions only for the specified servers. (#209)
* Adding logic to create sessions for selected servers

* Add empty line in the end

* Add empty line in the end
fixed lint issues and changed inline comment
2025-08-03 17:58:42 -07:00
Pietro Zullo 6e0e7e010b feat: Structured output for remote agent (#210) 2025-08-03 17:55:23 -07:00
pietrozullo 902f82efd4 remote agent execution v1 2025-08-02 13:45:19 -07:00
Pietro Zullo 0f60da81a4 Feat: structured output (#203)
* mcpagent structured output

* Structured output example

* docs

* fix stream example and ensure it works
2025-07-31 21:48:59 -07:00
Pietro Zullo 506d252d94 Feat: server manager use tool deprecation (#198)
* Remove use tool from server tool

* Update server manager template

* Update docs
2025-07-27 16:11:22 -07:00
qwtsc 9d4f1a92d4 fix: add timeout config in http connector (#185)
* fix: add timeout config

* feat: bump up mcp sdk version to support http connector timeout args
2025-07-23 14:15:57 -07:00
NandhuKishore24 c3f03f404f Retrieved the list of tools used post agent execution (#184)
* Fixing Disallowed tool issue  #62

* Retrieve tools used by agent
2025-07-23 14:13:08 -07:00
qwtsc 1cec6e685f feat: add timeout seconds args option when calling tool (#178)
* feat: add timeout seconds args option when calling tool

* fix: unit test fix
2025-07-19 11:32:12 -07:00
Pietro Zullo 1736e31388 Feat: elicitation (#175)
* Elicitation Client Implementation

* Elicitation test

* Elicitation Documentation

* Docs elictiation fn params

* Bump fastmcp

* Add elicitation to constructors of client

* fix tests
2025-07-17 23:59:38 -07:00
Simba Khadder 78a1c3c0d0 Add sampling to MCPClient constructors (#171) 2025-07-17 23:39:53 -07:00
Pietro Zullo 7250b77c5b feat: Sampling (#170)
* Removed unused _setup_client

* Implement sampling in client and connectors

* Tests

* Nicer names in action

* Update previous tests

* Docstrings

* Fixed naming and created other primitives tests

* Supported features table

* docs
2025-07-12 15:00:34 -07:00
Pietro Zullo b914aa8fc6 Gracefully allow server to error on missing resources/prompts/tools endpoints even if declared (#169) 2025-07-12 11:44:13 -07:00
pietrozullo 864cad8822 fix inexistent variables that shadow errors 2025-07-06 21:23:37 -07:00
Pietro Zullo 44127f8101 remove double init in http connections (#161) 2025-07-06 20:56:11 -07:00
Pietro Zullo e6295ab1f3 fix: Renamed client to client session, fixed bug (#160)
* Renamed client to client session, fixed bug

* Fixed resource access typing
2025-07-06 17:53:26 -07:00
pietrozullo 11fb180e7a fix ensure logic 2025-07-06 17:28:16 -07:00