Commit Graph

380 Commits

Author SHA1 Message Date
Pietro Zullo c7773455e6 fix(python/server): update inspector CDN path and add error fallback (#773)
* fix(python/server): update inspector CDN path and add error fallback

- Change CDN path from /dist/client to /dist/web
- Add error page fallback when CDN fails to prevent redirect loops

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(python/server): update inspector CDN path and add error handling

- Change CDN path from /dist/client to /dist/web
- Add logging for CDN fetch failures with exception details
- Add error page fallback when CDN fails to prevent redirect loops

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 16:50:43 +01:00
Kinda Hall 85fcc8ec2c fix: 🐛 Fix the return type of the stream_events function (#738)
* fix: 🐛 Fix the return type of the stream_events function

* fix: 🐛 Update return type of MCPAgent's asynchronous streaming interface to StreamEvent

* refactor: remove total response length tracking from MCPAgent's streaming response

---------

Co-authored-by: pietrozullo <pietro.zullo@gmail.com>
2026-01-08 11:03:39 +01:00
Enrico Toniato 8a2e84e1ca Canary (#669)
* chore/typescript/package visibility (#654)

* cli - update

* create-mcp-use-app - update

* inspector - update

* mcp-use - update

* canary-changeset

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* Fix mcp agent prompts (#655)

* Refactor: Include resources and prompts in agent tool creation

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Add support for MCP resources and prompts

This commit introduces the ability to load and convert MCP resources and prompts into tools. The `BaseAdapter` now includes abstract methods `convertResource` and `convertPrompt`, and concrete implementations are provided in `LangChainAdapter`. The `MCPAgent` and `ServerManager` have been updated to utilize these new functionalities, allowing agents to leverage a broader range of MCP capabilities beyond just tools.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor(langchain_adapter): default all MCP prompt arguments to string type

Updated the LangChainAdapter to ensure that all MCP prompt arguments default to string type due to the absence of type definitions in the Prompt specification. This change simplifies the argument handling and enhances type safety in the schema generation process.

* fix: ruff lint

* fix: streamline server connection message formatting

Removed unnecessary line breaks in the connection message for improved readability. The message now presents a more concise format while maintaining clarity about the number of available tools, resources, and prompts after connecting to the MCP server.

* chore: update TypeScript preview package publishing command to use pnpm flag

Modified the GitHub Actions workflow for TypeScript PR previews to include the `--pnpm` flag in the package publishing command, ensuring compatibility with the pnpm package manager.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>

* chore(typescript): version packages (canary)

* feat(mcp-use): enhance session management with HEAD request support a… (#659)

* feat(mcp-use): enhance session management with HEAD request support and idle cleanup improvements

- Added handling for HEAD requests in the mountMcp function to support keep-alive and health checks.
- Updated the startIdleCleanup function to close associated transports during session cleanup, preventing errors on reconnection with expired session IDs.
- Enhanced documentation to clarify the new behavior and parameters for idle cleanup.

* feat(telemetry): enhance telemetry tracking and browser support

- Added support for browser environments in the Telemetry class, including dynamic imports of posthog-js for event tracking.
- Introduced new events: ClientAddServerEvent and ClientRemoveServerEvent for better server management tracking.
- Improved telemetry source management and user identification methods for both Node.js and browser contexts.
- Refactored existing methods for better clarity and maintainability, including the initialization of PostHog clients based on the runtime environment.
- Updated event capturing logic to handle both Node.js and browser clients effectively.

* chore(typescript): version packages (canary)

* Docs/agent/refactor (#658)

* chore(ci): enhance TypeScript workflow with matrix strategy for Node.js versions

- Updated the CI workflow to implement a matrix strategy for TypeScript jobs, allowing tests to run on Node.js versions 18, 20, and 22.
- Adjusted Node.js setup steps to dynamically use the specified version from the matrix.
- Renamed job names to reflect the Node.js version being used for better clarity in CI logs.

* feat(mcp-use): add CommonJS support and examples

- Updated package.json to include CommonJS exports for all modules, allowing compatibility with projects using require() syntax.
- Introduced a new CommonJS example demonstrating MCPClient usage with detailed instructions and environment requirements.
- Added a markdown file documenting CommonJS usage, highlighting key features and providing usage examples.
- Implemented a CommonJS compatibility test to ensure proper functionality when using require() syntax across various modules.
- Adjusted Node.js engine requirement in package.json to support Node.js 18.0.0 or higher.

* feat(docs): update TypeScript client documentation and structure

- Added new pages for agent and client configuration, environments, and server manager in the documentation.
- Updated existing documentation to reflect changes in the client structure and features, including the removal of deprecated sections.
- Enhanced the `docs.json` file to include new and updated pages for better navigation.
- Improved clarity in the client configuration and authentication sections, ensuring users have access to the latest information and examples.

* feat(cli): introduce mcp-use CLI client with comprehensive documentation and command support

- Added a new CLI client for interacting with MCP servers directly from the terminal, allowing users to execute commands without writing code.
- Included detailed documentation for installation, usage, troubleshooting, and examples to facilitate user onboarding.
- Implemented various commands for session management, tool interaction, and resource handling, enhancing the CLI's functionality.
- Integrated testing framework with unit and integration tests to ensure reliability and performance of the CLI commands.
- Updated package dependencies and configurations to support the new CLI features.

* feat: remove WebSocket transport support and update related components

- Eliminated WebSocket transport from the mcp-use library, including the removal of WebSocketConnector and related references in various components.
- Updated connection validation to support only HTTP and SSE protocols.
- Adjusted documentation and comments to reflect the removal of WebSocket support, ensuring clarity for users.
- Introduced a new method in MCPSession to list available tools, enhancing functionality.

* feat: enhance documentation and update CLI package for CommonJS support

- Added a CodeSandbox link to the TypeScript client documentation for interactive examples.
- Updated package.json to set the CLI as a module and changed the output file to CommonJS format.
- Modified integration tests to reflect the new CommonJS output path.
- Configured the Logger class to include console transports for improved logging visibility.

* chore: require node 20

* chore: update CLI package dependencies to latest versions

- Upgraded @vitejs/plugin-react from ^4.3.4 to ^5.1.1.
- Upgraded chokidar from ^3.6.0 to ^5.0.0.

* chore: update pnpm-lock.yaml to include React and related dependencies

- Added React, ReactDOM, and React Router DOM with specified versions to the pnpm-lock.yaml file.
- Removed duplicate entries for these packages to streamline the dependency list.

---------

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* chore(typescript): version packages (canary)

* chore(typescript): version packages (canary)

* refactor(docs): update agent documentation and structure (#667)

* refactor(docs): update agent documentation and structure

- Revised the agent configuration documentation to reflect changes in LLM integration and memory management.
- Enhanced the `docs.json` file to include new and updated pages for better navigation.
- Removed the interactive chat patterns documentation as it is now integrated into the memory management section.
- Updated icons and descriptions across various documentation files for consistency and clarity.
- Introduced simplified mode support in the MCPAgent, allowing for easier configuration with string-based LLM specifications.
- Improved examples and added new sections for structured output and streaming capabilities.

* feat(api): remove Simplified MCPAgent API documentation

- Deleted the `SIMPLIFIED_AGENT_API.md` file, which contained the documentation for the simplified MCPAgent API.
- This change reflects the removal of the simplified mode documentation as part of the ongoing refactoring and consolidation of agent-related resources.

* feat(docs): update agent documentation and examples for new run options

* Fix TypeScript compilation errors

- Change MCPClient import from type-only to regular import (used as value)
- Remove async generator markers from overload signatures
- Fix boolean type assignments by adding ?? true fallback
- Fix LanguageModel import in llm_provider.ts
- Add re-exports for backward compatibility
- Remove unused eslint-disable directives

* Fix inspector build: Add node:stream stub for browser compatibility

- Add stream.js stub with PassThrough, Readable, Writable, Transform, Duplex classes
- External node:stream, node:process, child_process, fs, os in Vite build
- Prevents bundling Node.js-only modules in browser build

* chore(typescript): version packages (canary)

* feat(inspector): enhance Vite configuration and add path parsing utility (#670)

- Updated Vite configuration to include more specific aliases for Node.js modules, improving compatibility with browser builds.
- Modified widget URL construction in OpenAIComponentRenderer to remove unnecessary query parameters.
- Added a new `parse` function to the path stub, enabling path string parsing into an object with root, dir, base, ext, and name properties.
- Excluded additional Node.js-only packages from the build process to streamline dependencies.

* feat(inspector): improve favicon fetching logic in ServerIcon component (#672)

- Introduced a new utility function `getBaseDomain` to simplify domain extraction.
- Updated favicon fetching logic to handle response as JSON and cache images more effectively.
- Enhanced error handling and logging for better debugging during favicon retrieval.
- Removed commented-out code for cleaner implementation.

* feat(session): update callTool method to default args to an empty object and add requireSession method for session retrieval (#671)

* chore(typescript): version packages (canary)

* feat(cli, mcp-use): enhance Tailwind CSS configuration to include mcp-use package resources (#673)

- Updated CSS generation to dynamically calculate the relative path to the mcp-use package.
- Modified Tailwind CSS configuration to scan both the resources directory and the mcp-use package for TypeScript and JavaScript files.

* chore(typescript): version packages (canary)

* fix: drop react-router-dom in favor of react-router (#675)

* chore(typescript): version packages (canary)

* typescript release workflow pushes tags and releases (#676)

* fix release action

* Fix/server/enhance (#677)

* feat(mcp-use): add favicon support for MCP server and widgets

- Introduced a favicon configuration option in the MCPServer class to allow custom favicon paths.
- Implemented favicon route setup in the server to serve the favicon at the root URL.
- Updated documentation to include examples for configuring favicons in server setup.
- Cleaned up widget directories on file deletions to maintain a tidy development environment.

* feat(mcp-use): enhance widget data handling and metadata extraction

- Updated OpenAIComponentRenderer to improve state management for tool input and output.
- Added extraction of widget properties from metadata for better integration with the MCP framework.
- Enhanced the useWidget hook to support tool input and output, including a pending state for tool execution.
- Modified WidgetData interface to include optional toolResponseMetadata for improved data handling.
- Updated server-side utilities to ensure consistent handling of widget props and tool output across the application.

* chore(typescript): version packages (canary)

* chore(mcp-use): update package version and add client entry in package.json (#679)

* chore(mcp-use): update package version and add client entry in package.json

- Bumped version from 1.11.0-canary.7 to 1.11.0-canary.9 in package.json.
- Added client entry point in package.json for improved module exports.
- Updated tsup.config.ts to include src/client.ts in the build process.

* chore(deploy): update deno.json to include specific mcp-use client and server imports

- Added specific imports for mcp-use client and server from the PR branch.
- Included zod library version 4 in the deno.json configuration for enhanced type validation.

* Session management (#682)

* feat(mcp-use): enhance session management and transport options

- Added a new "Session Management" group in the documentation for better organization.
- Introduced automatic session recovery for HTTP/SSE transports, allowing clients to handle server restarts seamlessly.
- Updated the transport type preference to deprecate the 'sse' option in favor of 'http' and 'auto', aligning with the MCP spec 2025-11-25.
- Implemented Redis session and stream managers for improved session persistence and management.
- Added new scale testing scripts to the package.json for performance evaluation.
- Updated various types and interfaces to support new session management features and ensure backward compatibility.

* feat(mcp-use): add convenience methods for notifying clients of changes

- Introduced convenience methods: `sendToolsListChanged`, `sendResourcesListChanged`, and `sendPromptsListChanged` to simplify client notifications when tools, resources, or prompts are dynamically added or removed.
- Updated documentation to include examples for notifying clients of changes in tools, resources, and prompts, enhancing clarity and usability.

* feat(mcp-use): implement auto-detection of session mode based on Accept header

- Enhanced session management by introducing auto-detection of stateful or stateless mode based on the client's Accept header.
- Updated documentation to reflect the new behavior, ensuring compatibility with various clients like k6 and curl while maintaining SSE support for capable clients.
- Modified request handling to adapt the server's response based on client capabilities, improving overall flexibility and usability.

* feat(mcp-use): improve client notification system and session handling

- Enhanced client notification methods for dynamic updates, including `sendToolsListChanged`, `sendResourcesListChanged`, and `sendPromptsListChanged`.
- Improved session management with automatic recovery for HTTP/SSE transports and updated documentation for clarity.
- Adjusted request handling to better support client capabilities and maintain backward compatibility.

* Delete libraries/typescript/packages/mcp-use/IMPLEMENTATION_SUMMARY.md

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Delete libraries/typescript/packages/mcp-use/REDIS_INTEGRATION_VERIFIED.md

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Delete libraries/typescript/packages/mcp-use/SCALE_TESTING_IMPLEMENTATION.md

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update ARCHITECTURE.md

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* feat(mcp-use): add Redis as an optional dependency and enhance Redis integration

- Added Redis as an optional dependency in package.json.
- Updated Redis session and stream managers to include error handling for unsupported Redis client methods.
- Introduced isRedisAvailable() function to check for Redis availability at runtime.
- Enhanced documentation to clarify Redis integration and installation instructions.

* feat(mcp-use): enhance session management with FileSystemSessionStore and auto-refresh capabilities

- Introduced FileSystemSessionStore for development environments, allowing session persistence across hot reloads.
- Added auto-refresh functionality for tools, resources, and prompts in the useMcp hook, triggered by relevant notifications.
- Updated documentation to reflect new session management architecture and usage examples.
- Improved LayoutHeader component with collapsible tabs for better UI experience.

* feat(docs): update session management documentation and add filesystem storage reference

- Added reference to new File System Storage in session management documentation, highlighting its use for development environments.
- Removed outdated comparison with other implementations from the documentation.
- Updated session management overview to include filesystem storage as a viable option for session persistence.
- Adjusted related documentation links to ensure consistency and clarity.

* refactor(docs): streamline Supabase deployment documentation and remove scale testing guide

- Updated the Supabase deployment documentation to use a local icon path for better resource management.
- Removed the scale testing guide as it was deemed unnecessary, simplifying the documentation structure.

* feat(ui): add collapsible tabs to LayoutHeader for improved navigation

- Introduced a CollapseButton component to toggle tab visibility in the LayoutHeader.
- Updated Tabs component to support collapsed state, enhancing user experience.
- Adjusted styles for smoother transitions and improved accessibility with tooltips.
- Refactored tab rendering logic to accommodate the new collapsible feature.

* refactor(tests): remove outdated Redis integration tests and related documentation

- Deleted manual integration tests for Redis session management and related README files to streamline the testing suite.
- Removed scale testing scripts and configuration files that were no longer necessary, simplifying the project structure.
- Updated the remaining test documentation to reflect the changes and ensure clarity for future testing efforts.

* feat(redis): enhance Redis client interface and session management

- Added support for Redis SET operations with sAdd, sRem, and sMembers methods in the RedisClient interface.
- Updated RedisSessionStore to utilize SET for tracking active sessions, improving performance and reducing blocking operations.
- Modified RedisStreamManager to manage active sessions using SET instead of KEYS, ensuring non-blocking behavior.
- Added warnings in documentation regarding the use of KEYS command in production environments.
- Enhanced session cleanup logic to include removal of active sessions from the SET.

---------

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* chore(typescript): version packages (canary)

* Fix/server/enhance (#678)

* feat(mcp-use): add favicon support for MCP server and widgets

- Introduced a favicon configuration option in the MCPServer class to allow custom favicon paths.
- Implemented favicon route setup in the server to serve the favicon at the root URL.
- Updated documentation to include examples for configuring favicons in server setup.
- Cleaned up widget directories on file deletions to maintain a tidy development environment.

* feat(mcp-use): enhance widget data handling and metadata extraction

- Updated OpenAIComponentRenderer to improve state management for tool input and output.
- Added extraction of widget properties from metadata for better integration with the MCP framework.
- Enhanced the useWidget hook to support tool input and output, including a pending state for tool execution.
- Modified WidgetData interface to include optional toolResponseMetadata for improved data handling.
- Updated server-side utilities to ensure consistent handling of widget props and tool output across the application.

* chore(mcp-use): update package version and add client entry in package.json

- Bumped version from 1.11.0-canary.7 to 1.11.0-canary.9 in package.json.
- Added client entry point in package.json for improved module exports.
- Updated tsup.config.ts to include src/client.ts in the build process.

---------

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update documentation links and clean up references

- Removed duplicate links in the agent configuration documentation.
- Updated the examples link in the CLI documentation to point to the correct server examples.
- Corrected the Tools guide link in the tools documentation to ensure proper navigation.
- Adjusted the Building Agents link in the useMCP documentation to reflect the new path in the advanced section.

* Refactor RedisStreamManager to remove unnecessary whitespace and improve code readability in session cleanup logic.

* Update API key masking in whoamiCommand to show first 6 characters instead of 8, enhancing security and clarity in output.

* Refactor URL handling and UUID generation for improved readability in git and telemetry utilities. (#686)

* Refactor URL handling and UUID generation for improved readability in git and telemetry utilities.

* Enhance TypeScript library with new features and documentation updates

- Moved `@langchain/core` and `langchain` to optional peer dependencies.
- Removed WebSocket transport; recommended using streamable HTTP or SSE.
- Introduced session management architecture with Redis support.
- Added favicon configuration for widget pages and improved caching.
- Implemented dedicated CLI client support for better command-line integration.
- Enhanced session methods and fixed transport cleanup for idle sessions.
- Updated documentation with links for better navigation and learning resources.

* Enhance session management and improve documentation clarity (#687)

- Refactored session management architecture to streamline Redis integration.
- Updated documentation for better navigation and added new examples.
- Improved clarity in output by adjusting API key masking in whoamiCommand.
- Cleaned up code for better readability and maintainability.

* chore(typescript): version packages (canary)

* Enhance TypeScript release workflow by ensuring the latest commits are fetched and tags are pushed correctly.

- Added steps to fetch the latest commits and tags before tagging and publishing.
- Improved reliability of the release process by ensuring the correct branch is checked out and up-to-date.

* Refactor CI workflows for TypeScript and Deno testing

- Removed the temporary disabled `typescript-deno-test` job from the CI workflow.
- Enhanced the `typescript-pr-preview` workflow by adding a step to retrieve the PR number and create a temporary `deno.json` for testing.
- Implemented a wait mechanism to ensure the preview package is available on esm.sh before running Deno tests.
- Updated changeset versions for several packages from patch to minor.

* Remove outdated documentation files for building custom agents, logging, and multi-server setup in TypeScript. Update links in related documents to reflect the new structure and ensure consistency in navigation.

* Update streaming and code mode documentation with enhanced examples and video content. Removed outdated sections to improve clarity and user experience.

* Update TypeScript documentation to reflect changes in streaming methods and authentication. Removed outdated sections in streaming.mdx, streamlined examples in structured-output.mdx, and updated OAuth version in authentication.mdx for clarity and accuracy.

* Fix cli import (#689)

* fix: update imports to use mcp-use/client for better dependency management

* Refactor Deno tests for MCPServer to utilize Zod for input validation and streamline response handling. Updated deno.json to include new dependencies and improved import paths for better module resolution.

* Refactor Zod import in Deno tests and remove outdated dependency from deno.json for improved module resolution.

* Update Zod import syntax and upgrade Zod version in Deno test files for improved compatibility and module resolution.

* Enhance TypeScript PR preview workflow by adding Zod as a dependency for improved validation and module resolution.

* Update TypeScript PR preview workflow to include `?no-dts` in mcp-use imports and modify Deno test command to skip type checking for improved testing efficiency.

* chore(typescript): version packages (canary)

* chore(typescript): update dependencies and improve package configurations (#690)

* chore(typescript): update dependencies and improve package configurations

- Bump versions for several dependencies including ESLint, TypeScript, and various React-related packages.
- Update `vite` and `tailwindcss` to the latest versions for improved performance and features.
- Enhance `zod` version for better validation capabilities.
- Remove outdated `pnpm-lock.yaml` file from the React example client.
- Adjust package configurations across multiple packages for consistency and compatibility.

* chore(typescript): update package specifiers and versions in pnpm-lock.yaml

- Adjusted version specifiers for several dependencies, including React and Zod, to ensure compatibility and flexibility.
- Updated the version of `@langchain/core` and related packages to the latest stable release.
- Removed outdated entries and improved overall package configuration for better dependency management.

* chore(typescript): version packages (canary)

* Update TypeScript logging documentation to change "Next Steps" section to "Related" and adjust links for improved clarity and navigation.

* Remove changeset for "many-rocks-joke" from TypeScript library updates.

* Remove ServerDetail component and simplify user ID generation in telemetry

* chore: changeset

* chore(typescript): version packages (canary)

* Update deploy script to use latest MCP_USE_VERSION and switch import paths to npm for mcp-use and zod dependencies.

* Add blog link to navbar and include logo href in documentation

* Enhance logo display in documentation by adding noZoom attribute to images for better responsiveness.

* Update changelog for v1.11.0 release, introducing distributed session management, a new CLI client, and various enhancements and fixes across features, documentation, and testing.

* Update changelog for v1.10.0 release, highlighting API improvements, breaking changes, new features, and various enhancements and fixes related to session management and resource templates.

* Update pnpm-lock.yaml and package.json for dependency management; remove outdated example files and enhance CLI documentation.

* Refactor MCP agent examples to use updated import paths and LLM configurations; replace deprecated imports and streamline server management examples for better clarity and functionality.

* Update TypeScript configuration to use 'bundler' for module resolution and clarify MCPClient instantiation in shared-utils-browser.ts for better browser compatibility.

* Refactor TypeScript configuration to improve module resolution and enhance browser compatibility in shared-utils-browser.ts.

* Refactor pnpm-lock.yaml to reorganize example paths and update dependency links for improved project structure and consistency across server features.

* chore(typescript): version packages (canary)

* fix: inspector import

* chore(typescript): version packages (canary)

* improve deploy on supabase docs

* refactor(telemetry): enhance telemetry initialization and user ID management

- Updated the Telemetry class to improve initialization of Scarf telemetry, ensuring it only runs in server-side environments to avoid CORS issues.
- Enhanced user ID generation with fallback mechanisms for both session-based and persistent storage scenarios, improving reliability across different runtime environments.
- Refactored user ID retrieval from the filesystem to handle errors gracefully and ensure consistent behavior in various contexts.
- Improved telemetry event tracking by including runtime environment metadata, enhancing observability and debugging capabilities.

* changeset

* fix: inspector autoconnect

* fix: update conformance workflow paths for TypeScript examples

* format

* refactor(InspectorDashboard): remove debug logging and clean up code

- Removed console warning for logging connections on every render to reduce noise in the console.
- Updated GitHub icon component to use camelCase for SVG attributes, ensuring consistency with React conventions.

* fix(deploy.sh): update import paths to use ESM and enhance CSP URLs for Supabase deployment

* feat(ui-resource-registration): enhance tool definition handling with Zod schema support and legacy input conversion

* chore(typescript): version packages (canary)

* chore(typescript): version packages (canary)

* refactor(widget-metadata): update handling of Zod schemas to preserve full schema objects and improve backward compatibility

* chore(typescript): version packages (canary)

* fix: inspector rpc logs

* chore(typescript): version packages (canary)

* Potential fix for code scanning alert no. 53: Insecure randomness

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* refactor(widget-metadata): correct handling of props and inputs in widget metadata

* fix(telemetry): remove unnecessary whitespace in secureRandomString function

* chore(typescript): version packages (canary)

* docs

* fix(tests): update pattern replacement to handle all asterisks in session store and stream manager tests

* fix(telemetry): use secureRandomString for userId generation fallback

* chore(typescript): version packages (canary)

---------

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>
Co-authored-by: pietrozullo <pietro.zullo@gmail.com>
Co-authored-by: pederzh <luigipederzani@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-16 17:18:22 +01:00
pietrozullo 1055cabe72 remove useless files 2025-12-15 18:15:09 +01:00
pietrozullo 7193483261 release/python1.5.1 2025-12-15 15:40:07 +01:00
Pietro Zullo 5fbae7714c fix(python): tool output persistency (#688)
* fix tool output in agent.stream, agent.run

* fix tool history in stream_events

* fix tool history in stream_events

* tests

* fix
2025-12-15 15:16:36 +01:00
Salvatore Gabriele Karra 39e85c8c25 feat(python): pass files to agent (prompt_files) (#428)
* feat(python): accept HumanMessage queries and move file input into messages

* use image as example

* restore remote.py

Signed-off-by: Salvatore Gabriele Karra <86735558+gabrielekarra@users.noreply.github.com>

* lint

* fix example in docs - create example

* update docs

* remove tests

---------

Signed-off-by: Salvatore Gabriele Karra <86735558+gabrielekarra@users.noreply.github.com>
Co-authored-by: pietrozullo <pietro.zullo@gmail.com>
2025-12-15 14:58:21 +01:00
pietrozullo bac549064f chore: server in readme 2025-12-15 13:19:08 +01:00
Vincenzo Reina b56fd763fb feat: improve stdio error handling (#631) 2025-12-13 09:03:58 +01:00
Pietro Zullo d3c57f6546 python: refactor release actions (#668)
* refactor release actions

* draft release

* publish pre release draft notes

* check if python release exists

* test on current branch

* release script

* empty commit

* test file

* format

* remove test file

* attempt forking action

* test file

* fix

* test commit

* Better workflow

* test commit
2025-12-12 11:51:01 +01:00
Pietro Zullo ebef017114 python/server/middleware&tel (#650)
* chore: add example server pretty print JSON RPC for transparency

* updated telemetry module

* chore: agent side tel - langchain adapter - client tel

* server side tel:

* update API reference

* python transports and primitive reports are publishes only if not skipped

* remove wrongly generate files

* properly typed middleware

* remove examples

* feat(docs): add middleware and session management documentation

- Introduced new documentation for middleware, detailing hooks, minimal examples, and best practices for integrating middleware in MCP servers.
- Added a session management guide explaining session ID handling, usage patterns, and examples for managing per-client state in MCP servers.
- Updated  to include links to the new middleware and session management pages.

* generate docs

* remove few events

* adapter tel

* adapter tel

* api ref docs update

* google adapter fix

* fix version

* fix event naming

* server example is streamable and echo tool fix

* removed initialize middleware hook, initialize requests are not passed thorugh normal handlers

* api ref

* beta on middleware
2025-12-10 17:02:08 +01:00
Arya Soni 3c564e285c Bug: Deprecation Version Mismatch (#613) 2025-12-03 14:56:13 +01:00
Vincenzo Reina 2a29bac201 fix: Task manager and resource cleanup errors (#611)
* fix: Catch CancelledError on event wait

* fix: Track connection manager existence to avoid errors

* fix: formatting

---------

Co-authored-by: pietrozullo <pietro.zullo@gmail.com>
2025-12-03 14:50:59 +01:00
Enrico Toniato 4fc04a9ffc Canary (#607)
* feat: add MCP Conformance Test Servers for Python and TypeScript (#605)

* chore(deps): bump express from 5.1.0 to 5.2.0 in /libraries/typescript (#602)

* chore(deps): bump express from 5.1.0 to 5.2.0 in /libraries/typescript

Bumps [express](https://github.com/expressjs/express) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 5.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: add changeset for dependabot updates

* Delete libraries/typescript/.changeset/dependabot-e19bd45.md

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* chore: add changeset for dependabot updates

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* feat: add MCP Conformance Test Servers for Python and TypeScript

- Introduced a new GitHub Actions workflow for running conformance tests on both Python and TypeScript servers.
- Implemented a Python conformance server that supports various MCP features and tools.
- Developed a TypeScript conformance server with similar functionality, including tools and resources.
- Added necessary configuration files for TypeScript server setup, including package.json and tsconfig.json.
- Updated pnpm-lock.yaml to include dependencies for the new conformance server.

This commit enhances the testing framework by providing dedicated servers for conformance testing, ensuring better validation of MCP features.

* feat: enhance conformance workflow with conditional inputs

- Added workflow_dispatch inputs to allow running only Python or TypeScript conformance tests.
- Updated job conditions to skip unnecessary tests based on the selected input.
- Modified the conformance summary job to ensure it does not run if cancelled.

This update improves flexibility in running conformance tests, enabling targeted testing based on user input.

* feat: add PR comment with conformance results and remove ext-apps

* feat: show individual test results as columns in PR comment

* feat: simplify conformance PR comment table

* feat: add conformance comparison with main and canary branches

- Fix test name parsing to remove ': X passed, Y failed' suffix
- Fetch baseline results from main and canary branches
- Show comparison columns (vs Main, vs Canary) with color-coded indicators
- Show +1/-1 on individual tests that changed from baseline
- Use 🟢 for improvements, 🔴 for regressions, ⚪ for no change, 🆕 for new

* feat: prevent test name line breaks and add MCP icon

- Use non-breaking hyphens (&#8209;) in test headers to prevent wrapping
- Replace microscope emoji with MCP SVG icon in PR comments

* fix: use picture element for MCP icon with dark/light mode support

* feat: display MCP icon inline with heading with gap

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* Feature/mcp 924 implement tool elicitation support in typescript sdk tools (#606)

* chore(deps): bump express from 5.1.0 to 5.2.0 in /libraries/typescript (#602)

* chore(deps): bump express from 5.1.0 to 5.2.0 in /libraries/typescript

Bumps [express](https://github.com/expressjs/express) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 5.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: add changeset for dependabot updates

* Delete libraries/typescript/.changeset/dependabot-e19bd45.md

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* chore: add changeset for dependabot updates

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* chore: enter canary prerelease mode

* feat(docs): add elicitation feature documentation and update client structure

- Introduced new documentation for the elicitation feature, detailing both form and URL modes for user input requests.
- Updated `docs.json` to include a new page for elicitation.
- Enhanced the `MCPClient` and related connectors to support elicitation callbacks, allowing servers to request additional user information.
- Implemented elicitation handling in various connectors (HTTP, Stdio) and updated the server context to support elicitation requests.
- Added examples for using elicitation in React components and TypeScript.

* feat: enhance elicitation feature documentation and server-side validation

- Updated documentation to clarify server-side validation with mcp-use when using Zod schemas.
- Added custom error types for elicitation validation in the mcp-use library.
- Improved MCPClient to support elicitation callbacks for better user interaction.
- Refactored elicitation ID generation to use UUID for uniqueness.
- Enhanced error handling in the server to throw specific validation errors.

* feat: add Zod dependency and implement elicitation tool in conformance server

- Updated .gitignore to exclude conformance test results.
- Added Zod as a dependency in the conformance package.
- Implemented a new elicitation tool in the conformance server, allowing for user input with validation using Zod schemas.
- Updated server feature list to include the new elicitation tool.

* feat: add elicitation tool with default values in conformance server

- Introduced a new elicitation tool that utilizes default values for various primitive types as per SEP-1034.
- Enhanced the server's ability to handle user input with validation using Zod schemas.
- Updated the server feature list to include the new elicitation tool.

* fix: resolve pre.json conflict with canary - accept newer versions

* chore: remove ELICITATION_IMPLEMENTATION.md and ext-apps from tracking

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore(typescript): version packages (canary)

* fix: update elicitation example server paths and enhance documentation (#608)

- Updated paths in documentation and examples to reflect the new `examples/server/elicitation/` structure, replacing the previous `examples/server/elicitation-test/`.
- Enhanced the elicitation feature documentation to clarify usage and examples.
- Removed deprecated example files related to the old elicitation test structure.

* chore(typescript): version packages (canary)

* chore(typescript): update package versions to patch for mcp-use and inspector

* Fix/server/json response (#609)

* feat: update dependencies and enhance server functionality

- Added new dependencies '@openai/apps-sdk-ui' and '@tanstack/react-query' to the starter template and test app.
- Updated the pnpm-lock.yaml to reflect the new dependencies and their versions.
- Modified mcp-server.ts to enable JSON response for SSE streaming.
- Refactored createExternalUrlResource, createRawHtmlResource, and createRemoteDomResource functions to return promises for better async handling.

* refactor: update create-mcp-use-app package to use React and Ink components

- Changed the build script to compile TypeScript files with JSX support.
- Replaced Inquirer with Ink components for interactive CLI prompts.
- Removed the old index.ts file, transitioning to a more modern React-based approach.
- Updated package dependencies to include React and Ink, ensuring compatibility with the new structure.
- Enhanced the TypeScript configuration to support JSX.

* chore(typescript): version packages (canary)

* chore(typescript): update mcp-use and inspector versions to minor for elicitation support

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-02 18:14:53 +01:00
pietrozullo 67041ca575 python/release-1.5.0 2025-12-01 16:44:20 +01:00
Pietro Zullo be9942a4d4 feat/python/server (#559)
* feat: server first implementation

* docs: docs for server and images

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

* python/release/1.3.13

* catch uvicorn logs && log session id

* fix debug logic

* docs: logging update

* fix: icon of elicitation

* fix installation paths for local clones

* docs: minor restructuring

* docs: reorganization, killed non existing pages

* docs: beta tag on server

* chore: example servers

* feat: inspector autopopulated and client only

* feat: enhance MCP logging system with customizable formats and improved middleware

* feat: implement weather alert and forecast tools in FastMCP example server

* mcp path configurable

* fix inspector

* export as FastMCP too

* chore: update fastmcp migration example

* lock inspector version

* type runner

* unhide docs and remove dangers

* migration diff

* docs and context example

* export context

* logging improvement

* pretty JSON RPC

* autoConnect url param in inspecotr

* move logging

* type check

* Server Router

* show response logs

* fallback tool name to function name in router registration

* compatibility export

* Introduced ty and prek as type checker and precommit engine respectively - moved ruff config in pyproject toml

* add ty check

* ty runs only on staged files

* ty configuration fix

* move startup info in logging

* remove bug from action

* update claude rules

* fix resource serialization

* comments on inspector errors

* abstracted runner transports

* remove redunant call for network

* fix ip getter

* add inspector mcp path

* response limit logging

* disable ty check in action

* moved transport type to types

* support sse

* show transport type in logs

* change default transport

* refactored tests to use mcp server

* removed fastmcp

* file restructuring

* test table

* sampling, elicitation, tool disabling enabling

* deprecte sse server side

* simplified report

* fix action

* remove sse deprecated test

* move tests files to allow for server integration tests

* docs

* reorg integration test files

* api-reference-doxs

* fix broken links

* telemetry

* remove feature useage from scarf
2025-12-01 14:12:16 +01:00
Pietro Zullo 9e592b4071 chore(python): dependencies (#531)
* removed useless anyio and aiohttp dependency

* version matrix in unit tests

* change test names

* fix weird import from langchain

* new deps

* bump fastembed minimal

* bump uvicorn, remove unused config for pytest

* add pre commit to dev deps

* remove transitive deps starlette and uvicorn

* test fix
2025-11-25 19:19:14 +01:00
pietrozullo babb6061b0 fix code mode tests 2025-11-25 09:37:59 +01:00
Vladimir Krasnoselskikh e76f5e7622 feat(python)(client): allow middleware to modify context params (#522)
* fix(python): Params modified by middleware are lost when calling call_tool

* Allow middleware to mutate request params (and replace context.params) and ensure those changes are passed to the underlying client session. Update CallbackClientSession/process_request to call the final client with the live MiddlewareContext so replacements are respected. Also update docs and examples.

---------

Co-authored-by: pietrozullo <pietro.zullo@gmail.com>
2025-11-25 08:31:56 +01:00
Enrico Toniato 266a445934 Canary (#524)
* chore: enter canary prerelease mode

* Improve search tool response structure (#508)

* Refactor search_tools to return metadata and results

Co-authored-by: tonxipad <tonxipad@gmail.com>

* docs: update API documentation

* feat: enhance search_tools display and filtering capabilities

- Introduced a new function to format search_tools results as a tree structure, including metadata such as total tools and namespaces.
- Updated the display logic to handle both new and old formats of search_tools results for backward compatibility.
- Enhanced filtering in MCPClient and CodeExecutor to include server name in search criteria, improving tool discoverability.

* format

* docs: update code-mode documentation to reflect changes in search_tools response structure

- Modified examples to use the new response format from search_tools, which includes metadata and results.
- Enhanced clarity in code snippets by adding print statements for tool discovery results.
- Updated TypeScript and Python documentation to ensure consistency across both languages.

* refactor: clean up whitespace in display.py for improved readability

- Removed unnecessary blank lines throughout the _format_search_tools_as_tree function to enhance code clarity and maintainability.
- Ensured consistent formatting in the display logic for better visual structure.

* refactor: streamline line wrapping in display.py for improved readability

- Consolidated parameters in the text wrapping function to enhance code clarity and maintainability.

* feat: enhance search_tools metadata for improved context

- Updated search_tools to return additional metadata (total_tools, namespaces, result_count) alongside results, enhancing the context for model decision-making.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>

* chore(typescript): version packages (canary)

* feat: Integrate official UI components in templates and enhance widget development experience (#517)

* feat: Add ecommerce widgets and OpenAI Apps SDK UI components

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Update MCP app templates and resources

- Added new fruit images to the public directory for enhanced visual content.
- Removed outdated weather and ecommerce carousel components to streamline the codebase.
- Updated the product search result component to utilize new UI components and improved error handling.
- Modified package dependencies to include react-router and updated @openai/apps-sdk-ui version.
- Enhanced the .gitignore file to include .mcp-use for better project management.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Introduce new lockfile and update dependencies

- Added a new bun.lock file to manage package dependencies for the TypeScript project.
- Updated pnpm-lock.yaml to include new dependencies such as @openai/apps-sdk-ui and react-router.
- Enhanced the CLI tool to support aborting fetch requests and improved error handling in widget building.
- Replaced outdated image assets with PNG versions for better compatibility and removed unused JPG files.
- Introduced new ErrorBoundary and Image components to improve error handling and image loading in the MCP app.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Enhance Vite server configuration and update dependencies

- Added a new plugin to Vite for watching the resources directory, ensuring hot module replacement (HMR) works seamlessly when widget source files change.
- Updated pnpm-lock.yaml to include new dependencies such as @openai/apps-sdk-ui, react-router, and various development tools like @tailwindcss/vite and typescript.
- Improved the Vite server configuration to explicitly watch files outside the root directory, enhancing the development experience.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Implement carousel component for product search results

- Added a new CarouselItem component to enhance the visual presentation of fruit items in the product search results.
- Introduced dynamic pointer tracking for interactive hover effects on carousel items, improving user engagement.
- Updated styles for carousel items and their backgrounds to create a visually appealing blur effect.
- Refactored the ProductSearchResult component to utilize the new carousel structure and improve layout responsiveness.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Update ProductSearchResult and OpenAIComponentRenderer for theme support

- Added WidgetDebugger to the ProductSearchResult component for enhanced debugging capabilities.
- Updated the product search result text to reflect a new template and improved context for users.
- Enhanced OpenAIComponentRenderer to handle theme changes, ensuring the correct theme is applied when the iframe loads.
- Modified shared-utils to include theme information in WidgetData, allowing for better theme management across components.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Refactor ProductSearchResult component and enhance WidgetFullscreenWrapper

- Replaced ThemeProvider and BrowserRouter with McpUseProvider in the ProductSearchResult component for improved context management.
- Removed unused getBasename function to streamline routing logic.
- Updated WidgetFullscreenWrapper to support viewControls prop, allowing conditional rendering of fullscreen and picture-in-picture buttons.
- Enhanced overall structure and readability of the ProductSearchResult component.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Update dependencies and enhance component functionality

- Added `react-router-dom` as a dependency to support routing features.
- Updated `detect-libc` to version 2.1.2 for improved compatibility.
- Refactored various components for better readability and structure, including the `ProductSearchResult` and `OpenAIComponentRenderer`.
- Introduced new auto-sizing functionality in `McpUseProvider` to notify OpenAI about container height changes.
- Removed deprecated `WidgetDebugger` and `WidgetFullscreenWrapper` components to streamline the codebase.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Enhance OpenAIComponentRenderer and ToolResultDisplay for performance and readability

- Memoized component to prevent unnecessary re-renders in OpenAIComponentRenderer.
- Introduced new state management for iframe height notifications and improved height handling logic.
- Refactored ToolResultDisplay to utilize memoization for args and result, optimizing rendering performance.
- Cleaned up unused state variables and streamlined event handling for better maintainability.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Improve logging and code readability in various components

- Enhanced logging statements in OpenAIComponentRenderer, McpUseProvider, and WidgetControls for better debugging and clarity.
- Refactored memoization in ToolResultDisplay to improve performance and prevent unnecessary re-renders.
- Cleaned up code formatting for improved readability across multiple components.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Update ProductSearchResult and shared routes for improved development experience

- Modified the ProductSearchResult component to change the FAQ question and enhance the autosize feature description.
- Simplified asset loading in shared routes to directly fetch from the dev server, improving development efficiency.
- Enhanced security headers in shared-utils to include dev server origins for better handling of HMR scripts and resource loading.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Integrate @tanstack/react-query and enhance fruits API in apps-sdk template

- Added @tanstack/react-query as a dependency to improve data fetching capabilities.
- Implemented a new API endpoint in the apps-sdk template to serve a list of fruits with their respective colors.
- Removed the outdated ProductSearchResult component to streamline the codebase and focus on the new API integration.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Clean up code formatting and improve readability in product search result components

- Removed unnecessary blank lines in various TypeScript files to enhance code clarity.
- Simplified function parameters in CarouselItem component for better readability.
- Streamlined the Accordion and AccordionItem components by removing excess whitespace.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* change set

* chore: Remove bun.lock file to streamline dependency management

- Deleted the bun.lock file to eliminate potential conflicts and simplify the dependency resolution process in the project.

* feat: Update documentation and components for improved clarity and organization

- Added new pages for MCP UI resources and widget components in the documentation.
- Enhanced the migration guide to specify applicability for version 1.5.0 and later.
- Updated the ErrorBoundary component icon for better representation.
- Removed outdated template comparison section to streamline the templates documentation.

* fix: Correct indentation in documentation JSON for better readability

- Adjusted the indentation of the "apps-sdk-resources" entry in the documentation JSON to maintain consistent formatting.
- Removed unnecessary blank lines to enhance overall clarity in the documentation structure.

* chore: Update dependencies and clean up code for improved performance

- Updated react-router-dom to version 7.9.5 for enhanced functionality.
- Removed commented-out code in ProductSearchResult component to improve clarity.
- Cleaned up logging statements in OpenAIComponentRenderer for better debugging.
- Refactored height notification logic in McpUseProvider to optimize performance.
- Adjusted useWidget to avoid dependency issues with URL parameters.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* chore: Update dependencies and clean up code for improved performance

- Updated react-router-dom to version 7.9.5 for enhanced functionality.
- Removed commented-out code in ProductSearchResult component to improve clarity.
- Cleaned up logging statements in OpenAIComponentRenderer for better debugging.
- Refactored height notification logic in McpUseProvider to optimize performance.
- Adjusted useWidget to avoid dependency issues with URL parameters.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Clean up code formatting and improve readability in OpenAIComponentRenderer and useWidget

- Adjusted formatting of variable declarations for better consistency and readability.
- Simplified the handleError function in OpenAIComponentRenderer for clarity.
- Ensured consistent indentation in useWidget for improved code structure.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>

* chore(typescript): version packages (canary)

* feat: Add JSON-RPC message logging to Inspector tabs (MCP-536) (#519)

* feat: Add ecommerce widgets and OpenAI Apps SDK UI components

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Update MCP app templates and resources

- Added new fruit images to the public directory for enhanced visual content.
- Removed outdated weather and ecommerce carousel components to streamline the codebase.
- Updated the product search result component to utilize new UI components and improved error handling.
- Modified package dependencies to include react-router and updated @openai/apps-sdk-ui version.
- Enhanced the .gitignore file to include .mcp-use for better project management.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Introduce new lockfile and update dependencies

- Added a new bun.lock file to manage package dependencies for the TypeScript project.
- Updated pnpm-lock.yaml to include new dependencies such as @openai/apps-sdk-ui and react-router.
- Enhanced the CLI tool to support aborting fetch requests and improved error handling in widget building.
- Replaced outdated image assets with PNG versions for better compatibility and removed unused JPG files.
- Introduced new ErrorBoundary and Image components to improve error handling and image loading in the MCP app.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Enhance Vite server configuration and update dependencies

- Added a new plugin to Vite for watching the resources directory, ensuring hot module replacement (HMR) works seamlessly when widget source files change.
- Updated pnpm-lock.yaml to include new dependencies such as @openai/apps-sdk-ui, react-router, and various development tools like @tailwindcss/vite and typescript.
- Improved the Vite server configuration to explicitly watch files outside the root directory, enhancing the development experience.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Implement carousel component for product search results

- Added a new CarouselItem component to enhance the visual presentation of fruit items in the product search results.
- Introduced dynamic pointer tracking for interactive hover effects on carousel items, improving user engagement.
- Updated styles for carousel items and their backgrounds to create a visually appealing blur effect.
- Refactored the ProductSearchResult component to utilize the new carousel structure and improve layout responsiveness.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Update ProductSearchResult and OpenAIComponentRenderer for theme support

- Added WidgetDebugger to the ProductSearchResult component for enhanced debugging capabilities.
- Updated the product search result text to reflect a new template and improved context for users.
- Enhanced OpenAIComponentRenderer to handle theme changes, ensuring the correct theme is applied when the iframe loads.
- Modified shared-utils to include theme information in WidgetData, allowing for better theme management across components.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Refactor ProductSearchResult component and enhance WidgetFullscreenWrapper

- Replaced ThemeProvider and BrowserRouter with McpUseProvider in the ProductSearchResult component for improved context management.
- Removed unused getBasename function to streamline routing logic.
- Updated WidgetFullscreenWrapper to support viewControls prop, allowing conditional rendering of fullscreen and picture-in-picture buttons.
- Enhanced overall structure and readability of the ProductSearchResult component.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Update dependencies and enhance component functionality

- Added `react-router-dom` as a dependency to support routing features.
- Updated `detect-libc` to version 2.1.2 for improved compatibility.
- Refactored various components for better readability and structure, including the `ProductSearchResult` and `OpenAIComponentRenderer`.
- Introduced new auto-sizing functionality in `McpUseProvider` to notify OpenAI about container height changes.
- Removed deprecated `WidgetDebugger` and `WidgetFullscreenWrapper` components to streamline the codebase.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Enhance OpenAIComponentRenderer and ToolResultDisplay for performance and readability

- Memoized component to prevent unnecessary re-renders in OpenAIComponentRenderer.
- Introduced new state management for iframe height notifications and improved height handling logic.
- Refactored ToolResultDisplay to utilize memoization for args and result, optimizing rendering performance.
- Cleaned up unused state variables and streamlined event handling for better maintainability.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Improve logging and code readability in various components

- Enhanced logging statements in OpenAIComponentRenderer, McpUseProvider, and WidgetControls for better debugging and clarity.
- Refactored memoization in ToolResultDisplay to improve performance and prevent unnecessary re-renders.
- Cleaned up code formatting for improved readability across multiple components.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Update ProductSearchResult and shared routes for improved development experience

- Modified the ProductSearchResult component to change the FAQ question and enhance the autosize feature description.
- Simplified asset loading in shared routes to directly fetch from the dev server, improving development efficiency.
- Enhanced security headers in shared-utils to include dev server origins for better handling of HMR scripts and resource loading.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Integrate @tanstack/react-query and enhance fruits API in apps-sdk template

- Added @tanstack/react-query as a dependency to improve data fetching capabilities.
- Implemented a new API endpoint in the apps-sdk template to serve a list of fruits with their respective colors.
- Removed the outdated ProductSearchResult component to streamline the codebase and focus on the new API integration.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: Clean up code formatting and improve readability in product search result components

- Removed unnecessary blank lines in various TypeScript files to enhance code clarity.
- Simplified function parameters in CarouselItem component for better readability.
- Streamlined the Accordion and AccordionItem components by removing excess whitespace.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Integrate JsonRpcLoggerView into PromptsTab, ResourcesTab, and ToolsTab for enhanced logging

- Added JsonRpcLoggerView component to PromptsTab, ResourcesTab, and ToolsTab to facilitate RPC logging.
- Adjusted ResizablePanel default sizes for better layout consistency across tabs.
- Implemented keyboard shortcut handling in ToolExecutionPanel for executing tools with Cmd/Ctrl + Enter.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* format

* chore: changeset

* docs: add rpc docs

* chore: Remove bun.lock file and clean up pnpm-lock.yaml

- Deleted the bun.lock file to streamline dependency management and eliminate potential conflicts.
- Removed outdated dependencies from pnpm-lock.yaml, including entries for test_app and its associated packages, to simplify the lockfile and improve clarity.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>

* chore(typescript): version packages (canary)

* docs: update API documentation

* docs: api update docs

* trigger release

* chore: Clean up pnpm-lock.yaml and remove bun.lock file for streamlined dependency management

* chore(typescript): version packages (canary)

* chore(inspector): update package.json with homepage, repository, and bugs information

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>
2025-11-24 20:59:22 +01:00
pietrozullo ea3ff5dd95 fix code_mode test 2025-11-24 20:40:09 +01:00
pietrozullo 20d129c096 move code mode test to correct location 2025-11-24 20:30:21 +01:00
pietrozullo 00d1cf1a6d run code mode example in current dir 2025-11-24 20:30:09 +01:00
Pietro Zullo e9f044b037 [python][agent]: fix agent output parsing in stream events memory and display (#525)
* fix agent uoutput parsin in stream events memory and display

* Update libraries/python/mcp_use/agents/mcpagent.py

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

* lint

---------

Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-24 18:18:42 +01:00
Pietro Zullo fe27691947 feature: mcp 116 when the mcp use tries to call a tool with a wrong action (#520)
* fix typing annotation

* tool retry logic in agent

* removed retryable flag

* docs

* update docs
2025-11-24 17:56:23 +01:00
Copilot 72c23f131f fix/python/agent: stream_events to preserve AI messages in conversation history (#506)
* Initial plan

* Fix stream_events to properly keep AI messages in memory

Co-authored-by: pietrozullo <62951181+pietrozullo@users.noreply.github.com>

* Address code review feedback - improve code quality

Co-authored-by: pietrozullo <62951181+pietrozullo@users.noreply.github.com>

* Final code review improvements - fix section numbering and use getattr consistently

Co-authored-by: pietrozullo <62951181+pietrozullo@users.noreply.github.com>

* Run ruff format and lint on test file

Co-authored-by: pietrozullo <62951181+pietrozullo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pietrozullo <62951181+pietrozullo@users.noreply.github.com>
2025-11-21 12:20:10 +01:00
Enrico Toniato 33e4a6860e Canary (#496)
* chore: enter canary prerelease mode

* Feature/mcp 709 fix mobile view on inspector (#494)

* refactor: enhance UI responsiveness and layout across components

* fix format

* chore(typescript): version packages (canary)

* Fix/remove debugger from pip (#495)

* fix: update console visibility condition in OpenAIComponentRenderer

- Modified the condition for displaying the console to exclude the "pip" display mode, ensuring the console only appears in appropriate contexts.

* refactor: improve console visibility condition in OpenAIComponentRenderer

- Cleaned up the conditional rendering for the console to enhance readability while maintaining the same functionality. The console will only display in appropriate contexts based on the current display mode and origin.

* chore(typescript): version packages (canary)

* feat: docker file version

* feat: sync inspector to landing repo

* fix: exclude .git directory from rsync in sync-inspector workflow

* fix: update MIRROR_TOKEN in sync-inspector workflow to use INSPECTOR_MIRROR_TOKEN

* add icon to inspector

* refactor: simplify favicon service list in ServerIcon component

* fix: improve file filtering and prompt behavior in CLI commands (#499)

* chore(typescript): version packages (canary)

* Fix missing dev dependencies for mcp use app (#502)

* Feat/python/pretty display (#497)

* pretty display implementation

* docs update

* fix recusion limit configuration override in mcpagent (#500)

* feat: Add Vite and Tailwind CSS to app templates

Co-authored-by: tonxipad <tonxipad@gmail.com>

* Update package.json

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update package.json

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update package.json

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update index.ts

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update index.ts

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update package.json

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Add dev deps

---------

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>

* chore(typescript): version packages (canary)

* feat: introduce Code Mode with integration tests (#504)

- Add Code Mode functionality with code execution support
- Implement E2B and VM executors
- Add integration tests for stream events and code mode
- Update documentation and examples
- Add changeset for version tracking

* chore(typescript): version packages (canary)

* fix links

* fix: correct Markdown formatting for code display in pretty print function

---------

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>
2025-11-21 12:07:28 +01:00
pietrozullo 616b3840bd python/release/1.4.1 2025-11-20 16:28:41 +01:00
Pietro Zullo 8d4cb4719b Feature/mcp 799 python client integration of code mode (#498)
* initial commit

* update to code mode

* Squash all commits: Add CLI deploy functionality, server tool inspector, and various improvements (#467)

* chore(release): exit prerelease mode and version packages (#473)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Docs/tunnel docs (#474)

* chore: add tunnelling docs

* chore: add tunnelling docs

* docs: enhance tunneling documentation with link to @mcp-use/tunnel package

* docs: update tunneling documentation with improved code examples and formatting

* feat: Add verify parameter to MCPClient and connectors (#478)

* feat: add verify parameter to MCPClient and connectors

- Introduced a new optional `verify` parameter in `MCPClient`, `HttpConnector`, and configuration functions to control SSL certificate verification.
- Updated relevant methods to utilize the `verify` parameter, ensuring consistent handling of SSL verification across the client and connectors.
- Enhanced the SSE and Streamable HTTP connection managers to accept a custom HTTPX client factory for improved flexibility in connection handling.

* fix: linting and docs

* fix: http connector test

* Update docs/python/api-reference/mcp_use_client_config.mdx

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

* fix: docs

---------

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

* Canary release (#476)

* Implement iframe log console for inspector (#475)

* Docs/tunnel docs (#474)

* chore: add tunnelling docs

* chore: add tunnelling docs

* docs: enhance tunneling documentation with link to @mcp-use/tunnel package

* docs: update tunneling documentation with improved code examples and formatting

* feat: Add iframe console logging and UI

Implement a system to capture and display console logs from iframes. This includes injecting a script into iframes to intercept console messages and a UI component to display them in the parent window.

Co-authored-by: tonxipad <tonxipad@gmail.com>

* feat: Conditionally inject console interceptor for same-origin iframes

Co-authored-by: tonxipad <tonxipad@gmail.com>

* refactor: update IframeConsole component for improved UI and styling

- Removed unused XIcon import.
- Adjusted LogLevelBadge styling for better visual consistency.
- Renamed "Iframe Console" to "Widget Console Logs" for clarity.
- Modified button styling for better alignment and spacing.

* feat: add HTMLIFrameElement and MessageEvent to ESLint config

- Updated ESLint configuration to include HTMLIFrameElement and MessageEvent as readonly types, enhancing type safety for iframe-related code.

* feat: implement auto-scroll functionality in IframeConsole component

- Added useRef and useEffect hooks to enable auto-scrolling to the bottom of the console when logs change or the console opens.
- Updated the console's container div to use the scrollContainerRef for managing scroll position.

* chore: lint & format

* chore: changeset

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* Feat/consistent sub for tunnel (#480)

* Docs/tunnel docs (#474)

* chore: add tunnelling docs

* chore: add tunnelling docs

* docs: enhance tunneling documentation with link to @mcp-use/tunnel package

* docs: update tunneling documentation with improved code examples and formatting

* Refactor CLI tunnel functionality to support optional subdomain and save to manifest

- Updated `startTunnel` function to accept an optional subdomain parameter.
- Enhanced subdomain extraction from the tunnel URL and updated the manifest file with the subdomain.
- Cleaned up commented-out code related to tunnel handling in the CLI.
- Improved logging for tunnel establishment and subdomain saving.

* chore: changeset

* format

* chore(typescript): version packages (canary)

* Refactor tunnel argument handling in CLI to streamline subdomain flag usage and improve logging

* remove console log

* [typescript][server] Fix tools with async calls (#481)

* fix tools with async calls

* FORMAT

* chore(typescript): version packages (canary)

* fix/minor fix post canary (#482)

* fix server async call

* wrap all handle request calls in wait function

* changeset

* chore(typescript): version packages (canary)

* window.openai emulation and ChatGPT Integration debugging (#469)

* feat: Add WidgetFullscreenWrapper component

Co-authored-by: tonxipad <tonxipad@gmail.com>

* Docs/tunnel docs (#474)

* chore: add tunnelling docs

* chore: add tunnelling docs

* docs: enhance tunneling documentation with link to @mcp-use/tunnel package

* docs: update tunneling documentation with improved code examples and formatting

* feat: Enhance OpenAIComponentRenderer with tool call handling and display mode management

- Implemented tool call handling with error management and response formatting for OpenAI API compatibility.
- Added support for follow-up messages and localStorage fallback for pending follow-ups.
- Introduced display mode management (inline, pip, fullscreen) with dynamic iframe resizing and a close button for fullscreen mode.
- Updated TypeScript configuration to include .tsx files for better component support.

* fix: maintain subdomain across builds

* remove console

* refactor: replace direct serverBaseUrl usage with getServerBaseUrl method for improved consistency

* refactor: enhance WidgetFullscreenWrapper with hoverable icon buttons for fullscreen and pip modes

* feat: implement dev widget proxy and asset handling for improved development experience

* refactor: update OpenAIComponentRenderer to handle global updates for display mode and theme, enhancing iframe communication

* feat: add WidgetDebugger export to enhance debugging capabilities in the React package

* chore: fix type

* format

* chore: changeset

* remove irrelevant content

* chore: add changeset for MCP-747-fix-apps-sdk-fullscreen-close-button-9e35

* refactor: improve tunnel shutdown handling and output suppression for better user experience

* format

* remove console log

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>

* chore(typescript): version packages (canary)

* Fix/settings button servers dropdown (#485)

* feat: Add server connection management in Layout and ServerDropdown components

- Introduced ServerConnectionModal for editing connection settings in the Layout component.
- Updated ServerDropdown to handle connection options and display selected server status.
- Enhanced MCPConnection interface to include transportType and proxyConfig for better connection management.
- Implemented connection update logic with success notifications.

* add gear also to home

* chore: changeset and format

* chore(typescript): version packages (canary)

* feat: Enhance ConnectionSettingsForm layout and add utility styles (#486)

- Updated ConnectionSettingsForm component to improve layout responsiveness with new utility classes.
- Added a new CSS utility for flex column and row layout.
- Cleaned up imports for better organization.

* chore(typescript): version packages (canary)

* Update libraries/typescript/packages/cli/CHANGELOG.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update libraries/typescript/packages/cli/src/index.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update libraries/typescript/packages/cli/src/index.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Update libraries/typescript/.changeset/clear-wombats-juggle.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* Feature/mcp 743 tool argument autoformats and moves the cursor (#487)

* refactor(ToolsTab, ToolInputForm): enhance JSON handling for object/array types

- Updated ToolsTab to initialize object and array types as empty JSON strings to preserve formatting.
- Improved argument parsing in ToolsTab to handle JSON strings for object/array types before tool execution.
- Modified ToolInputForm to display objects/arrays as formatted JSON strings, ensuring user input is preserved.

* chore: changeset

* chore(typescript): version packages (canary)

* Fix/remove console button from chat (#488)

* remove mcp url console log

* feat(OpenAIComponentRenderer): add showConsole prop to control console visibility

* Feature/mcp 837 load list of models for providers (#489)

* remove mcp url console log

* Enhance ConfigurationDialog with model fetching and caching

- Added functionality to fetch models from OpenAI, Anthropic, and Google APIs based on the selected provider.
- Implemented caching for fetched models using localStorage to improve performance and reduce API calls.
- Updated the UI to display loading states and errors when fetching models.
- Refactored API key handling to support provider-specific storage in localStorage.
- Improved user experience by debouncing API calls and dynamically updating the model selection based on the provider.

* fix: reorder imports in useConfig.ts for better clarity

* chore(typescript): version packages (canary)

---------

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore(release): exit prerelease mode and version packages (#490)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update Dockerfile

Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>

* fix: x icon light mode

* docs: Improve typescript server docs (#491)

* fix: update installation commands and enhance quickstart documentation

- Changed `pnpm run dev` to `pnpm dev` in installation instructions across multiple files for consistency.
- Improved the quickstart guide by clarifying the MCP server framework's capabilities and updating the project structure details.
- Added a base URL configuration for the MCP server in the configuration documentation to ensure proper functionality of UI widgets.

* minor

* add fallback

---------

Signed-off-by: Luigi Pederzani <luigipederzani@gmail.com>

* Docs/inspector (#492)

* refactor: reorganize documentation structure for Inspector and Dev Tools

- Updated the docs.json file to consolidate Inspector and Tunneling pages under a new "Dev Tools" group.
- Removed redundant entries for Inspector and Tunneling from the documentation structure.
- Added a sidebar title for the Inspector page to enhance navigation.

* docs: enhance Inspector documentation and add new CLI usage guides

- Updated `docs.json` to include new pages for CLI usage, connection settings, keyboard shortcuts, command palette, integration, debugging ChatGPT apps, and development under the Inspector section.
- Expanded the Inspector documentation to cover new features, including CLI usage and detailed guides for keyboard shortcuts and integration.
- Improved the `self-hosting` documentation to reference the new CLI usage guide.
- Enhanced the `apps-sdk-resources` documentation with additional details on widget state and testing procedures using the Inspector.

* fix broken links

* chore: remove unuseful docs

* Feat/python/pretty display (#497)

* pretty display implementation

* docs update

* initial commit

* docs

* fix tests

* example streams and uses anthropic

* docs

* docs image

* fix type checking mock

* add rich to requirements

* enable pretty pritns in all examples

---------

Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Signed-off-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Signed-off-by: Luigi Pederzani <luigipederzani@gmail.com>
Co-authored-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vincenzo Reina <vincenzoreinaa05@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>
Co-authored-by: Luigi Pederzani <luigipederzani@gmail.com>
2025-11-20 16:26:23 +01:00
Pietro Zullo fbf89f0f5a fix recusion limit configuration override in mcpagent (#500) 2025-11-20 11:40:19 +01:00
Pietro Zullo bcbca53709 Feat/python/pretty display (#497)
* pretty display implementation

* docs update
2025-11-20 11:04:01 +01:00
Vincenzo Reina c35f37435a feat: Add verify parameter to MCPClient and connectors (#478)
* feat: add verify parameter to MCPClient and connectors

- Introduced a new optional `verify` parameter in `MCPClient`, `HttpConnector`, and configuration functions to control SSL certificate verification.
- Updated relevant methods to utilize the `verify` parameter, ensuring consistent handling of SSL verification across the client and connectors.
- Enhanced the SSE and Streamable HTTP connection managers to accept a custom HTTPX client factory for improved flexibility in connection handling.

* fix: linting and docs

* fix: http connector test

* Update docs/python/api-reference/mcp_use_client_config.mdx

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

* fix: docs

---------

Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-18 20:06:38 +01:00
Vincenzo Reina 326842511a fix: add list handling in fix_schema (#417) 2025-11-02 17:32:04 +01:00
Vincenzo Reina 054084eedb Add langchain integration (#413) 2025-11-01 10:18:35 +01:00
Vincenzo Reina aa4a1ea6a4 Fix the recursion limit problem (#405) 2025-10-30 18:46:45 +01:00
Pietro Zullo 619ef248b2 chore/python/update examples models (#402)
* Fix client_info property

* Update LLM models across various examples to the latest versions

- Changed model from "claude-3-5-sonnet-20240620" to "claude-sonnet-4-5" in airbnb_use.py, blender_use.py, and multi_server_example.py.
- Updated model from "gpt-4o" to "gpt-5" in browser_use.py, chat_example.py, example_middleware.py, filesystem_use.py, http_example.py, limited_memory_chat.py, mcp_everything.py, sandbox_everything.py, simple_oauth_example.py, simple_server_manager_use.py, and structured_output.py.
- Ensured consistency in LLM usage across all example scripts for improved performance and compatibility.

---------

Co-authored-by: renvins <vincenzoreinaa05@gmail.com>
2025-10-30 12:11:04 +01:00
Vincenzo Reina 4e68cca7b3 Fix client_info property (#401) 2025-10-30 12:07:42 +01:00
pietrozullo c12247c83d chore(python): remove relative imports 2025-10-29 10:42:19 +01:00
Pietro Zullo dcfbe90d31 release/python/1.4.0 (#394)
* chore: update imports

* refactor(mcpagent): update agent creation logic and imports

- Replaced `create_tool_calling_agent` with `create_agent` for improved agent instantiation.
- Simplified the `_create_agent` method by removing the `AgentExecutor` and directly returning the created agent.
- Adjusted type annotations for `_agent_executor` to initialize as `None` instead of using a union type.

* feat(mcpagent): migrate to LangChain 1.0.0 and simplify agent methods

- Updated MCPAgent to utilize LangChain 1.0.0's `create_agent()` for improved agent instantiation.
- Introduced new methods `astream_simplified()` and `run_v2()` that leverage the built-in `astream()` for internal agent loop handling.
- Retained legacy methods `stream()` and `run()` for backward compatibility with manual execution.
- Enhanced documentation to reflect changes and provide clearer usage examples.

* feat(mcpagent): implement dynamic tool updates during agent execution

- Enhanced the MCPAgent to support dynamic tool updates when using server_manager mode.
- Implemented logic to check for tool changes before and during execution, allowing for immediate updates and safe restarts.
- Introduced a maximum restart limit to prevent infinite loops during tool updates.
- Updated documentation to reflect the new behavior and usage of dynamic tool management.

* refactor(mcpagent): clean up imports and streamline logging

- Removed unused imports and organized existing ones for better clarity in `mcpagent.py`.
- Simplified logging statements for consistency and improved readability.
- Enhanced the overall structure of the code by eliminating unnecessary whitespace.
- Updated unit tests to reflect changes in imports and ensure compatibility with the refactored code.

* feat(mcpagent): enhance agent execution with step tracking and middleware

- Introduced `ModelCallLimitMiddleware` to enforce a maximum number of model calls during agent execution.
- Updated the `_consume_and_return` method to return a tuple of the final result and the number of steps taken.
- Enhanced telemetry tracking to include steps taken and execution time for better performance insights.
- Simplified agent creation logic by integrating middleware directly into the `create_agent` function.
- Improved logging for agent execution details, including steps and tool usage.

* fix(mcpagent): add null check for node output messages extraction

- Updated the MCPAgent to include a null check for `node_output` before attempting to access the "messages" key, preventing potential errors during message extraction.

* minor

* feat(mcpagent): filter out ToolMessage from history

- Updated the MCPAgent to exclude ToolMessage instances from being added to the message history, ensuring that only relevant messages are recorded.
- This change helps maintain a cleaner history by avoiding intermediate tool execution details.

* fix(mcpagent): set max_steps assignment

* ruff

* docs

* e2e tests for agent

* key in tests

* fix manager test and split ci tests

* telemetry off for tests

* fix server manager test

* feat(mcpagent): delegate query streaming to remote agent in remote mode

- recreated functionality to the MCPAgent to yield results from a remote agent when operating in remote mode, enhancing the agent's capability to handle queries efficiently.

* fix: agent unit tests

* Print inputs

* rollback, wrong repo

* fix streaming output

* stricter streaming test

* pass observability callbacks

* release notes

* update old release pages

* pyproject version bump

* if you do not want to migrate from langchain classic

* fix tests mock

* Canary Release (#391)

* feat(mcp-server): enhance widget metadata handling and resource domain configuration (#388)

* feat(mcp-server): enhance widget metadata handling and resource domain configuration

- Updated widget title handling to prioritize metadata title over the default name.
- Improved resource domain configuration to support dynamic server base URLs and include wildcard domains for better flexibility.
- Enhanced apps SDK metadata integration by merging additional metadata from widget configurations.
- Refactored HTML template handling for improved clarity and maintainability.

* changeset

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* feat: Enhanced widget integration and tunnel support (#389)

* refactor: streamline widget HTML generation and enhance logging

- Simplified base URL handling in the CLI by removing conditional MCP_URL usage.
- Updated HTML content generation in inspector utilities to improve base tag injection logic.
- Enhanced logging for better debugging and insights into widget content generation.

* feat: add tunnel support to CLI for server exposure

- Introduced a new `--tunnel` option in the CLI to expose the server through a tunnel.
- Implemented `startTunnel` helper function to manage tunnel creation and URL retrieval.
- Enhanced server startup logic to utilize the tunnel URL when available, improving accessibility for remote connections.
- Updated logging to provide feedback on tunnel status and URLs during server initialization.

* feat(inspector): enhance tunnel URL handling and update dependencies

- Added support for preserving the tunnel URL in navigation across inspector components.
- Introduced a new `tunnelUrl` state in the Inspector context to manage tunnel URL across the application.
- Updated various components to utilize the tunnel URL, ensuring seamless integration with the new functionality.
- Added `@radix-ui/react-popover` as a dependency in package.json for improved UI interactions.
- Updated pnpm-lock.yaml to reflect changes in dependency versions, including zod.

* feat(mcp): enhance widget integration and server handling

- Updated the CLI to fetch the MCP server from the new `/mcp` endpoint instead of `/inspector`.
- Improved tunnel establishment logging to include the new `/mcp` path.
- Enhanced HTML generation in the MCP server to replace relative paths for widget scripts and styles with absolute URLs.
- Added a script to the HTML head for dynamic file retrieval based on the server base URL, improving widget loading efficiency.

* disable tunnel in dev for now (since vite does not build assets

* fix(inspector): improve header handling in registerInspectorRoutes

- Updated header processing to exclude 'accept-encoding' to prevent compression issues.
- Added explicit request for uncompressed responses by setting 'Accept-Encoding' to 'identity'.
- Enhanced response header forwarding by omitting compression-related headers to ensure accurate body state representation.

* chore(typescript): version packages (canary)

* Feat/create mcp use app/templates (#390)

* readmes

* readme addition changeset

* chore(typescript): version packages (canary)

* format docs

---------

Co-authored-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* release(typescript): @mcp-use/inspector 0.4.7 + mcp-use 1.1.8 + create-mcp-use-app 0.4.8 + @mcp-use/cli 2.1.20

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Merge commit from fork

* fix: format

* feat(mcpagent): migrate to LangChain 1.0.0 and simplify agent methods

- Updated MCPAgent to utilize LangChain 1.0.0's `create_agent()` for improved agent instantiation.
- Introduced new methods `astream_simplified()` and `run_v2()` that leverage the built-in `astream()` for internal agent loop handling.
- Retained legacy methods `stream()` and `run()` for backward compatibility with manual execution.
- Enhanced documentation to reflect changes and provide clearer usage examples.

* feat(mcpagent): implement dynamic tool updates during agent execution

- Enhanced the MCPAgent to support dynamic tool updates when using server_manager mode.
- Implemented logic to check for tool changes before and during execution, allowing for immediate updates and safe restarts.
- Introduced a maximum restart limit to prevent infinite loops during tool updates.
- Updated documentation to reflect the new behavior and usage of dynamic tool management.

* feat(mcpagent): enhance agent execution with step tracking and middleware

- Introduced `ModelCallLimitMiddleware` to enforce a maximum number of model calls during agent execution.
- Updated the `_consume_and_return` method to return a tuple of the final result and the number of steps taken.
- Enhanced telemetry tracking to include steps taken and execution time for better performance insights.
- Simplified agent creation logic by integrating middleware directly into the `create_agent` function.
- Improved logging for agent execution details, including steps and tool usage.

* minor

* ruff

* format

---------

Co-authored-by: Luigi Pederzani <luigipederzani@gmail.com>
Co-authored-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vincenzo Reina <vincenzoreinaa05@gmail.com>
2025-10-27 14:50:51 +01:00
Luigi Pederzani f08e870e09 feat: Upgrade to Langchain 1.0.0 (#393)
* chore: update imports

* refactor(mcpagent): update agent creation logic and imports

- Replaced `create_tool_calling_agent` with `create_agent` for improved agent instantiation.
- Simplified the `_create_agent` method by removing the `AgentExecutor` and directly returning the created agent.
- Adjusted type annotations for `_agent_executor` to initialize as `None` instead of using a union type.

* feat(mcpagent): migrate to LangChain 1.0.0 and simplify agent methods

- Updated MCPAgent to utilize LangChain 1.0.0's `create_agent()` for improved agent instantiation.
- Introduced new methods `astream_simplified()` and `run_v2()` that leverage the built-in `astream()` for internal agent loop handling.
- Retained legacy methods `stream()` and `run()` for backward compatibility with manual execution.
- Enhanced documentation to reflect changes and provide clearer usage examples.

* feat(mcpagent): implement dynamic tool updates during agent execution

- Enhanced the MCPAgent to support dynamic tool updates when using server_manager mode.
- Implemented logic to check for tool changes before and during execution, allowing for immediate updates and safe restarts.
- Introduced a maximum restart limit to prevent infinite loops during tool updates.
- Updated documentation to reflect the new behavior and usage of dynamic tool management.

* refactor(mcpagent): clean up imports and streamline logging

- Removed unused imports and organized existing ones for better clarity in `mcpagent.py`.
- Simplified logging statements for consistency and improved readability.
- Enhanced the overall structure of the code by eliminating unnecessary whitespace.
- Updated unit tests to reflect changes in imports and ensure compatibility with the refactored code.

* feat(mcpagent): enhance agent execution with step tracking and middleware

- Introduced `ModelCallLimitMiddleware` to enforce a maximum number of model calls during agent execution.
- Updated the `_consume_and_return` method to return a tuple of the final result and the number of steps taken.
- Enhanced telemetry tracking to include steps taken and execution time for better performance insights.
- Simplified agent creation logic by integrating middleware directly into the `create_agent` function.
- Improved logging for agent execution details, including steps and tool usage.

* fix(mcpagent): add null check for node output messages extraction

- Updated the MCPAgent to include a null check for `node_output` before attempting to access the "messages" key, preventing potential errors during message extraction.

* minor

* feat(mcpagent): filter out ToolMessage from history

- Updated the MCPAgent to exclude ToolMessage instances from being added to the message history, ensuring that only relevant messages are recorded.
- This change helps maintain a cleaner history by avoiding intermediate tool execution details.

* fix(mcpagent): set max_steps assignment

* ruff

* docs

* e2e tests for agent

* key in tests

* fix manager test and split ci tests

* telemetry off for tests

* fix server manager test

* feat(mcpagent): delegate query streaming to remote agent in remote mode

- recreated functionality to the MCPAgent to yield results from a remote agent when operating in remote mode, enhancing the agent's capability to handle queries efficiently.

* fix: agent unit tests

* Print inputs

* rollback, wrong repo

* fix streaming output

* stricter streaming test

* pass observability callbacks

* fix tests mock

---------

Co-authored-by: pietrozullo <pietro.zullo@gmail.com>
2025-10-27 14:26:01 +01:00
pietrozullo 578c61ad92 fix: format 2025-10-27 10:41:09 +01:00
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
pietrozullo c877884505 fix CI links in python readme 2025-10-20 16:41:34 +02:00
Luigi Pederzani 3670ed05cc chore(release/typescript): mcp-use v1.1.1 + inspector v0.4.1 + others (#330)
* chore: Test canary (#329)
2025-10-19 19:02:16 +02:00
pietrozullo c5625de079 python/release/1.3.13 2025-10-18 15:38:13 +02:00
Pietro Zullo c755739142 chore: locked langchain dependencies in pyproject.toml (#321) 2025-10-18 15:24:43 +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