mirror of
https://github.com/mcp-use/mcp-use.git
synced 2026-09-14 18:06:01 +08:00
codex/a2ui-example
68 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e4fedebccb |
feat(python): add Context.elicit_url() for URL mode elicitation (#1225)
The MCP SDK supports URL mode elicitation via session.elicit_url(), but the mcp-use Context only exposed form mode via ctx.elicit(). This adds a clean ctx.elicit_url(message, url) wrapper so Python server authors don't need to drop down to the raw session API. - Auto-generates elicitation_id if not provided - Tracks telemetry as "elicit_url" - Forwards related_request_id from context - Includes docstring with usage example - 6 unit tests covering delegation, actions, telemetry, and ID generation |
||
|
|
2ddad74dab |
fix(python): convert MCP tool results to LangChain content blocks (#1192)
* fix(python): convert MCP tool results to LangChain content blocks
Previously, tool results were converted using `str(tool_result.content)`,
which produced Python repr strings like
`[TextContent(type='text', text='...')]` instead of the actual content.
Now properly maps MCP content types to LangChain format:
- TextContent → plain string or {"type": "text", ...}
- ImageContent → {"type": "image", "source_type": "base64", ...}
- AudioContent → {"type": "audio", "source_type": "base64", ...}
- EmbeddedResource → text or file block depending on resource type
Single TextContent results (the most common case) are returned as
plain strings for backward compatibility.
* test(python): cover langchain tool content conversion
* style(python): format langchain adapter
* test(python): cover langchain block tool messages
|
||
|
|
30b23271d5 |
fix(python): respect configured inspector path (#1176)
* fix(python): respect configured inspector path * fix(python): treat inspector path as a base prefix * fix(python): format inspector fixes for ruff * fix(ci): run conformance with node 22 * fix(ci): fail conformance runs with empty results * chore(ci): drop inline conformance result validation * docs(python): clarify inspector path behavior |
||
|
|
0ac1c60a60 |
feat(python): add mcp_logs_only option to hide non-MCP HTTP access logs (#1164)
* feat(python/server): add mcp_logs_only option to suppress HTTP access logs When mcp_logs_only=True, all uvicorn access logs are suppressed. MCP protocol logs (printed directly by MCPLoggingMiddleware) continue to show. This eliminates the duplicate INFO: lines for MCP requests and hides non-MCP HTTP traffic (/docs, /inspector, static files). The implementation is simple: MCPAccessFormatter returns an empty string when the flag is set, since the middleware already handles MCP logging via direct stdout prints. Closes #1162 * fix(python/server): use filter instead of empty string to suppress access logs Replace the formatter returning "" (which still outputs a blank line) with a proper MCPLogsOnlyFilter that drops log records entirely. * docs: update * docs(python): document mcp_logs_only option in server logging docs |
||
|
|
1a3dcfd632 |
feat(python): auto-retry next available port when default is in use (#1163)
* feat(python/server): auto-retry next available port when default is in use Add port availability checking before starting uvicorn. When the requested port is occupied, the server automatically tries the next port (up to 10 retries) instead of crashing. Refs #1161 * test(python/server): add unit tests for port retry helpers Tests for _is_port_available and _find_available_port covering: - Port available/unavailable detection - Skipping to next port when current is in use - RuntimeError when all ports exhausted * docs(python): document automatic port retry in server running docs |
||
|
|
e935514fc7 |
feat(python): add icons parameter to MCPServer constructor (#1147)
* fix(python/server): simplify tool JSON Schema for Optional parameters
Pydantic generates {"anyOf": [{"type": "T"}, {"type": "null"}]} for
Optional[T] tool parameters. While valid JSON Schema 2020-12, this
pattern breaks description rendering in the MCP Inspector UI and fails
Gemini API validation (requires top-level type field). MCP signals
optionality via the required array, making the anyOf/null wrapper
redundant.
- Add simplify_optional_schema() utility that collapses nullable anyOf
into flat {"type": "T"} while preserving description, default, title
- Override MCPServer.add_tool() to apply simplification after Pydantic
generates the schema
- Add 12 unit tests for the schema simplifier (test_json_schema.py)
- Add 23 unit tests for tool schema output (test_list_tool_format.py)
- Update server_example.py with representative parameter patterns
including Literal enum types
* docs(python/server): add parameter types and JSON Schema section to tools docs
Document the Python-to-JSON-Schema type mapping, required/optional/nullable
parameter patterns, and Literal enum usage. Includes a note explaining the
anyOf/null simplification that mcp-use applies automatically.
* feat(python/server): add icons parameter to MCPServer constructor
Pass through the icons parameter to FastMCP so server-level icons can
be set directly in the MCPServer constructor.
* docs(python/server): document icons parameter in server overview
* docs(python): update server example with icons and Literal enum params
* style: format server_example.py
* test(python): add unit tests for icons constructor parameter
* docs: regenerate API reference for icons param
|
||
|
|
ccfb07a8ee |
fix(python): simplify tool JSON Schema for Optional parameters (#1141)
* fix(python/server): simplify tool JSON Schema for Optional parameters
Pydantic generates {"anyOf": [{"type": "T"}, {"type": "null"}]} for
Optional[T] tool parameters. While valid JSON Schema 2020-12, this
pattern breaks description rendering in the MCP Inspector UI and fails
Gemini API validation (requires top-level type field). MCP signals
optionality via the required array, making the anyOf/null wrapper
redundant.
- Add simplify_optional_schema() utility that collapses nullable anyOf
into flat {"type": "T"} while preserving description, default, title
- Override MCPServer.add_tool() to apply simplification after Pydantic
generates the schema
- Add 12 unit tests for the schema simplifier (test_json_schema.py)
- Add 23 unit tests for tool schema output (test_list_tool_format.py)
- Update server_example.py with representative parameter patterns
including Literal enum types
* docs(python/server): add parameter types and JSON Schema section to tools docs
Document the Python-to-JSON-Schema type mapping, required/optional/nullable
parameter patterns, and Literal enum usage. Includes a note explaining the
anyOf/null simplification that mcp-use applies automatically.
* fix(python/server): address PR review comments on json_schema.py
- Fix _simplify_property docstring: says "in place" but returns new dict
- Fix simplify_optional_schema docstring: document fast-path return when
no properties exist (returns original, not a copy)
- Wrap dict comprehension for line length
* style: format server_example.py
* docs: regenerate API reference for json_schema module
|
||
|
|
4179a9c45c |
fix(python): use WeakSet for resource subscriptions to prevent memory leak on client disconnect (#1093)
* fix: use WeakSet for resource subscriptions to prevent memory leak on client disconnect Fixes #1092 Previously, resource subscriptions tracked sessions by storing id(session) integers in plain sets. When clients disconnected without explicitly unsubscribing, these integer IDs accumulated indefinitely since there was no cleanup mechanism for dropped connections. This change replaces the dict[str, set[int]] with dict[str, WeakSet], storing weak references to session objects directly. When a session is garbage-collected (after disconnect), its entry is automatically removed from all subscription sets. This also simplifies notify_resource_updated() — instead of iterating all active sessions and checking membership by id, we now iterate the WeakSet subscribers directly, which is both correct and more efficient. * style: use idiomatic emptiness check for WeakSet Replace `if not len(subscribers)` with `if not subscribers` for consistency with the existing check in notify_resource_updated(). * fix: clean up empty subscription entries + add unit tests - Clean up empty dict entries in notify_resource_updated() after all sessions for a URI are GC'd, preventing stale keys from accumulating - Add 4 unit tests for GC-driven subscription cleanup: - test_subscription_cleanup_after_session_gc - test_notify_skips_gc_collected_sessions - test_notify_does_not_crash_when_all_sessions_gone - test_multiple_uris_independent_cleanup --------- Co-authored-by: User <user@example.com> Co-authored-by: pietrozullo <pietro.zullo@gmail.com> |
||
|
|
869e56fcf4 |
fix(python): register debug routes when debug=True passed to run() (#1114)
* fix(python): register debug routes when debug=True passed to run() When MCPServer was created with debug=False (default) and run(debug=True) was called, debug routes (/docs, /inspector, /openmcp.json) were never registered because _add_dev_routes() only ran during __init__. Now run(debug=True) calls _add_dev_routes() and rebuilds the Starlette app so routes are available. Also removes dead code in ServerRunner that could never execute due to the same ordering issue. Closes #1099 * docs: regenerate API reference after removing debug from ServerRunner.run() The debug parameter was removed from ServerRunner.run() since debug mode is now fully handled in MCPServer.run() before the runner is invoked. |
||
|
|
6160a6bdde |
fix(python): achieve 100% client conformance (20/20) — fix sse-retry (#1019)
The conformance client was just sleeping during sse-retry instead of calling the test_reconnection tool. The MCP SDK transport already handles SSE reconnection with Last-Event-ID correctly — we just needed to trigger the stream closure by calling the tool. Also added comprehensive documentation to the conformance client explaining: - How the conformance framework works - What each scenario expects - Why each configuration decision was made - Links to spec references for each scenario Python client conformance: 20/20 (100%) |
||
|
|
0eeeee6d1a |
fix(python): improve client conformance (pre-registration, CIMD, scope step-up) (#1011)
* fix(python): handle pre-registration and CIMD in conformance client Configure OAuthClientProvider correctly for each auth scenario: - Pre-registration: populate storage with client_id/secret from MCP_CONFORMANCE_CONTEXT - CIMD: pass client_metadata_url for URL-based client IDs - Use asyncio.get_running_loop() for reliable future creation * fix(python): use correct CIMD URL for conformance test (conformance-test.local) * fix(python): exercise tools in auth scenarios to trigger scope step-up The conformance client was doing nothing after connecting in auth scenarios, so the scope-step-up 403 flow never triggered. Now calls tools after auth so httpx's OAuthClientProvider can handle the re-authorization. Client conformance: 19/20 (was 18/20) |
||
|
|
29f23adda1 |
feat: conformance test infrastructure for server + client (#1008)
- Update Python conformance server with all required tool/resource/prompt names - Add Python conformance client with headless OAuth for auth scenarios - Add integration test (test_conformance.py) with 11 tests covering both runners - Update CI workflow: test-type 'both', separate clients list - Add SEP-1330 enum elicitation to TypeScript conformance server Python server conformance: 30/30 (100%) Python client conformance: 16/20 (80%) — 4 auth gaps in upstream SDK |
||
|
|
fda92d4ebb |
test(python): add integration tests for resource subscriptions (#1007)
Tests the full subscribe -> update -> notification flow: - Client subscribes, server updates via tool, client receives notification - Client unsubscribes, server updates, no notification received Adds subscribable resource (data://live) and set_live_data tool to primitive server. |
||
|
|
a9bc4db3ae |
feat(python): add protocol handlers for logging, completions, subscriptions, and DNS protection (#1004)
* feat(python): add protocol handlers for logging, completions, subscriptions, and DNS protection Server SDK changes: - logging/setLevel: stores client level, Context.log() filters by RFC 5424 severity - completion/complete: default empty handler, overridable via mcp.completion() - resources/subscribe + unsubscribe: tracks per-session subscriptions - notify_resource_updated(): broadcasts to all subscribed sessions via WeakSet - dns_rebinding_protection: explicit constructor parameter (default: False) - Capabilities patch for subscribe=True Middleware: - Added hooks: on_set_logging_level, on_subscribe_resource, on_unsubscribe_resource, on_complete Tests: - 9 unit tests for log level filtering (RFC 5424) - Updated DNS protection tests for explicit flag Docs: - logging.mdx: MCP protocol logging section with level filtering - resources.mdx: subscription section with example - middleware.mdx: new hooks documented Refs: - https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/logging - https://modelcontextprotocol.io/specification/2025-11-25/server/resources#subscriptions * style: format adapter files for ruff 0.15 |
||
|
|
5e279873df |
fix(python): propagate verify parameter to HTTPConnector (#914)
The `verify` parameter on MCPClient was not being passed to `create_connector_from_config` in the `create_session` method, causing SSL certificate errors when using `verify=False` with HTTP-based MCP servers. Closes #913 |
||
|
|
d789a92b4b |
feat(server): Bearer Token authentication for Python MCP server (#841)
* Fix DNS rebinding protection for cloud/proxy deployments
- Add host/port parameters to MCPServer.__init__() and pass to FastMCP
- Default host to "0.0.0.0" (cloud-friendly, disables DNS protection)
- "127.0.0.1" auto-enables DNS protection (handled by FastMCP)
- run() can override host/port, falls back to __init__ values
- Add comprehensive docstring to __init__() explaining parameters
- Update documentation
This fixes 421 Misdirected Request errors when running behind reverse
proxies (Cloudflare, nginx, etc.) where the Host header doesn't match
the auto-configured allowed_hosts for localhost.
* Fix DNS rebinding protection for cloud/proxy deployments
- Add host/port parameters to MCPServer.__init__() and pass to FastMCP
- Default host to "0.0.0.0" (cloud-friendly, disables DNS protection)
- "127.0.0.1" auto-enables DNS protection (handled by FastMCP)
- run() can override host/port and reconfigures DNS protection accordingly
- Rebuild app when host changes in run() to apply new security settings
- Add comprehensive docstring to __init__() explaining parameters
- Add unit tests for host/port configuration and run() overrides
- Update documentation
This fixes 421 Misdirected Request errors when running behind reverse
proxies (Cloudflare, nginx, etc.) where the Host header doesn't match
the auto-configured allowed_hosts for localhost.
* ruff lint
* Bump mcp minimum version to 1.23.0
Required for TransportSecuritySettings and DNS rebinding protection
auto-configuration feature that was added in v1.23.0.
* feat(server): add bearer token authentication for Python MCP server
Add HTTP-layer bearer token authentication that returns proper 401 responses.
- BearerAuthProvider: abstract base class with verify_token() method
- AccessToken: model with token, claims, and scopes fields
- AuthMiddleware: Starlette middleware returning HTTP 401 for invalid tokens
- get_access_token() / require_auth(): context helpers for tools
Usage:
```python
class MyAuth(BearerAuthProvider):
async def verify_token(self, token: str) -> AccessToken | None:
if token != "secret":
return None
return AccessToken(token=token, claims={"user": "alice"})
server = MCPServer(name="my-server", auth=MyAuth())
```
Closes #840
* autogenerate docs
* test(server): add unit and integration tests for bearer token auth
Unit tests:
- AccessToken model creation and serialization
- BearerAuthProvider abstract class and subclassing
- get_access_token/require_auth context helpers
- AuthMiddleware 401 responses, path exclusion, CORS
Integration tests:
- MCPClient connecting to bearer auth server with valid token
- Connection failure with invalid/missing token
- Tool access to user claims and scopes
* fix(server): address code review feedback for bearer auth
- Fix CORS security: allow_credentials=False with allow_origins=["*"]
- Remove dead try/except import for auth module
- Remove PII (email) from debug logs
- Add comment explaining broad exception handling in verify_token
- Add /openmcp.json to docs excluded paths list
- Remove set_access_token from public API (internal only)
- Create AuthenticationError instead of using ValueError
- Skip middleware tests on older httpx versions (TestClient compat)
* docs: update API documentation for auth module
* fix(server): address Copilot review feedback
- Fix bearer.mdx: require_auth raises AuthenticationError, not ValueError
- Fix API docs: claims and scopes are optional with defaults, not required
- Remove deprecated SSE transport from bearer_auth_server.py test server
* autogenerate docs
* fix(server): address renvins review feedback
- Improve bearer.mdx claims documentation with explanation and examples
- Remove unnecessary cast() for AuthMiddleware in server.py
- Refactor auth tests to use pytest fixtures for cleaner setup/teardown
* docs(auth): clarify that all MCP endpoints are automatically protected
- Add "What Gets Protected" section explaining automatic protection
- Clarify that get_access_token/require_auth are for accessing token data, not protection
- Update examples to show proper usage pattern
- Improve Note at bottom to be clearer
* fix(auth): prevent path prefix bypass in auth middleware
Security fix: Use exact path matching or segment-based prefix matching
instead of simple startswith() to prevent auth bypass attacks.
Before: /docs-secret would bypass auth because it starts with /docs
After: Only /docs and /docs/* bypass auth, /docs-secret requires auth
Added tests for path matching security edge cases.
* refactor(auth): update import paths for authentication components
- Changed import statements in multiple documentation files and source files to reflect the new structure, moving authentication-related imports to the `auth` submodule.
- Updated examples to ensure clarity and consistency in usage patterns for `BearerAuthProvider`, `AccessToken`, `get_access_token`, and `require_auth`.
|
||
|
|
79d017bdc2 |
fix(python): DNS rebinding protection for cloud/proxy deployments (#825)
* Fix DNS rebinding protection for cloud/proxy deployments - Add host/port parameters to MCPServer.__init__() and pass to FastMCP - Default host to "0.0.0.0" (cloud-friendly, disables DNS protection) - "127.0.0.1" auto-enables DNS protection (handled by FastMCP) - run() can override host/port, falls back to __init__ values - Add comprehensive docstring to __init__() explaining parameters - Update documentation This fixes 421 Misdirected Request errors when running behind reverse proxies (Cloudflare, nginx, etc.) where the Host header doesn't match the auto-configured allowed_hosts for localhost. * Fix DNS rebinding protection for cloud/proxy deployments - Add host/port parameters to MCPServer.__init__() and pass to FastMCP - Default host to "0.0.0.0" (cloud-friendly, disables DNS protection) - "127.0.0.1" auto-enables DNS protection (handled by FastMCP) - run() can override host/port and reconfigures DNS protection accordingly - Rebuild app when host changes in run() to apply new security settings - Add comprehensive docstring to __init__() explaining parameters - Add unit tests for host/port configuration and run() overrides - Update documentation This fixes 421 Misdirected Request errors when running behind reverse proxies (Cloudflare, nginx, etc.) where the Host header doesn't match the auto-configured allowed_hosts for localhost. * ruff lint * Bump mcp minimum version to 1.23.0 Required for TransportSecuritySettings and DNS rebinding protection auto-configuration feature that was added in v1.23.0. |
||
|
|
4997674559 |
feat(python): Intercept MCP handshake with on_initialize middleware (#769)
* Wrap server session from MCP * Update server and middleware * Update middleware example * Fix formatting and linting * Update docs * Fix monkeypatch for tests * Update docs and remove comment * feat(python): add tests, docs, and docstrings for on_initialize middleware - Add 13 unit tests covering dispatch, chain order, rejection, and context enrichment - Rewrite middleware.mdx documentation with Mintlify components (Tabs, Tips, Cards) - Add comprehensive docstring to MiddlewareServerSession documenting single-server-per-process limitation - Add docs/CLAUDE.md with documentation improvement guidelines - Regenerate API documentation * docs: highlight typed context feature in middleware docs * example: add ClientCapabilitiesGuard demonstrating typed context * style: fix linting in middleware example * docs(examples): add comprehensive docstrings to middleware_example.py - Add module docstring explaining key concepts and middleware hooks - Document each middleware class with typed context details - Organize code with section headers (CONNECTION, REQUEST, TOOL-SPECIFIC) - Add ClientCapabilitiesGuard example showing typed context usage --------- Co-authored-by: pietrozullo <pietro.zullo@gmail.com> |
||
|
|
c990faf76b |
fix(python): add timeout mechanism to ConnectionManager.stop() (#726)
* fix(python): add timeout mechanism to ConnectionManager.stop() Add timeout parameter (default: 30s) to stop() method to prevent infinite hangs during application shutdown. Resolves issue #562. Changes: - Add timeout parameter to stop() with 30 second default - Wrap task wait with asyncio.wait_for() to enforce timeout - Wrap cleanup event wait with asyncio.wait_for() to enforce timeout - Force cleanup on timeout by clearing connection and setting done event - Add appropriate warning/error logging on timeout Tests: - Add 10 comprehensive unit tests for timeout scenarios - All 158 unit tests pass - Manual end-to-end testing verified This ensures graceful shutdown even when cleanup hangs in production. * updated with copilot suggested edits * ruff checks passed * Improve timeout handling in ConnectionManager.stop() - Move 'import time' to module level - Use CancelledError consistently (Python 3.11+ style) - Treat timeout <= 0 or None as infinite wait (no timeout) - Add elapsed time to timeout warning logs - Add tests for negative/zero/None timeout behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: update ConnectionManager.stop() API reference with timeout parameter --------- Co-authored-by: pietrozullo <pietro.zullo@gmail.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
b45d9663ec |
feat(python): introduce roots support in MCPClient and Server (#751)
* fix(python): expose client capabilities to MCP servers Add list_roots_callback support to Python connectors to properly advertise the roots capability during MCP initialization handshake. Previously, the Python library was not exposing any client capabilities because the list_roots_callback was not being passed to ClientSession. This fix ensures the roots capability is always advertised, bringing the Python library in line with the TypeScript implementation. Changes: - Add roots and list_roots_callback params to BaseConnector - Add get_roots() and set_roots() methods for managing roots - Pass list_roots_callback to ClientSession in all connectors - Export Root type from connectors module - Update unit tests to expect list_roots_callback parameter Closes MCP-1063 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(python): add roots and list_roots_callback params to connectors - Add roots and list_roots_callback parameters to StdioConnector, HttpConnector, and SandboxConnector constructors - Add comprehensive unit tests for client capabilities exposure - Tests verify roots capability, get_roots(), set_roots(), and that all callbacks are correctly passed to ClientSession 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: fix import sorting and update API documentation - Fix import sorting in test_client_capabilities.py (ruff) - Regenerate API documentation for updated connector classes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(python): add list_roots() method to server Context Allow MCP servers to request the list of roots from connected clients via ctx.list_roots(). This follows the same pattern as ctx.sample() and ctx.elicit() for server-to-client requests. * feat(python): add roots params to MCPClient and config - Add roots and list_roots_callback parameters to MCPClient.__init__, from_dict(), and from_config_file() methods - Update create_connector_from_config() to pass roots params to all connector types (Stdio, HTTP, Sandbox) - Allows clients to configure roots at the MCPClient level and have them propagate to all sessions * test(python): add get_client_roots tool to primitive server Add a tool that demonstrates the roots capability by requesting and returning the list of roots from the connected client. Used for integration testing of the roots feature. * test(python): add integration tests for roots capability Add comprehensive integration tests for the roots feature: - test_roots_capability: Verify server can request/receive roots - test_roots_empty_by_default: Verify empty roots when not provided - test_roots_with_custom_callback: Verify custom callback precedence - test_set_roots_updates_server_view: Verify dynamic root updates * test(python): update unit tests for roots parameters Update mock assertions in test_client.py to expect the new roots and list_roots_callback parameters in create_connector_from_config calls. * ci(python): add roots to primitive tests and README badge - Add roots to CI workflow primitive test matrix - Add roots to PR comment report primitives list - Add Roots badge to README Primitives row * feat(docs): enhance MCP client and server documentation for roots feature - Added `roots` and `list_roots_callback` parameters to MCP client initialization documentation. - Updated `create_connector_from_config` documentation to include new parameters. - Introduced `list_roots` method documentation in server context, detailing its usage and return values. - Improved overall clarity and completeness of API reference for better developer guidance. * feat(python): add get_client_roots tool to context example - Introduced a new tool, `get_client_roots`, to the context example, demonstrating how to retrieve and display the list of roots exposed by the client. - Updated documentation to include the new tool and its functionality, enhancing the example's coverage of context features. * feat(docs): add roots documentation for client and server - Introduced new documentation for the `roots` feature, detailing how clients can expose file system roots to MCP servers and how servers can access these roots. - Added examples for configuring roots in the MCP client and using the `list_roots()` method in the server context. - Enhanced overall clarity and usability of the documentation to support developers in implementing the roots functionality. --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: pietrozullo <pietro.zullo@gmail.com> |
||
|
|
aca5f9c040 |
feat(python): Adapt OAuth to 2.1 version from new MCP spec (#518)
* feat: Add PRM in the metadata discovery * fix: fallback anyway to PRM * feat: Implement complete discovery logic * feat: Final implementation of CIMD * feat: Implement PKCE * feat: Add scope from WWW-Authenticate * feat: Add all URLs possible styles * feat: Update tests and example * docs: Update docs * fix: linting * docs: update API documentation * fix: correct typos in OAuth metadata and error messages - Updated the comment in ProtectedResourceMetadata to use the correct abbreviation (PRM). - Fixed a typo in the OAuthAuthenticationError message regarding code challenge support. - Corrected the comment for legacy client paths to use "pre-registered" instead of "pre-reggistered". * feat: restructure authentication documentation and add new methods - Updated the authentication section in to group authentication methods under a new Authentication category with an icon. - Removed the old file and replaced it with new documentation files for Bearer Token, Custom Auth, and OAuth 2.1. - Introduced an overview page for authentication methods, detailing usage and configuration for each method. - Enhanced security best practices and examples for each authentication type to improve clarity and usability. * refactor: improve debug logging for OAuth metadata discovery - Updated debug messages to provide clearer context by specifying the issuer or host being queried during OAuth and OpenID Connect metadata discovery. - Enhanced error logging to remove redundant information, focusing on the failure reason without repeating the URL. * fix: correct abbreviation in ProtectedResourceMetadata documentation - Updated the abbreviation from PRC to PRM in the ProtectedResourceMetadata section to ensure accuracy in the documentation. * fix(oauth): correct RFC 8414 well-known URL construction for path-based issuers The OAuth metadata discovery was incorrectly constructing .well-known URLs by appending to the issuer instead of inserting between host and path. RFC 8414 specifies that for an issuer like https://github.com/login/oauth, the .well-known URL should be: https://github.com/.well-known/oauth-authorization-server/login/oauth We were incorrectly building: https://github.com/login/oauth/.well-known/oauth-authorization-server This fix: - Implements correct RFC 8414 URL construction (insert between host/path) - Supports OpenID Connect style as fallback (append to issuer) - Removes GitHub-specific hardcode since discovery now works correctly - Adds documentation comments explaining the two standards Ref: https://www.rfc-editor.org/rfc/rfc8414.html#section-3 * chore: oauth examples * docs: enhance OAuth endpoint discovery documentation - Updated the OAuth documentation to clarify how `mcp-use` discovers OAuth endpoints using both OAuth 2.0 and OpenID Connect standards. - Added a table detailing the URL construction methods for each standard. - Included examples for better understanding and a note on fallback behavior when the issuer has no path. * response to bs codeql * fix: update API URL Updated the GitHub API URL in the configuration to the correct endpoint for OAuth operations. --------- Co-authored-by: Enrico Toniato <2827496+tonxxd@users.noreply.github.com> Co-authored-by: pietrozullo <pietro.zullo@gmail.com> |
||
|
|
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 |
||
|
|
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 |
||
|
|
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 (‑) 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> |
||
|
|
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 |
||
|
|
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 |
||
|
|
babb6061b0 | fix code mode tests | ||
|
|
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> |
||
|
|
ea3ff5dd95 | fix code_mode test | ||
|
|
20d129c096 | move code mode test to correct location | ||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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 |
||
|
|
9c048aac56 |
fix: use executable to run test server for shared deps (#298)
* fix: use executable to run test server for shared deps * fix: locked pydantic version that was conflicting with fastmcp |
||
|
|
822b0b72fc |
feat: Middleware (#269)
* Middlware first commit * Add context to middleware - Add context to middleware with mcp types - Update logging middleware with new implementation - Add hooks for every type of action * Update example and metrics * Adapt tests to middleware * Fix metrics and example * Update docs and new add_middleware function * Fix metrics property * Fix on add_middleware function * Fix formatting * chore: nicer example * chore: remove global exports for middleware * chore: middleware blog --------- Signed-off-by: Vincenzo Reina <vincenzoreinaa05@gmail.com> Co-authored-by: pietrozullo <pietro.zullo@gmail.com> |
||
|
|
71c7b3a06f |
test: unit tests for MCPAgent (#281)
* unit tests for MCPAgent (init, run, stream) * fix linting and formatting |
||
|
|
c60bbf5e17 |
Fix enum validation issue in jsonschema_to_pydantic (#270)
* Fix enum validation issue in jsonschema_to_pydantic - Enhanced fix_schema method to automatically add 'type': 'string' to enum fields without explicit type - This resolves validation errors when passing string values to enum fields in FastMCP tools - Added comprehensive unit tests for enum handling scenarios - Fix is backward compatible and preserves existing functionality - Resolves issue where enum fields without explicit type caused Pydantic validation errors * Fix linting issues - Remove whitespace from blank lines - Sort imports according to project standards - All ruff checks now pass * Apply ruff formatting to test file - Format test_enum_handling.py according to project standards - All formatting checks now pass * Fix enum validation test to reflect actual jsonschema-pydantic behavior - Replace test that expected strict enum validation with test that verifies valid values are accepted - jsonschema-pydantic doesn't enforce strict enum validation as expected - Focus on testing that our fix allows valid enum values to pass validation - This addresses the test failure in CI --------- Co-authored-by: Amrithesh Kakkoth <amritheshkakkoth@gmail.com> |
||
|
|
4f0479ebf0 | fix: remove useless test that had same name of important test | ||
|
|
86be45c2dd |
feat/authorization (#149)
* Auth 1.0 * Defualt to DCR * Fix client list server names * Fix oauth problems with no oauth servers, enhance documentation and comments * Add OAuth metadata provider and specific fixes - Remove auth field to reduce API verbosity - Add "auth" support for MCPClient's config - Add "oauth_provider" key to MCPClient's config to provide metadata - Fix no OAuth servers' errors * Relocate authentication doc * Fix ruff formatting as usual * Fix http connectors tests with oauth support * Fix test_config unit tests * Final fix for tests * Add integration for auth - Add auth server for testing - Add test for complete auth flow with mock on OAuth callback - Add test for custom client auth - Add test for bearer auth token * Add further test and update README - Add OAuth metadata provider (no discovery) - Update README with new auth badge * Format fixes * Remove redefined exception * Add auth test on GH action * Update docs with correct example * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com> * Update mcp_use/auth/oauth.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com> * Add custom callback port feature - Add customizable port for callback - Remove dynamic port - Fix bug of registration before checking port * Add GitHub MCP support * Update docs * chore: highlight hack * chore: change wording in docs * Add authlib on project dependencies * Remove useless example * Fix formatting as usual --------- Signed-off-by: Vincenzo Reina <vincenzoreinaa05@gmail.com> Signed-off-by: Pietro Zullo <62951181+pietrozullo@users.noreply.github.com> Co-authored-by: renvins <vincenzoreinaa05@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
0c6c7663d3 |
chore: cleanup (#225)
* Honor deprecation * Better handling of access methods when method is not supported by server |
||
|
|
2a165e7379 |
feat: notification & logging (#223)
* Add message handler function * Notification test * feat: logging callback * Separate logging tests * Documentation * Remove duplicate * rename notidfication test * Discovery - client reacts to tools,resources,prompts update notifications * integration test * unit tests * Fix, remove asyncio task creation, if we do not cache the tools it is not necessary to refresh. I wonder if it caching them tools (etc) is any important for somebody * Fix type names in the docs |
||
|
|
01f8069269 |
feat: improve client docs (#212)
* Clean up session/connector API * Improved docs, pormpts resources and promts * minor fixes |
||
|
|
e0face5986 |
feat: Improve error handling (#215)
* Add error helper function * Update error formatting for adapters * Add custom args for error and add formatted in tools * Add docs in error formatting and improve observability * Fix and add more properties on adapters * Fix on folder name, conflict with utils file * Final fix for the utils problem * Try to sort imports in correct order * Add line at end of the error formatting file * Fix with imports with ruff * Fix also ruff formatting error |
||
|
|
6176392c09 |
feat: Implementing logic to create sessions only for the specified servers. (#209)
* Adding logic to create sessions for selected servers * Add empty line in the end * Add empty line in the end fixed lint issues and changed inline comment |
||
|
|
223b89c73f | chore: move tests in right location, include other integration tests | ||
|
|
1cec6e685f |
feat: add timeout seconds args option when calling tool (#178)
* feat: add timeout seconds args option when calling tool * fix: unit test fix |
||
|
|
cc0304ebd7 | Remove problematic test | ||
|
|
1736e31388 |
Feat: elicitation (#175)
* Elicitation Client Implementation * Elicitation test * Elicitation Documentation * Docs elictiation fn params * Bump fastmcp * Add elicitation to constructors of client * fix tests |