Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Khadder e17cd7b8ca Canary (#2216)
* feat(client): support mixed OAuth servers

* fix(inspector): pause mixed-auth tool calls

* Revert "fix(inspector): pause mixed-auth tool calls"

This reverts commit 9bac9ddfe7.

* chore: finalize mixed OAuth changeset

* docs: explain mixed OAuth client flows

* fix: bound mixed auth metadata discovery

* docs(server): add runnable mixed oauth example

* fix(inspector): recover stale local connections

* fix(inspector): resume tools after mixed auth

* fix: address mixed auth review feedback

* fix(inspector): scope mixed auth retries

* test(inspector): remove jsdom-only regressions

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* fix(inspector): stream v2 subscription acknowledgements

* fix(client): discover mixed auth after ready

* test(client): preserve mocked connection compatibility

* fix(client): defer mixed auth discovery until ready

* fix(client): discover mixed auth after ready paint

* perf(client): expose tools before auxiliary inventories

* fix(client): refresh mixed auth discovery after reconnect

* chore(typescript): version packages (canary)

* fix(client): make codeMode custom executor functions actually work (#2123)

* fix(client): make codeMode custom executor functions actually work

`_ensureCodeExecutor()` handled a function-valued `codeMode.executor` by
assigning `this._customCodeExecutor` and then throwing
"Custom executor function should be handled in executeCode". Since
`executeCode()` read that field *before* calling `_ensureCodeExecutor()`,
and only `_ensureCodeExecutor()` ever populated it, the first
`executeCode()` call always rejected and only the second succeeded.
`searchTools()` had no such fallback, so it rejected on every call --
including via the `search_tools` meta tool on `CodeModeConnector`. Because
`_codeExecutor` stayed null, `close()` also skipped executor cleanup.

Route function executors through a new `FunctionCodeExecutor` adapter so
they participate in the normal executor lifecycle, and drop the now-unused
`_customCodeExecutor` field and its pre-check in `executeCode()`.

Also fix `detail_level` validation in `CodeModeConnector.callTool`: it
used `detailLevel in ["names", "descriptions", "full"]`, and `in` tests
property keys, so an array literal only has `"0"`/`"1"`/`"2"`/`"length"`.
Every valid detail level failed the guard and was silently rewritten to
`"full"`, so an agent requesting `"names"` received full input schemas for
every tool. Replaced with a `Set` membership test.

Adds 10 unit tests: first-call success, timeout forwarding, `searchTools`,
`close()` cleanup, the `BaseCodeExecutor` instance path, each valid
`detail_level`, and the unknown/omitted fallbacks.

Closes #2122

* fix(client): preserve `this` for custom executors, tighten tests, document the contract

Addresses review feedback on the code-mode custom-executor fix.

The `this` binding regression is real -- I measured it both ways. On the
pre-fix code the executor function was invoked as
`this._customCodeExecutor(code, timeout)`, so a non-arrow function saw the
`MCPClient` as its `this`; through the new adapter it saw the
`FunctionCodeExecutor`. `FunctionCodeExecutor.execute` now calls
`this.fn.call(this.client, ...)` so a `function`-form executor keeps the same
context it had before, and a test asserts it.

Two tests were weaker than their titles claimed:

- the `searchTools` test ran against an empty client, so it only proved the
  call did not throw. It now registers a stub session with one tool and
  asserts the full `{ meta, results }` payload, including the namespace and
  the tool's `input_schema`.
- the `close()` test only asserted the promise resolved, which would pass
  even if cleanup were skipped. It now spies on the resolved executor's
  `cleanup()` and asserts it ran exactly once.

Documentation: the API reference listed one "Custom" executor row saying to
implement `execute()` + `cleanup()`, which is only true for the
`BaseCodeExecutor` subclass form. Split it into separate class and function
rows, add the `CodeExecutorFunction` signature to the types block, and add a
worked example to the code-mode guide (current and v2) stating the `this`
context and that the function owns its runtime cleanup.

* docs(client): use a non-arrow custom executor in the code-mode example

The example demonstrated the documented `this` context with an arrow function,
which has lexical `this` and therefore cannot observe it. Switched to
`async function (this: MCPClient, code, timeout)` and had it actually call
`this.getServerNames()`, so the snippet exercises the contract it describes.
Type-checked the snippet shape against the real `MCPClient` type with
`tsc --noEmit` before committing.

Also reworded the surrounding paragraph: the `this` binding is specific to the
non-arrow form, whereas the cleanup-ownership rule applies to every custom
function.

* docs(client): drop v1 code-mode custom executor docs

This change is v2-only; keep the custom-executor contract on the v2 docs path.

* chore(typescript): version packages (canary)

* fix(create-app): sanitize the npm name for named projects, not just "." (#2209)

deriveProjectInfo only ran sanitizePackageName on the "." branch. A named
project passed the raw argument straight through as packageName, which is
then written into package.json and substituted into the template's index.ts.

The CLI rejects path separators, ".." and a few protected names, but not
spaces, quotes or capitals, so `create-mcp-use-app 'My "App"'` emitted
`name: "My "App""` in index.ts, which is not valid TypeScript.

Sanitize on both branches. The directory still uses the name as typed.

* chore(typescript): version packages (canary)

* fix: enable skills tab after HMR (#2220)

* chore(typescript): version packages (canary)

* fix(create-app): strip leading underscores when sanitizing a package name (#2221)

sanitizePackageName removed leading dots and dashes but not underscores, so
create-mcp-use-app _foo wrote "name": "_foo" into package.json.

npm publish rejects that outright:

  npm error code EINVALIDPACKAGENAME
  npm error Invalid package name "_foo": name cannot start with an underscore.

Widen the leading-character class to [._-] and cover both the sanitizer and a
named project starting with an underscore.

Closes #2219

* chore(typescript): version packages (canary)

* fix(client): surface auth for protected operations

* fix(inspector): resume mixed-auth chat tools (#2226)

* chore(typescript): version packages (canary)

* fix: harden stable mixed-auth flows

---------

Co-authored-by: Enrico <2827496+tonxxd@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: LHMQ878 <72402929@cityu-dg.edu.cn>
Co-authored-by: Ayaan Gazali <ayaangazali.work@gmail.com>
2026-08-11 12:52:52 +02:00
Andrew Khadder e41076fb3f feat: improve Skills over MCP Inspector support (#2196)
* Codex worktree snapshot: archive-cleanup

Co-authored-by: Codex

* feat: improve skills over MCP inspector support

* fix: address Skills review feedback
2026-08-07 21:55:54 -07:00
Enrico 2daf9c9d42 fix: resolve skills over MCP canary conflicts 2026-08-06 17:53:06 +02:00
Enrico b5354b5285 fix(docs): update Inspector URL references to /mcp/inspector 2026-07-21 11:53:55 -07:00
Andrew Khadder 68afda5885 docs(typescript): review and rewrite TypeScript docs (MCP-2466) (#1780)
* docs: remove stale feedback block and orphaned anchor from docs.json

* chore(docs): make Typescript more prominent

* chore(docs): Update `welcome.mdx`

* docs: rewrite TypeScript quickstart and welcome pages

Refocus the quickstart on create-mcp-use-app (scaffold, run, and deploy a
first MCP server) and drop the agent/client/server primer table and
diagram. Convert the welcome page's server + widget example from Tabs to
CodeGroup and tighten the intro wording.

* docs: remove stale server templates page and fix its references

Delete the typescript/server/templates page and repoint the home
templates tip to the quickstart, which now covers create-mcp-use-app.

* docs(typescript): fix dead example links to real example paths

The 'see a full example' links pointed at GitHub folders that 404 or
contain only a README. Corrected to the real runnable examples under
libraries/typescript/packages/mcp-use/examples/, verified against
origin/main (incl. matching cd commands):

- installation: examples/server -> packages/.../examples/server
- client-configuration: a .py link -> real TS multi-server example
- code-mode: examples/client/* -> examples/agent/code-mode/*
- elicitation, sampling, notifications: server/X -> server/features/X
- supabase: server/supabase -> server/deployment/supabase
- clerk: restore missing packages/mcp-use/ path segment

Quickstart links were already fixed by the quickstart rewrite (e6903716).
Part of the docs audit (MCP-2466).

* docs(typescript): rewrite Agent and Client introduction pages

Rewrite the Agent and Client intro pages to be task-oriented and
scannable: concise feature lists with cross-links, runnable quick-start
examples, and added API reference sections. Drop stale CodeSandbox
embeds and outdated model names.

* docs(typescript): fix MCPServer class name casing in server reference

The API Reference heading, prose, and class signature used McpServer;
the real SDK export is MCPServer. Corrected all three occurrences in
server/index.mdx.

* docs: add redirect for bare /typescript/server path

Routes the bare /typescript/server path to its index page now that the
server section has been restructured.

Claude-Session: https://claude.ai/code/session_015uioJjKTAZXGQpbXHUHZWp

* docs(typescript): fix broken code examples across MCP Server & Apps section

Fix all 102 confirmed code defects found in the MCP Server & MCP Apps
documentation audit (47 pages, 401 code blocks), verified against the
mcp-use@1.32 SDK source. The recurring patterns that made copy-pasted
examples fail to compile or run are now corrected everywhere they appeared:

- server.start() -> await server.listen() (no start() method exists)
- bare-object tool returns wrapped in object()/text() response helpers;
  catch blocks renamed so they no longer shadow the error() helper
- prompt messages use role:"user" with typed { type:"text" } content
  instead of the invalid role:"system" + bare-string shape
- auth reads ctx.auth.user.userId (not ctx.auth.userId); user fields live
  under ctx.auth.user, scopes/permissions stay top-level
- security: remove verifyJwt: process.env.NODE_ENV === 'production' from all
  six OAuth provider pages (off-prod it skips signature verification and
  accepts forged tokens); rely on the secure default, with a warning never
  to disable it
- correct import subpaths: Logger/MCPClient from mcp-use, response helpers
  and server symbols from mcp-use/server, MCPClient as BrowserMCPClient from
  mcp-use/browser; drop the unexported getMcpAppsBridge
- useWidget generics use the real <TProps, TState, TOutput, ...> order;
  remove the non-existent notifyIntrinsicHeight (auto-size via McpUseProvider)
- fix the deployment URL to <id>.run.mcp-use.com/mcp, add missing z/helper
  imports, add the --branch/--dockerfile CLI options, and clean up em dashes
  and bare/malformed code fences

Each page was fixed and then independently re-verified against the SDK
source, with a repo-wide pattern sweep confirming no instances remain.
Structural IA changes (moving widget-components to /react/, orphan
redirects) are intentionally deferred to the docs rewrite.

* docs(typescript): restructure MCP Server & MCP Apps IA

Promote MCP Apps to its own top-level section in the TypeScript SDK Docs tab and move the 9 React widget-component pages out of /server/widget-components/ into /typescript/react/.

- Move 9 React component pages to typescript/react/ (git renames) with 9 redirects
- Promote MCP Apps to a top-level group (Overview pages + React subgroup)
- Remove the duplicate MCP Apps group from the Home product nav; rehome guides/chatgpt-apps-flow under MCP Apps so it no longer orphans
- Move cli-reference out of MCP Server into a new Tooling group
- Relocate response-helpers -> Core Components, openapi -> Advanced Features, nextjs-drop-in -> Deployment
- Repoint all widget-components links to /typescript/react/
- Fix 3 broken anchor links (inspector CLI env var, mcp-apps metadata, auth providers)

Structure-only change; no page content rewrites. Refs MCP-2466.

* docs: refresh TypeScript server app docs

* docs: add TypeScript API reference

* docs: streamline TypeScript server navigation

* docs: rewrite core TypeScript server guides

* docs: rewrite advanced TypeScript server guides

* docs: rewrite TypeScript server OAuth guides

* docs: rewrite TypeScript server session storage guides

* docs: rewrite MCP Apps section

* docs: add TypeScript MCP client API reference

* docs: add TypeScript MCP agent API reference

* docs: reorder TypeScript API reference nav

* docs: reorganize TypeScript tooling nav

* docs: rewrite inspector guides

* docs: rewrite MCP server tunneling guide

* docs: rewrite CLI client and reference docs

* docs: finalize TypeScript documentation rewrite

* docs: move inspector updates under get started

* Fix Mintlify validation errors

* Fix Mintlify broken links

* docs: update Manufact Cloud deployment guide

* chore: retrigger Mintlify docs preview

* Fix MDX comment syntax on home page

* docs: rework TypeScript server examples

* docs: fix server docs links

* docs: restore SDK links in home sidebar

* docs: move SDK links to end of home sidebar
2026-06-29 10:05:13 -07:00
Pietro Zullo 8348c59a53 docs: reorganize, fix accuracy, and update for agent readability (#1502)
* docs: reorganize navigation and clean up content

- Remove 'Misc' group with misplaced blog posts
- Remove 'Libraries' redirect group from Home nav
- Simplify 'Dev Tools' group (flatten Inspector, CLI, Tunneling)
- Remove individual changelog versions from Python nav (keep summary)
- Remove changelog from TypeScript 'Get Started' group
- Remove tunneling duplicate from Python Development group
- Rewrite mcp101 as clean MCP concepts page (was pitch deck)
- Delete typescript/blog posts (not technical docs)
- Add redirects for deleted blog post URLs

* docs: fix content accuracy and remove sloppy language

- Fix broken python/server/mcp-apps link in home page
- Remove informal pitch-speak from python/server/index.mdx
- Fix grammar error in typescript/server/index.mdx
- Update typescript/client/logging.mdx: remove fake 'coming soon' API code
- Fix non-existent model name gpt-5.1 in typescript quickstart
- Fix mcp_use naming in development contributing guide

* docs: fix incorrect TypeScript server API calls in inspector docs

- Replace server.addTool() with server.tool() (correct mcp-use API)
- Add missing zod import to debugging-chatgpt-apps example

* docs: fix fake model names (gpt-5.1 → gpt-4o) in agent docs

* docs: update model names, fix APIs, and add agent visibility hints

- Replace all deprecated model names with latest: gpt-4.1, gpt-4.1-mini,
  claude-sonnet-4-6, claude-opus-4-7, gemini-2.5-flash across all docs
- Fix TypeScript server.tool() API in installation.mdx (old positional string form)
- Fix TypeScript agent.run() in quickstart.mdx (deprecated string form → object)
- Remove broken manufact.com/docs/llms.txt hidden hints from 5 pages
- Add <Visibility for="agents"> block to mcp101.mdx with install commands,
  key classes, and API signatures for agent-oriented navigation
- Add LangChain provider install note to Python quickstart (mcp-use agent
  requires a separate langchain-* provider package)
- Update model name cards in Python llm-integration.mdx

* docs: clean up remaining stale model names and improve accuracy

- Update supported model lists in Python and TypeScript llm-integration pages
- Fix cost optimization table to use current model IDs
- Update TypeScript agent overview supported providers list

* docs: add LangChain provider install to TypeScript quickstart agent section

The MCPAgent requires a separate @langchain/* provider package; this was
not mentioned before the code example that imports from @langchain/openai.

* docs: update to latest flagship model IDs (May 2026)

- OpenAI: gpt-4.1 → gpt-5.5, gpt-4.1-mini → gpt-5.5-mini
- Google: gemini-2.5-flash → gemini-3.1-flash, gemini-2.5-pro → gemini-3.1-pro
- Groq: llama-3.1-* → llama-4-scout-17b-16e-instruct
- Anthropic (claude-opus-4-7, claude-sonnet-4-6) already current, no change

* docs: replace all em dashes with hyphens

* docs: restore llms.txt hints using Visibility component

* docs: simplify TypeScript logging page to unsupported notice only

* docs: rewrite mcp101 to explain MCP protocol with mcp-use examples and doc links

* docs: remove goal.md

* docs: revert nav changes, keep only Misc group removal and blog redirects

* docs: reorder mcp101 to Server/App -> Client/Inspector -> Agent, restore title

* docs: add code examples for Resources and Prompts in mcp101

* docs: remove em dashes from mcp101

* docs: add MCPClient code examples to mcp101

* docs: add React client example to mcp101

* docs: add agent code examples to mcp101

* docs: expand MCP Apps section in mcp101 with example and links

* docs: restore Contacts, Socials, and Founders sections to mcp101

* docs: add context-setting intro paragraph to mcp101 for new readers

* docs: add MCP stores section to mcp101 intro with Claude, ChatGPT, Cursor

* docs: fix Claude store link

* docs: fix ChatGPT store link

* docs: fix Cursor store link

* docs: replace store Cards with linked image grid

* docs: add captions to store images

* docs: add Notifications to client primitives table in mcp101

* docs: add lead-in paragraph before resource cards at bottom of mcp101

* docs: move resource cards to end of page after Contacts/Socials/Founders

* docs: demote Contacts/Socials/Founders to bold text to remove from TOC

* docs: move Contacts/Socials/Founders to very end of mcp101

* docs: add Resources and Contacts section headers, link official MCP docs

* chore(docs): update site metadata, footer links, and rename mcp_use to mcp-use

* update docs metadata + images

* docs: enhance MCP section by highlighting the reach of MCP stores with 1 billion weekly active users

* api ref
2026-05-14 18:49:06 +02:00
Pietro Zullo b056f72e06 docs: add llms.txt directive to landing pages for agent readiness (#1419)
* docs: add llms.txt directive blockquote to landing pages

Adds a blockquote pointing to /llms.txt at the top of the main landing
pages so agents have a clear, page-level pointer to the documentation
index. Addresses the LLMS TXT Directive check in agent-readiness audits.

* docs: hide llms.txt directive from human readers via display:none

The directive is for agents (which still see it in DOM/markdown export),
not humans, so wrap each blockquote in a hidden div to remove visual
noise from landing pages.

* docs: use absolute URL for llms.txt directive

Mintlify's broken-link checker validates relative paths against pages
in docs.json, and /llms.txt is an auto-generated artifact at host root,
not a navigation page. Switch to the absolute URL so CI passes; agents
still see a same-host link.

* docs: point llms.txt directive at canonical manufact.com URL

Skips the 2 cross-host 301 hops from docs.mcp-use.com so agents reach
the index in one request.

* docs: remove redirect-audit.md from PR

This was an internal diagnostic file accidentally bundled into the
llms.txt directive PR. Keeping it locally for reference, not for
shipping in docs.
2026-04-27 17:47:29 +02:00
Enrico Toniato 3334a67769 Canary (#1012)
* feat(dns-rebinding): implement DNS rebinding protection and examples (#1001)

- Added `allowedOrigins` configuration to the `MCPServer` for DNS rebinding protection, enabling host validation for specified origins.
- Updated documentation to clarify the behavior of `allowedOrigins` in development and production environments.
- Introduced a new example demonstrating DNS rebinding protection, including curl commands for testing.
- Enhanced server methods and middleware to support the new host validation feature.
- Refactored related documentation to improve clarity on middleware and configuration options.

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* fix(inspector): enhance readiness state management and tool output handling

- Added a useEffect hook in OpenAIComponentRenderer to reset the readiness state when the widget URL changes, ensuring proper updates for new iframes.
- Updated shared-utils to improve handling of tool output and response metadata, facilitating smoother transitions of widget states from pending to ready.

* feat(mcp): defer server callbacks to avoid render-phase updates (#1002)

- Introduced a mechanism to collect callbacks for server state changes and defer their execution using `queueMicrotask`, preventing potential render-phase updates during state updates.
- Updated the `McpClientProvider` to push `onServerAdded` and `onServerStateChange` callbacks into an array for deferred execution, enhancing performance and stability.

* chore(typescript): version packages (canary)

* feat(inspector): enhance elicitation support with SEP-1330 enum schema variants (#1010)

- Added detailed documentation for the Elicitation tab, outlining its features and supported schema patterns.
- Implemented handling for various SEP-1330 enum schema variants in the client and server, including single-select and multi-select options.
- Introduced new tests to validate the elicitation flow for all enum schema variants, ensuring correct rendering and submission behavior.
- Updated examples and README files to reflect the new elicitation capabilities and SEP-1330 patterns.

* chore(typescript): version packages (canary)

* feat(inspector): implement partial tool input handling for streaming arguments

- Added support for partial tool input in the MCPAppsRenderer, allowing for real-time updates during LLM argument generation.
- Enhanced MessageList and ToolResultRenderer components to accommodate new streaming states and partial arguments.
- Updated useChatMessagesClientSide to handle streaming tool call arguments, improving user experience during interactions.
- Introduced new types and state management in useWidget for tracking partial tool input and streaming status.

* chore(typescript): version packages (canary)

* feat(inspector): enhance tool argument handling with type coercion and schema resolution (#1013)

- Introduced utility functions for coercing input values based on their expected types, improving the handling of boolean, array, and object parameters.
- Updated ToolsTab and ToolInputForm components to utilize new schema utilities for resolving property types and extracting enum values.
- Added a new server tool for validating argument typing, ensuring correct submission of typed values.
- Enhanced end-to-end tests to verify the correct behavior of typed arguments in tool execution.

* chore(typescript): version packages (canary)

* changelog

* feat(docs): enhance documentation for streaming tool arguments and live previews

- Updated guides and examples to include details on streaming tool arguments in widgets, enabling real-time updates during LLM interactions.
- Added new sections in `useWidget` documentation to explain `partialToolInput` and `isStreaming` properties.
- Included a new example demonstrating live previews while streaming tool arguments in the MCP Inspector and MCP Apps clients.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-15 17:39:27 -08:00
Enrico Toniato 53ae49d153 Canary (#933)
* Fix/mcp-use/pending-state (#931)

* feat(inspector): enhance widget support and lifecycle management

- Updated MCPAppsRenderer and OpenAIComponentRenderer to handle tool output and metadata more effectively, allowing for immediate rendering of widgets even when results are pending.
- Implemented pre-fetching of widget resources in ToolsTab to improve loading states and user experience.
- Added utility functions for widget detection and pre-rendering capabilities based on tool metadata.
- Enhanced MessageList and ToolResultRenderer to support immediate rendering of widget tools, improving responsiveness during tool execution.
- Introduced a delayed weather tool in the example server to demonstrate widget lifecycle management.

These changes address Issue #930, ensuring widgets can display loading states and update seamlessly upon tool completion.

* fix(inspector): emulate pending state for widgets to align with ChatGPT behavior

- Added logic to ensure that the pending state is accurately reflected for widgets, enhancing user experience during tool execution.
- Removed unnecessary console logs and warnings in ToolResultRenderer for cleaner code and improved performance.

* feat(server): add delayed weather tool to test widget lifecycle

- Introduced a new tool, `get-weather-delayed`, which simulates a 5-second delay before returning weather data. This addition aims to test and demonstrate the widget lifecycle management, addressing Issue #930.
- Updated documentation to include usage instructions for the new tool, enhancing the example server's functionality.

* docs(inspector): update inspector references and enhance widget lifecycle testing documentation

- Changed references from "MCP Inspector" to "mcp-use Inspector" for consistency.
- Added detailed instructions for testing widget lifecycle, including `isPending` transitions and console log verification.
- Updated links and sections to improve clarity and usability in the documentation.

* feat(inspector): enhance server connection handling in Layout component (#932)

* feat(inspector): enhance server connection handling in Layout component

- Added logic to redirect to the autoConnect parameter if a server URL is provided but no matching connection exists.
- Updated dependencies in the useEffect hook to include connections and navigate for improved functionality.

* feat(inspector): add url-parameters to inspector documentation

- Included "inspector/url-parameters" in the documentation index to enhance the inspector's reference materials.

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-01 09:48:01 -08:00
Enrico Toniato 32f2113124 Canary (#916)
* feat(inspector): add support for prompts (without args) to inspector chat (#884)

* add prompts support to inspector chat

* fix format

* add changeset for minor version bump

* refactor clearing prompts dropdown UI state

* refactor inspector documentation for improved readability and structure

- Enhanced formatting and layout for better clarity.
- Added new sections for using prompts in chat, including dropdown navigation and execution details.
- Updated various text blocks for consistency and readability throughout the document.

---------

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

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* feat(typescript): add completable() helper for prompt argument autocomplete (#899)

* add prompt argument completion support

* update docs to include completable()

* add changeset

* feat(completion): enhance prompt argument completion with language support

- Added `language` parameter to the review code prompt, allowing users to specify the programming language for code reviews.
- Introduced `completable` type and `CompletionContext` interface to support contextual completion suggestions in the completion helpers.
- Updated the `completable` function to handle callback context, improving dynamic completion capabilities.
- Enhanced unit tests to cover new functionality, including handling of null/undefined values and callback errors.

These changes improve the usability and flexibility of the prompt system, enabling more tailored code review experiences.

---------

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

* chore(typescript): version packages (canary)

* feat(inspector): add support for file attachments in chat messages (#912)

- Introduced functionality to handle image attachments in chat messages, allowing users to send and display images alongside text.
- Updated message handling to support multimodal content, including the conversion of messages with attachments to the LangChain format.
- Enhanced the user interface to display attachments in the chat, ensuring a seamless experience when sending and receiving messages with images.
- Implemented validation for file types and sizes to maintain performance and user experience.

These changes significantly improve the chat functionality, enabling richer interactions through multimedia support.

* chore(typescript): version packages (canary)

* feat(inspector, mcp-use): enhance request origin handling and security headers (#915)

- Introduced `getRequestOrigin` function to extract the request origin from headers, supporting proxy-aware configurations.
- Updated `getWidgetSecurityHeaders` to include the dynamic request origin in CSP configurations, enhancing security for widget connections.
- Modified `registerInspectorRoutes` to utilize the new request origin handling, ensuring proper security headers are set based on the request context.
- Refactored UI resource registration to enrich widget definitions with server origin for improved asset loading and API connectivity.

These changes improve the security and flexibility of widget interactions within the inspector and MCP applications.

* chore(typescript): version packages (canary)

* Revert "feat(inspector, mcp-use): enhance request origin handling and securit…" (#917)

This reverts commit 3e2821fee8.

* chore(typescript): version packages (canary)

* feat(cli): enhance server exit handling and introduce gateway URL builder (#920)

- Updated server process exit handling to ensure cleanup is performed before exiting the CLI.
- Added a centralized function to construct gateway URLs, improving maintainability and consistency in URL generation for deployments.

---------

Co-authored-by: Joaquin Coromina <75667013+bjoaquinc@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-30 10:29:03 -08:00
Enrico Toniato 53fb6703be Merge canary: Multi-server MCP client, telemetry refactor, and UI enhancements (#730)
* Feat/inspector/open in (#717)

* fix(docs): update title and description for Google Cloud Run deployment guide

* feat(docs): enhance command palette with "Add to Client" functionality

- Introduced new "Add to Client" section in the command palette documentation, detailing actions for adding the current MCP server to various AI clients and code editors.
- Updated the index and command palette files to reflect the new feature, including installation methods and usage instructions.
- Added visual aids to improve user understanding of the new functionality.

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* test: add tests to ensure mcp-use/react and mcp-use/browser do not import Node.js dependencies (#729)

* test: add tests to ensure mcp-use/react and mcp-use/browser do not import Node.js dependencies

- Introduced a new test file to verify that the built outputs of mcp-use/react and mcp-use/browser do not include Node.js built-in modules or Node.js-specific npm packages.
- Implemented checks for both static analysis and runtime behavior to ensure compliance with browser compatibility.
- The tests are expected to fail initially, highlighting any existing Node.js dependencies in the bundles.

* refactor(logging): remove Winston dependency and enhance SimpleConsoleLogger

- Eliminated the Winston logger integration, simplifying the logging mechanism to use only the SimpleConsoleLogger across all environments.
- Updated the Logger class to configure and manage instances of SimpleConsoleLogger, allowing for customizable log formats (minimal, detailed, emoji).
- Adjusted the logging methods to ensure consistent behavior without relying on Node.js-specific modules, improving compatibility with browser environments.
- Cleaned up the codebase by removing unused imports and functions related to Winston.

* feat(telemetry): enhance browser compatibility and logging functionality

- Updated the telemetry system to ensure compatibility with both browser and Node.js environments by introducing a new `telemetry-browser.ts` file.
- Refactored the logging methods in `SimpleConsoleLogger` to support additional arguments, improving log message formatting.
- Adjusted the `RemoteAgent` and various utility functions to safely access environment variables, ensuring they work seamlessly in browser contexts.
- Added tests to verify that the `mcp-use/react` and `mcp-use/browser` modules do not import Node.js dependencies, reinforcing browser compatibility.

* fix(inspector): update imports for server-side compatibility

- Changed the import statements for MCPAgent and MCPClient to use the main entry point instead of the browser-specific version, ensuring proper functionality in server-side contexts.

* chore(pnpm-lock): remove unused dependencies and clean up lock file

- Removed several unused packages from the pnpm-lock.yaml file, including Winston and related dependencies, to streamline the project and reduce potential security vulnerabilities.
- Cleaned up the lock file by eliminating optional dependencies that are no longer required, ensuring a more efficient package management experience.

* refactor(telemetry): improve compatibility checks and logging

- Enhanced the `telemetry-browser.ts` and `telemetry-node.ts` files to ensure better compatibility with various environments by adding checks for `localStorage` and `crypto` availability.
- Updated logging to provide more informative debug messages for potential issues, particularly in private browsing scenarios.
- Refactored the `secureRandomString` function to handle ESM-only environments gracefully, ensuring consistent behavior across different Node.js versions.

* feat(inspector): integrate MCP proxy utilities and enhance configuration handling

- Added utility functions from `mcp-use/utils` to streamline proxy configuration in the Inspector components.
- Updated `vite.config.ts` to include the new utility path and optimize dependencies.
- Refactored `InspectorDashboard` and `McpContext` to utilize the new `applyProxyConfig` function for cleaner URL and header management.
- Mounted MCP proxy middleware in `shared-routes.ts` to handle proxy requests more efficiently.
- Exported utility functions from `mcp-use` for better accessibility across the project.

* feat(auth): add OAuth token handling to useMcp hook

- Introduced `authTokens` state in the `useMcp` hook to store OAuth tokens upon successful authentication.
- Updated the `UseMcpResult` type to include `authTokens` for better integration with OAuth workflows.
- Enhanced error handling in the `HttpConnector` by removing SSE fallback message for clarity.

* feat(inspector): add server icon support in Inspector components

- Enhanced `ServerIcon` component to accept a `serverIcon` prop for displaying a Base64-encoded icon.
- Updated `InspectorDashboard` and `ServerList` components to pass the `serverIcon` from `connection.serverInfo`.
- Introduced `ensureIconLoaded` method in `useMcp` hook to manage icon loading and availability.
- Added utility function for favicon detection to improve icon handling.

* fix(inspector): clean up imports and enhance component structure

- Removed duplicate imports in `ServerList.tsx` for better clarity and organization.
- Adjusted the export statement in `index.ts` to ensure `proxy-config.js` is included, improving utility accessibility.
- Reformatted import statements in `types.ts` for consistency and readability.

* feat(inspector): implement embedded mode support and enhance component interactions

- Added support for embedded mode in the `App`, `Layout`, and `McpProvider` components, allowing for dynamic configuration based on URL parameters.
- Updated `LayoutHeader` and `AddToClientDropdown` components to conditionally render elements based on the embedded state, improving user experience in embedded contexts.
- Refactored utility functions for generating deep links and configuration commands to streamline integration with various clients.
- Introduced new utility functions in `mcpClientUtils` for better handling of server configurations and commands.

* chore: changeset

* chore(typescript): version packages (canary)

* fix(inspector): update root path redirection to preserve query parameters

* chore: changeset (#731)

* chore(typescript): version packages (canary)

* Potential fix for code scanning alert no. 55: Shell command built from environment values

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>

* Feat/client-react-provider (#733)

* refactor(inspector): enhance application structure and multi-server support

- Introduced McpClientProvider to manage multiple MCP server connections, allowing dynamic addition and removal of servers.
- Updated App component to include McpClientProvider and reorganized routing structure for better clarity.
- Refactored InspectorDashboard to simplify server connection handling and improve UI responsiveness.
- Enhanced McpContext to support new server management features, including notification and request handling.
- Added a new example demonstrating multi-server management in a React application.

This refactor improves the overall architecture and usability of the inspector, facilitating better server management and user experience.

* refactor(inspector): update components for improved server management and UI enhancements

- Refactored App component to integrate LocalStorageProvider for managing server connections.
- Updated InspectorDashboard and related components to utilize new McpClientProvider for better server state handling.
- Simplified connection settings by removing deprecated transport types and ensuring consistent use of HTTP.
- Enhanced CommandPalette and ServerDropdown components to improve server icon handling and display.
- Removed obsolete McpContext and adjusted imports across components for cleaner architecture.

These changes enhance the overall structure and usability of the inspector, facilitating better server management and user experience.

* feat(logging): filter out noisy endpoints from request logging

- Added functionality to skip logging for specific noisy endpoints that generate excessive log entries, such as telemetry and RPC stream paths.
- Ensured that requests to these paths are still processed without logging, improving log clarity and reducing spam.

* feat(logging): enhance debugging in Layout and useAutoConnect components

- Added detailed logging in the Layout component to track MCP client context values, including server status and storage loading.
- Improved logging in the useAutoConnect hook to provide insights during the auto-connect process, including checks for configuration loading and query parameters.
- These enhancements facilitate better debugging and monitoring of server connection states and application behavior.

* fix(inspector): correct server connection retrieval in OpenAIComponentRenderer

- Updated the method for retrieving the server connection in OpenAIComponentRenderer to directly access the connections array, improving clarity and functionality in server management.

* feat(mcp-agent): export MCPAgent for browser usage with BrowserMCPClient

- Updated the browser entry point to export MCPAgent, enabling its use in the browser when provided with a BrowserMCPClient instance or through RemoteAgent.
- Adjusted import statements in mcp_agent.ts to dynamically import MCPClient, ensuring compatibility with browser environments.

* feat(inspector): enhance UI components and improve responsiveness

- Updated AddToClientDropdown to include new icons and improved button layout for better user experience.
- Adjusted LayoutHeader to change visibility of the Github label based on screen size.
- Refactored LogoAnimated to hide additional information on smaller screens.
- Enhanced PromptsTab and ResourcesTab with new imports and improved error handling for results.
- Updated ServerDropdown to adjust padding for better alignment.
- Improved ToolsTab with additional imports and responsive design adjustments.

These changes collectively enhance the user interface and responsiveness of the inspector components.

* fix(inspector): resolve layout issues in responsive components

- Corrected alignment and visibility issues in various inspector components to enhance user experience on different screen sizes.
- Adjusted styles in AddToClientDropdown, LayoutHeader, and ServerDropdown for improved responsiveness.
- Ensured consistent behavior across PromptsTab and ResourcesTab with better error handling.

These fixes collectively improve the layout and usability of the inspector on various devices.

* fix(server-lifecycle): remove SSE endpoint from server startup logs

- Updated the server startup log message to exclude the SSE endpoint, simplifying the output for clarity.
- This change enhances the readability of the server's listening information during startup.

* feat(inspector): add global sampling and elicitation request handling

- Implemented toast notifications for sampling and elicitation requests in the App component, enhancing user interaction and response management.
- Updated McpClientProvider to support global callbacks for handling sampling and elicitation requests, allowing for centralized processing.
- Refactored server handling in McpServerWrapper to include new global request handlers, improving the overall request management architecture.
- Adjusted package.json scripts in the elicitation example for consistency with the mcp-use command structure.

These changes collectively improve the user experience by providing immediate feedback on sampling and elicitation requests, while also enhancing the underlying architecture for better request handling.

* chore(typescript): version packages (canary)

* feat(inspector): enhance URL parameter handling in Inspector components

- Updated InspectorDashboard, Layout, and useAutoConnect to preserve both tunnelUrl and tab parameters in navigation.
- Improved query parameter management by utilizing URLSearchParams for cleaner and more maintainable code.
- Added validation for tab parameters to ensure only valid tab types are set, enhancing user experience and navigation consistency.

* chore(typescript): version packages (canary)

* feat(inspector): improve URL navigation handling in useAutoConnect hook

- Enhanced the useAutoConnect hook to utilize URLSearchParams for constructing navigation URLs, preserving tunnelUrl and tab parameters.
- This change simplifies the URL management and improves the overall user experience during navigation.

* chore(typescript): version packages (canary)

* feat(inspector): update AddToClientDropdown and LayoutHeader for improved SDK integration

- Modified AddToClientDropdown to accept serverId and enhance dropdown item handling.
- Updated LayoutHeader to integrate TypeScript and Python SDK options, improving user experience for adding clients.
- Enhanced modal rendering and button interactions for better usability.
- Adjusted code formatting in dropdown content for improved readability.

* fix(inspector): resolve layout and responsiveness issues in inspector components

- Corrected alignment and visibility problems in AddToClientDropdown, LayoutHeader, and ServerDropdown for improved user experience across devices.
- Enhanced error handling in PromptsTab and ResourcesTab to ensure consistent behavior.
- Adjusted styles for better responsiveness and usability in various screen sizes.

* chore(typescript): version packages (canary)

* fix(http): reduce default timeout for HttpConnector from 30 seconds to 10 seconds and adjust connection timeout handling

* chore(typescript): version packages (canary)

* fix(react): optimize mcpOptions handling in McpClientProvider to prevent render loops

- Memoized the options passed to useMcp to avoid unnecessary re-renders.
- Extracted callback options to streamline the component's performance.

* fix(react): prevent duplicate scheduling of auto-retry in useMcp hook

- Introduced a ref to track if a retry is already scheduled, avoiding potential render loops.
- Reset the scheduling ref when the connection state changes from failed to another state.

* fix(react): enhance state management in McpClientProvider and useMcp hook

- Renamed variable for clarity in McpClientProvider to improve readability.
- Updated state comparison logic to use a single reference for previous server state, reducing redundancy.
- Introduced refs for function callbacks in useMcp to prevent stale closures and circular dependencies.
- Ensured that retry logic utilizes updated refs to maintain correct behavior during connection attempts.

* fix(react): improve error handling and state management in useMcp hook

- Enhanced error handling logic in useMcp to provide clearer feedback during connection failures.
- Updated state management to ensure accurate tracking of connection status and retries.
- Refactored code for better readability and maintainability.

* chore(typescript): version packages (canary)

* Refactor: Use 'open' package to open browser

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

* feat(widgets): enhance HMR configuration for better cross-platform support

- Added explicit HMR configuration with WebSocket protocol for improved compatibility.
- Enabled polling for file watching on Linux to address reliability issues in various environments.
- Set polling interval to 100ms for more responsive updates during development.

* feat(inspector): add parsePortFromArgs function to handle port argument parsing

- Introduced a new utility function to parse the port from command line arguments, allowing for dynamic port configuration.
- Updated server.ts to import the new function for enhanced server setup flexibility.

* chore(typescript): version packages (canary)

* 📝 Add docstrings to `canary`

Docstrings generation was requested by @tonxxd.

* https://github.com/mcp-use/mcp-use/pull/730#issuecomment-3711382419

The following files were modified:

* `libraries/typescript/packages/inspector/src/client/App.tsx`
* `libraries/typescript/packages/inspector/src/client/components/CommandPalette.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ConnectionSettingsForm.tsx`
* `libraries/typescript/packages/inspector/src/client/components/InspectorDashboard.tsx`
* `libraries/typescript/packages/inspector/src/client/components/Layout.tsx`
* `libraries/typescript/packages/inspector/src/client/components/LayoutHeader.tsx`
* `libraries/typescript/packages/inspector/src/client/components/LogoAnimated.tsx`
* `libraries/typescript/packages/inspector/src/client/components/OpenAIComponentRenderer.tsx`
* `libraries/typescript/packages/inspector/src/client/components/PromptsTab.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ResourcesTab.tsx`
* `libraries/typescript/packages/inspector/src/client/components/SdkIntegrationModal.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ServerCapabilitiesModal.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ServerConnectionModal.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ServerDropdown.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ServerIcon.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ServerList.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ToolsTab.tsx`
* `libraries/typescript/packages/inspector/src/client/components/chat/AssistantMessage.tsx`
* `libraries/typescript/packages/inspector/src/client/components/logging/JsonRpcLoggerView.tsx`
* `libraries/typescript/packages/inspector/src/client/components/prompts/PromptMessageCard.tsx`
* `libraries/typescript/packages/inspector/src/client/components/prompts/PromptResultDisplay.tsx`
* `libraries/typescript/packages/inspector/src/client/components/shared/MarkdownRenderer.tsx`
* `libraries/typescript/packages/inspector/src/client/components/ui/client-icons.tsx`
* `libraries/typescript/packages/inspector/src/client/context/InspectorContext.tsx`
* `libraries/typescript/packages/inspector/src/client/hooks/useAutoConnect.ts`
* `libraries/typescript/packages/inspector/src/server/server.ts`
* `libraries/typescript/packages/inspector/src/server/shared-static.ts`
* `libraries/typescript/packages/inspector/src/server/shared-utils-browser.ts`
* `libraries/typescript/packages/inspector/src/server/utils.ts`
* `libraries/typescript/packages/mcp-use/src/agents/utils/llm_provider.ts`
* `libraries/typescript/packages/mcp-use/src/logging.ts`
* `libraries/typescript/packages/mcp-use/src/observability/langfuse.ts`
* `libraries/typescript/packages/mcp-use/src/react/McpClientProvider.tsx`
* `libraries/typescript/packages/mcp-use/src/react/rpc-logger.ts`
* `libraries/typescript/packages/mcp-use/src/server/logging.ts`
* `libraries/typescript/packages/mcp-use/src/server/utils/server-lifecycle.ts`
* `libraries/typescript/packages/mcp-use/src/server/widgets/mount-widgets-dev.ts`
* `libraries/typescript/packages/mcp-use/src/telemetry/telemetry-browser.ts`
* `libraries/typescript/packages/mcp-use/src/telemetry/telemetry-node.ts`
* `libraries/typescript/packages/mcp-use/src/utils/favicon-detector.ts`
* `libraries/typescript/packages/mcp-use/src/utils/mcpClientUtils.ts`

* feat(inspector, layout): implement updateServer functionality for connection management

- Added `updateServer` method to handle server configuration updates in both InspectorDashboard and Layout components.
- Introduced state management to track concurrent updates and prevent race conditions during connection updates and reconnections.
- Enhanced error handling for connection updates to provide clearer feedback in case of failures.

* fix: ensure consistent formatting by adding missing newlines at the end of multiple files

- Added newlines at the end of several TypeScript files to adhere to coding standards and improve compatibility with various tools.
- Files modified include components, hooks, and server utilities across the inspector and mcp-use packages.

* chore(typescript): version packages (canary)

* chore(deps): add @types/node@25.0.2 to package.json and pnpm-lock.yaml

* chore(typescript): version packages (canary)

* refactor: update modelcontextprotocol-sdk references to new package name

- Replaced all instances of `@mcp-use/modelcontextprotocol-sdk` with `@modelcontextprotocol/sdk` across various files.
- Updated version in `package.json` and `pnpm-lock.yaml` to `1.25.1`.
- Adjusted import paths in components, utilities, and tests to reflect the new package structure.
- Ensured compatibility with existing code by maintaining type imports and functionality.

* feat(inspector): enhance client configuration and UI components

- Added support for client exports in the build process by introducing a new build script for client exports in `package.json`.
- Enhanced the `CommandPalette` and `SdkIntegrationModal` components to utilize local utility functions instead of external dependencies.
- Introduced a new CSS animation for status indicators in `index.css`.
- Updated the `LayoutHeader` component to conditionally display notification dots based on tab activity.
- Removed the deprecated `AddToClientDropdown` component and adjusted related imports accordingly.
- Improved client configuration examples in the `notification-client` and `sampling-client` files to include client identification for better server-side logging.
- Cleaned up unused imports and ensured consistent formatting across several files.

* fix: pin zod version to 3.24.4 for compatibility with modelcontextprotocol/sdk

- Updated the temporary deno.json in the TypeScript PR preview workflow to use zod@3.24.4, ensuring compatibility with @modelcontextprotocol/sdk@1.25.1.
- Adjusted import URLs to include the pinned zod version as a dependency.

* chore(typescript): version packages (canary)

* fix: update zod version handling in TypeScript PR preview workflow

- Modified the temporary deno.json to use zod from npm instead of pinning to a specific version, resolving potential version conflicts between mcp-use and @modelcontextprotocol/sdk.
- Adjusted import paths to accommodate the new zod versioning and subpath imports.

* fix: refine zod version mapping in TypeScript PR preview workflow

- Updated the temporary deno.json to implement a hybrid mapping for zod, addressing conflicting version requirements between SDK and other dependencies.
- Adjusted import paths to ensure compatibility with both zod v3 and v4, utilizing esm.sh for consistent environment resolution.

* fix: enhance zod version mapping in TypeScript PR preview workflow

- Updated the deno.json to include additional zod subpath imports, ensuring compatibility with both zod v4 and its mini version.
- Adjusted import URLs to reflect the new zod versioning structure, maintaining consistency in the PR preview environment.

* docs: add troubleshooting section for Zod version conflicts in Supabase deployment

- Introduced a new section addressing the "custom is not a function" error related to Zod version conflicts during Deno/Supabase deployments.
- Provided solutions for using npm specifiers in deno.json to resolve compatibility issues between Zod v3 and v4.
- Included example configurations for both npm and esm.sh imports to guide users in managing dependencies effectively.

* chore(typescript): version packages (canary)

* docs: update inspector documentation and changelog

- Added a new "Changelog" section to the inspector documentation for version history and updates.
- Expanded the changelog with multiple updates, including bug fixes, documentation enhancements, and major improvements in browser compatibility and multi-server support.

* docs: improve elicitation documentation for TypeScript client

- Enhanced clarity and formatting in the elicitation documentation, including better structure for modes and parameters.
- Updated code examples for consistency in quotation marks and improved readability.
- Added notes on validation flows and best practices for client-side and server-side validation.
- Ensured all sections are clearly defined and easy to follow for users implementing elicitation in their applications.

* docs: format pages in docs.json for improved readability

- Reformatted the "pages" entries in the docs.json file to use a consistent multi-line structure for better clarity and organization.
- Ensured all groups have a uniform format, enhancing the overall maintainability of the documentation structure.

* ci: add dev command testing to CI workflow

- Implemented a new job in the CI workflow to test the development command without the --dev flag.
- The job starts the dev server in the background, waits for it to initialize, and then stops it, ensuring the server starts and stops successfully.
- Adjusted the shell option in the TypeScript CLI to use the platform-specific shell on Windows for better compatibility.

* ci: add dev command testing to CI workflow & fix issue [#742](https://github.com/mcp-use/mcp-use/issues/742)

* chore(typescript): version packages (canary)

* fix(ci): improve Windows process termination in CI workflow

- Enhanced the method for killing the development server on Windows by using port-based identification for more reliable process termination.
- Added a fallback to the existing process tree kill method to ensure robustness in stopping the server.

* chore(typescript): version packages (canary)

* chore(docs): update changelog for TypeScript and inspector

- Updated changelog entries for TypeScript and inspector documentation to include new features, enhancements, and bug fixes.
- Improved clarity by adding descriptions to version labels and restructuring sections for better readability.
- Notable updates include multi-server support, browser compatibility improvements, and enhanced RPC logging.

* chore(docs): update changelog for inspector and TypeScript

- Revised changelog entries to reflect recent updates, including new features, enhancements, and bug fixes.
- Improved organization and clarity of version labels and descriptions.
- Notable changes include the addition of browser telemetry, improved server middleware, and various bug fixes across components.

---------

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: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: tonxipad <tonxipad@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-01-06 10:11:10 +01:00
Enrico Toniato 6ec11cdae2 Canary (#617)
* Fix/server/reafctor complete (#616)

* 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

* refactor(typescript): clean up mcp-use package structure and enhance type exports

- Removed deprecated '@mcp-use/cli' and 'tsx' from devDependencies in package.json and pnpm-lock.yaml.
- Reorganized type exports in mcp-server.ts to improve clarity and accessibility of ToolContext-related types.
- Refactored logging.ts to utilize a centralized getEnv function for environment variable access.
- Updated imports in various files to reflect the new structure and removed unused code.
- Deleted the mcp-ui-adapter.ts file as it was no longer needed.

* feat(typescript): enhance mcp-use package with new dependencies and refactor server endpoints

- Added 'express' as a dependency in package.json and updated its version to 5.2.1.
- Introduced new dependencies for examples in the mcp-use package, including '@openai/apps-sdk-ui', '@tanstack/react-query', and others.
- Refactored server endpoint handling by consolidating request/response management and removing deprecated handlers.
- Improved logging functionality with a new truncate method for better JSON output.
- Cleaned up unused code and removed legacy endpoint files to streamline the package structure.

* feat(mcp-server): enhance session handling with context-aware tool registration

- Introduced context enhancement for tool handlers in the MCP server to support session-specific logic.
- Added utility functions for session context management and improved message creation within session scope.
- Refactored tool registration to wrap handlers with context-aware logic, enabling better handling of request metadata and notifications.

* feat(mcp-use): update @modelcontextprotocol/sdk version and refactor server handling

- Updated the @modelcontextprotocol/sdk dependency to version 1209 in package.json and pnpm-lock.yaml.
- Adjusted the server port in the elicitation example from 3002 to 3000 for consistency.
- Enhanced the MCP server's session handling to follow the official SDK pattern, ensuring each session has its own transport and server instance.
- Refactored the mountMcp function to utilize FetchStreamableHTTPServerTransport, improving bidirectional communication and simplifying request handling.
- Cleaned up deprecated Express-like request/response handling, streamlining the server's architecture.

* feat(mcp-server): integrate ResourceTemplate and refactor resource registration

- Imported ResourceTemplate from the SDK to enhance resource handling.
- Updated resource registration to use readCallback instead of cb for improved clarity.
- Created ResourceTemplate instances and associated metadata during resource registration, streamlining the process and ensuring better integration with the SDK.

* refactor(mcp-use): streamline server examples and update dependencies

- Removed deprecated '@mcp-use/cli' and 'tsx' from devDependencies in package.json and pnpm-lock.yaml.
- Refactored server examples to utilize new response helpers for consistency and clarity.
- Updated the MCP server examples to improve structure and remove unnecessary code.
- Enhanced the resource and prompt registration to support new callback patterns, ensuring better integration with the SDK.
- Cleaned up unused files related to elicitation tests, improving overall package organization.

* feat(mcp-use): enhance server tools and improve type handling

- Added new server tools with optional message parameters, providing default values for better usability.
- Refactored server example files to streamline tool definitions and improve clarity.
- Updated type exports to include new utility types for handling optional fields in Zod schemas, enhancing type safety and flexibility in callbacks.
- Improved server initialization by removing hardcoded port values, allowing for dynamic port assignment.
- Cleaned up unnecessary console logs and comments to enhance code readability.

* refactor(mcp-use): enhance context handling in server tools and resource registration

- Removed redundant tool definitions in server examples to streamline code.
- Improved type handling by introducing EnhancedPromptContext and EnhancedResourceContext for better access to request context.
- Updated callback signatures in resource and prompt definitions to support context-aware execution.
- Enhanced error handling and response management in server tools for improved reliability.

* refactor(mcp-use): improve context management and streamline server tools

- Enhanced context handling in server tools by refining callback signatures and introducing new context types.
- Streamlined server examples by removing redundant tool definitions and improving error handling.
- Updated resource and prompt registration processes for better integration and reliability.

* chore(conformance): remove branch restrictions from push and pull_request triggers

- Eliminated specific branch filters for push and pull_request events in the conformance workflow, allowing for broader execution on any branch changes.

* only those branches

* default 3000

* fix: update default port from 3001 to 3000 across various components

- Changed default URL and port settings in ConnectionSettingsForm, middleware, and example scripts to use port 3000.
- Updated related documentation and comments to reflect the new default port for consistency.

* fix(conformance): set TypeScript server port to 3000 for conformance tests

- Updated the conformance workflow to explicitly set the TypeScript server to run on port 3000, ensuring consistency with recent changes across components.

* chore: update @modelcontextprotocol/sdk version in package files

- Updated the version of @modelcontextprotocol/sdk from 1194 to 1209 in pnpm-lock.yaml, package.json, and deno.json to reflect the latest changes in the SDK.

---------

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(docs): update sampling link in elicitation documentation (#618)

- Changed the sampling link in the elicitation documentation to point to the correct GitHub repository path for LLM completions, ensuring users have access to the latest examples and resources.

* Fix/server/increase conformance score (#619)

* feat(server): enhance conformance server with new audio and logging tools

- Added a new tool for returning silent audio content in WAV format.
- Updated the image tool to include a more descriptive name.
- Introduced a tool that simulates logging during execution, providing console output for tool processing steps.
- Enhanced the mixed content tool to support multiple content types, including text, image, and resource data.
- Updated prompt handling to accept new argument names for better clarity.

* refactor(mcp-server): enhance schema handling for prompts and server configuration

- Updated schema handling in McpServer and prompt registration to create parameter schemas when arguments are provided.
- Improved error handling by setting argsSchema to undefined when no schema or arguments are available, ensuring clearer validation logic.
- Refactored regex pattern in server helpers to correctly replace parameter placeholders, enhancing template URI parsing.

* feat(server): enhance audio handling and logging capabilities

- Introduced a new audio tool for returning audio content, supporting both base64 data and file paths.
- Updated server tools to utilize a logging mechanism that sends log notifications during execution.
- Enhanced resource handling to support new content types and improved error handling for logging levels.
- Refactored existing tools to streamline code and improve clarity in tool definitions.

* feat(server): implement resource subscription management and dynamic updates

- Added a new subscribable resource that can be updated and subscribed to by clients.
- Introduced a tool for updating the subscribable resource, notifying all subscribers of changes.
- Enhanced session management by cleaning up resource subscriptions when sessions are closed.
- Updated context storage to include optional session IDs for better tracking.
- Refactored idle cleanup to support session-specific resource subscription cleanup.

* feat: enhance conformance workflow with dynamic badge generation for Python and TypeScript

- Added new steps in the GitHub Actions workflow to calculate and create conformance badges for both Python and TypeScript based on test results.
- Updated README.md to include links and badges for Python and TypeScript conformance, providing users with immediate feedback on test status.

* fix action uses

* fix: update conformance workflow badge calculations and labels

- Changed the conformance badge calculation to use integer scaling for percentage rates.
- Adjusted the passing rate threshold from 80% to 60% for badge color determination.
- Updated badge labels for Python and TypeScript to reflect "MCP Conformance" instead of just the language.

* fix: enable conformance comments on forked PRs with two-workflow pattern

- Split conformance workflow into test execution and comment posting
- Created conformance-comment.yml with workflow_run trigger for full permissions
- Upload PR metadata and parsed results as artifacts
- Updated badge labels to 'MCP Conformance (TS)' and 'MCP Conformance (PY)'
- Fixed badge colors: green at 100%, yellow ≥60%, red <60%
- Resolves permission errors when posting comments on forked PRs

* feat(server): update serverBaseUrl to use environment variable helper (#625)

* feat(server): update serverBaseUrl to use environment variable helper

- Implemented a helper function to set serverBaseUrl based on MCP_URL environment variable, ensuring correct public URL usage for widgets/assets.

* fix(server): improve error handling and logging for resource management

- Enhanced error handling in resource subscription management to ensure clearer validation and logging.
- Updated logging mechanisms to provide better insights during execution, particularly for resource updates and session management.
- Refactored code for improved clarity and maintainability in server tools.

* chore(typescript): version packages (canary)

* fix: prevent code injection in conformance-comment workflow

Use environment variables instead of direct string interpolation to pass
PR metadata to the github-script action, preventing potential code injection
from untrusted input.

Addresses CodeQL security findings.

* chore: trigger conformance workflow

* feat: allow conformance comment workflow to run on push events

- Remove pull_request-only restriction from workflow trigger
- Make PR metadata download and comment posting conditional
- Workflow now runs for both push and pull_request events
- For push events, workflow completes without posting comment
- Badges remain branch-specific per existing logic in conformance.yml

* fix: revert comment workflow to PR-only events

- Comment workflow only runs for pull_request events (not push)
- For push events, there's no PR to comment on
- Conformance workflow already runs on all branch pushes for iteration
- Badges remain branch-specific (only updated for main/canary pushes)

* Docs/refactor (#633)

* quickstart

* chore: update documentation and assets

- Renamed "Getting Started" group to "Get Started" in docs.json.
- Added new SVG logo for MCP use and several images for TypeScript documentation.
- Created a new changelog file for tracking updates and improvements.
- Removed outdated security and logging documentation, and updated links in various guides.
- Introduced new response helpers and improved server logging documentation.
- Enhanced the UI widgets section to support OpenAI Apps SDK with zero boilerplate.

* refactor: update MCP server instantiation to use class constructor

- Replaced instances of `createMCPServer` with the new `MCPServer` class constructor across documentation and example files.
- Updated related documentation to reflect the new instantiation method, enhancing clarity and consistency.
- Ensured backward compatibility by retaining the `createMCPServer` function for legacy support.

* refactor: standardize MCPServer instantiation in documentation

- Updated examples to utilize the new `MCPServer` class constructor instead of the legacy `createMCPServer` function.
- Enhanced documentation clarity by providing consistent usage patterns and emphasizing the recommended instantiation method.
- Maintained backward compatibility by retaining the legacy function for existing users.

* refactor: update subscribable resource schema to use default value

- Changed the `newValue` property in the subscribable resource schema to have a default value of "Updated value".
- Updated the async function to utilize the default value, simplifying the parameter handling.

* refactor: enhance type inference and callback signatures for resource templates

- Updated the `registerResourceTemplate` function to support multiple callback signatures, improving type inference for developers.
- Removed the deprecated `ReadResourceTemplateCallbackBivariant` interface to streamline the codebase.
- Adjusted the handling of `uri` and `variables` in the server example to ensure non-null assertions, enhancing type safety.

* refactor: improve resource template registration and type safety

- Enhanced the `registerResourceTemplate` function to better support multiple callback signatures, improving developer experience.
- Removed the obsolete `ReadResourceTemplateCallbackBivariant` interface to clean up the codebase.
- Updated the handling of `uri` and `variables` in the server example to enforce non-null assertions, boosting type safety.

* chore(typescript): version packages (canary)

* refactor: streamline async callback syntax in server tools

- Updated async callback definitions in various server tools to improve consistency and readability.
- Removed unnecessary line breaks and streamlined the structure of callback functions across multiple files.
- Enhanced overall code clarity while maintaining existing functionality.

* refactor: enhance async callback handling in server tools

- Improved the structure and readability of async callback functions in server tools.
- Standardized callback definitions across multiple files for better consistency.
- Maintained existing functionality while enhancing code clarity.

* feat: add weather tools and manual widget registration

- Introduced two new server tools: `get-current-weather` and `get-weather-forecast`, utilizing the `weather-display` widget.
- Updated the README to include a manual tool registration pattern for widgets that do not auto-register.
- Enhanced the example structure to demonstrate custom tool usage and widget integration.
- Improved documentation clarity regarding widget registration and usage patterns.

* refactor: simplify input schema for get-current-weather tool

- Replaced the manual input definition with a Zod schema for the `get-current-weather` tool, enhancing type safety and readability.
- Streamlined the async callback function by removing explicit type annotations for inputs, improving code clarity.

* refactor: enhance type safety and structure in MCPServer resource registration

- Updated the `resource` and `resourceTemplate` methods in `MCPServer` to use generic types for improved type safety and clarity.
- Refactored the `uiResourceRegistration` function to accept a more generalized server context, enhancing compatibility with various resource definitions.
- Renamed `UIResourceServerContext` to `UIResourceServer` for better alignment with its purpose and updated its interface to reflect the new structure.
- Improved overall code readability and maintainability by streamlining method signatures and enhancing type definitions.

* Chore/typescript/any (#634)

* fix: add noZoom attribute to images in SimpleSplitCard component

- Added the `noZoom` attribute to image elements in the `SimpleSplitCard` component to prevent zooming effects on hover.
- Updated image tags for both light and dark mode images, as well as logos in the action links, ensuring consistent behavior across the component.

* refactor: enhance type safety and error handling in result displays

- Updated the `PromptResult`, `ResourceResult`, and `ToolResult` interfaces to use specific types instead of `any`, improving type safety.
- Refactored error handling in the `extractErrorMessage` functions across multiple components to handle new result structures, ensuring consistent error messaging.
- Improved the handling of result properties in the `onCopy` callbacks to align with the updated types, enhancing overall code clarity and maintainability.

* refactor: improve error handling and type definitions in result processing

- Enhanced error handling in the `extractErrorMessage` functions to accommodate updated result structures, ensuring consistent messaging.
- Updated `PromptResult`, `ResourceResult`, and `ToolResult` interfaces to utilize specific types, improving type safety.
- Refactored `onCopy` callbacks to align with new type definitions, enhancing code clarity and maintainability.

* chore(typescript): version packages (canary)

* fix typo

* Fix/mcp use/typing (#636)

* refactor: remove get-weather-forecast tool and update MCPServer class structure

- Removed the `get-weather-forecast` tool implementation from the server example, streamlining the codebase.
- Refactored the `MCPServer` class to `MCPServerClass` for improved clarity and updated type definitions for better type safety.
- Enhanced the `WidgetMetadata` interface to include new properties for input validation and annotations, aligning with tool naming conventions.

* refactor: enhance widget registration logic and metadata handling

- Updated the `uiResourceRegistration` function to conditionally register tools based on the `exposeAsTool` flag, improving flexibility in widget registration.
- Refactored the handling of tool metadata, ensuring that relevant fields from `appsSdkMetadata` are copied only when necessary.
- Enhanced the `createWidgetRegistration` function to extract and utilize the `exposeAsTool` flag from metadata, defaulting to true if not specified, for consistent behavior across widgets.

* feat: add tool annotations and exposeAsTool flag to resource definition

- Introduced `exposeAsTool` and `toolAnnotations` properties to the `BaseUIResourceDefinition` interface, allowing for more flexible tool registration.
- Updated the `uiResourceRegistration` function to utilize the new `exposeAsTool` property directly from the resource definition, enhancing the registration logic.

* feat: enhance widget integration and tool metadata handling

- Added support for returning interactive UI widgets from tools using the `widget()` helper and `returnsWidget` option, improving user experience in the Inspector and ChatGPT.
- Updated documentation to clarify the usage of the `widget` configuration in tool definitions, including examples for better understanding.
- Enhanced the `MCPServer` class to manage widget definitions and inject metadata into tool responses, streamlining the integration of custom tools with widgets.
- Improved type definitions for tools and widgets, ensuring better type safety and clarity in the codebase.

* Fix/server/oauth (#637)

* refactor: enhance MCPServerClass with generic OAuth support

- Updated the `MCPServerClass` to support generics for OAuth, improving type safety and flexibility in tool and resource registration methods.
- Refactored method signatures for `tool`, `prompt`, `resource`, and `resourceTemplate` to utilize the new `HasOAuth` type parameter, ensuring consistent behavior based on OAuth configuration.
- Adjusted the `McpServerInstance` and `MCPServer` types to reflect the new generic structure, enhancing clarity in type annotations for server instances.

* refactor: simplify OAuth handling in MCPServerClass

- Removed the unused `oauthConfig` property and streamlined the OAuth setup logic by directly using `oauthProvider`.
- Updated conditional checks for OAuth setup to enhance clarity and reduce redundancy in the codebase.

* chore(ci): add --dev flag to create-mcp-use-app commands in CI workflow

- Updated the CI workflow to include the `--dev` flag in both npm and yarn commands for creating test applications, ensuring development dependencies are installed correctly.

* chore(ci): update CI workflow to build and pack all packages

- Modified the CI workflow to build all packages in the TypeScript library and pack individual packages, including `create-mcp-use-app`, `mcp-use`, `@mcp-use/cli`, and `@mcp-use/inspector`.
- Updated artifact upload and download steps to handle multiple package artifacts, ensuring all necessary packages are available for testing.
- Added a step to replace workspace dependencies with file references in `package.json` for both npm and yarn test applications, improving dependency management.

* chore(ci): improve PACKAGE_PATH resolution in CI workflow

- Updated the CI workflow to enhance the resolution of the PACKAGE_PATH variable for the create-mcp-use-app package.
- Modified the logic to handle cases where multiple package files exist, ensuring the first available package is used, improving reliability in the build process.

* chore(ci): refine PACKAGE_PATH resolution in CI workflow

- Enhanced the logic for determining the PACKAGE_PATH variable in the CI workflow to ensure it correctly identifies the first available create-mcp-use-app package file, regardless of the operating system.
- Updated commands to use more reliable methods for file searching, improving consistency and robustness in the build process.

* chore(ci): update PACKAGE_PATH resolution to use realpath in CI workflow

- Modified the CI workflow to utilize `realpath` for resolving the PACKAGE_PATH variable, ensuring accurate file paths for the create-mcp-use-app package across different operating systems.
- This change enhances the reliability of package path resolution in both npm and yarn commands, improving the overall consistency of the build process.

* chore(ci): refine tarball path resolution in CI workflow

- Updated the CI workflow to improve the resolution of tarball paths for `mcp-use`, `mcp-use-cli`, and `mcp-use-inspector` packages by using `find` to ensure the first available package is correctly identified.
- This change enhances the reliability of package path resolution, ensuring accurate file paths are used during the build process.

* chore(ci): add .actrc configuration for local development

- Introduced a new `.actrc` file to configure the local development environment for CI workflows, specifying the use of a custom Ubuntu image and container architecture.
- Updated the CI workflow to replace workspace dependencies with file references in `package.json`, enhancing consistency across different environments.
- Adjusted links in documentation to ensure accurate navigation, including updates to security guides and logging resources.

* fix(docs): clean up formatting and update redirects in documentation

- Removed unnecessary blank lines in the documentation JSON file for improved readability.
- Updated the redirects section to ensure proper formatting and consistency in the structure.

* refactor(ci): enhance CI workflow for package management and path resolution (#638)

- Improved the CI workflow to ensure accurate resolution of package paths for `create-mcp-use-app`, `mcp-use`, and related packages, enhancing reliability during builds.
- Updated commands to utilize more robust methods for identifying package files, ensuring consistency across different environments.
- Streamlined the process for building and packing all necessary packages, improving overall dependency management and artifact handling.

* chore(typescript): version packages (canary)

* Chore/deps/fork (#640)

* chore(deps): update @modelcontextprotocol/sdk dependency and add new packages

- Removed the MCP SDK update workflow as it is no longer needed.
- Updated the @modelcontextprotocol/sdk dependency in multiple package.json files to point to the new GitHub repository.
- Added new dependencies: glob and js-yaml, with specified version ranges.
- Updated peer dependencies for express to support version 5.0.0.
- Cleaned up package-lock files to reflect the new dependency structure.

* chore(ci): optimize CI workflow for package path resolution and build process

- Enhanced the CI workflow to improve package path resolution, ensuring accurate identification of package files across different environments.
- Streamlined the build process for all necessary packages, improving reliability and consistency during builds.
- Updated commands to utilize more robust methods for file searching, enhancing overall dependency management.

* chore(typescript): version packages (canary)

* chore(typescript): update package references to mcp-use/modelcontextprotocol-sdk (#641)

- Changed all instances of @modelcontextprotocol/sdk to @mcp-use/modelcontextprotocol-sdk across various files.
- Updated package.json files to reflect the new package versioning and structure.
- Enhanced import paths in multiple components and utilities to ensure compatibility with the new SDK structure.
- Added new dependencies and updated existing ones in the pnpm-lock.yaml file for consistency.

* chore(typescript): version packages (canary)

* feat: Improve typescript tel (#642)

* feat: add telemetry event classes and interfaces for server and client interactions

- Introduced new telemetry event classes: `ServerRunEvent`, `ServerInitializeEvent`, `ServerToolCallEvent`, `ServerResourceCallEvent`, `ServerPromptCallEvent`, `ServerContextEvent`, `MCPClientInitEvent`, and `ConnectorInitEvent`.
- Added corresponding data interfaces for each event to enhance type safety and structure.
- Updated the `Telemetry` class to include methods for tracking these new events, improving the telemetry system's capabilities.
- Enhanced the `index.ts` file to export the new event classes and types for easier access throughout the library.

* feat(telemetry): add isEnabled check to telemetry methods

* fix: snake case properties

* feat(telemetry): add MCPServer telemetry interface and data extraction method

- Introduced the `MCPServerTelemetryInfo` interface to encapsulate necessary data for telemetry tracking from an MCPServer instance.
- Added the `createServerRunEventData` function to centralize data extraction from MCPServer-like objects, enhancing the telemetry layer's functionality.
- Updated the `Telemetry` class with a new method, `trackServerRunFromServer`, to track server run events directly using the new interface and extraction method.

* feat(telemetry): enhance telemetry tracking for MCPClient and connectors

- Integrated telemetry tracking for MCPClient initialization, connector initialization, and server events.
- Added methods to track server runs, tool calls, prompt calls, and resource calls, improving observability of client-server interactions.
- Updated the HttpConnector, StdioConnector, and BaseConnector classes to utilize the new tracking methods.
- Enhanced MCPServer to log server initialization and execution metrics, providing better insights into server performance.

* feat(telemetry): enhance resource tracking in server run events

- Updated the `ServerRunEventData` interface to include new properties for tracking resources: `appsSdkResources`, `mcpUiResources`, and `mcpAppsResources`, along with their respective counts.
- Refactored the `createServerRunEventData` function to map and filter resources based on MIME types, improving the granularity of telemetry data.
- Adjusted the `ServerRunEvent` class to serialize the new resource properties, enhancing the telemetry output for better observability.

* feat(versioning): automate version generation for telemetry

- Added a new script `generate-version.mjs` to automatically generate `src/telemetry/version.ts` with the current package version during the build process.
- Updated the `build` script in `package.json` to include the version generation step.
- Refactored `getPackageVersion` function to return the embedded version from the generated file, improving version management.

* tests for telemetry

* add changeset

* feat(telemetry): enhance runtime environment detection and user ID management

- Introduced a comprehensive runtime environment detection system, supporting Node.js, Bun, Deno, Cloudflare Workers, Edge, and browser environments.
- Added methods to determine storage capabilities for user ID persistence, including filesystem and localStorage options.
- Refactored user ID retrieval to accommodate different environments, ensuring session-based IDs are generated when persistent storage is unavailable.
- Enhanced telemetry event tracking by including runtime environment metadata in captured events, improving observability and debugging capabilities.

* feat(telemetry): add browser stubs for Node.js-only packages

- Introduced a Vite plugin to provide browser-compatible stubs for the `posthog-node` package, allowing it to be used in browser environments.
- Updated the Vite server configuration to exclude `posthog-node` from dependency optimization and mark it as external in SSR mode, ensuring proper handling in both development and production builds.
- Enhanced the overall compatibility of the telemetry system with browser environments by stubbing server-side functionality.

* refactor: standardize code formatting and improve readability

- Updated import statements to use consistent double quotes.
- Reformatted function parameters and object properties for better readability across multiple files.
- Enhanced the structure of telemetry-related code to improve maintainability and clarity.
- Removed unnecessary blank lines to streamline the codebase.

* feat(versioning): update version management and export functionality

- Added version information export to the mcp-use package, allowing access to the package version across various modules.
- Refactored the version generation script to output to a new location, ensuring consistency in version tracking.
- Updated multiple files to import and utilize the new versioning functions, enhancing the overall version management system.

* refactor(telemetry): remove unused ServerRunEventData import

- Eliminated the import of ServerRunEventData from telemetry.ts to clean up the code and remove unnecessary dependencies.

---------

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

* chore(typescript): version packages (canary)

* feat(ci): update CI workflow to use local tar files for dependencies

- Modified the CI workflow to create projects using local tar files instead of workspace dependencies.
- Removed the previous steps for replacing workspace dependencies in `package.json`, simplifying the process.
- Added a new helper function to validate and find required tar files in a specified directory, ensuring all necessary packages are present.
- Enhanced the project creation logic to support a new `--tar` option for specifying the directory containing tar files.

* feat: add recursive tar file search functionality

- Introduced a new helper function to recursively find `.tgz` files in a specified directory, enhancing the ability to locate required tar files.
- Updated the existing `findTarFiles` function to utilize the new recursive search, improving the validation and retrieval of tar files for project creation.
- Enhanced error messages to provide clearer feedback on found tar files during the process.

* refactor: clean up index.tsx and update CI workflow

- Removed unused functions for tar file handling from `index.tsx`, simplifying the codebase.
- Updated the CI workflow to ensure consistent packaging of the `mcp-use` package, enhancing the build process.
- Adjusted the project creation logic to streamline dependency management and improve clarity in the workflow.

* chore(ci): update E2E canary workflow permissions

- Added permissions for actions and contents in the E2E canary workflow to enhance security and control over workflow execution.

* refactor: enhance error handling display in OAuth callback (#644)

- Refactored the error display logic in the OAuth callback to use DOM manipulation for improved safety and clarity.
- Updated regex patterns in the OAuthHelper class to be more specific, enhancing the accuracy of authentication checks for various APIs.

* chore(typescript): version packages (canary)

* feat(chat): enhance tool integration in chat components (#643)

- Added `tools` prop to `ChatTab` for better tool management.
- Updated `MessageList` to accept `tools` and implemented a helper function to retrieve tool metadata.
- Enhanced `ToolResultRenderer` to utilize tool metadata for improved rendering and error handling, including debug logging for better traceability.

* chore(typescript): version packages (canary)

* refactor: update regex patterns in OAuthHelper for improved DNS safety

- Enhanced regex patterns in the OAuthHelper class to ensure DNS-safe domain matching, accommodating maximum label length restrictions for Google APIs, Atlassian, and Slack.
- Improved clarity in comments to reflect the changes made to the regex patterns.

* Fix/inspector/build (#645)

* chore(inspector): update prepublishOnly script for improved build process

- Modified the `prepublishOnly` script in the inspector package to first build the `mcp-use` package before executing the standard build, ensuring all dependencies are correctly prepared prior to publishing.

* chore: changeset

* chore(typescript): version packages (canary)

* chore(ci): add workflow_dispatch trigger to E2E canary workflow

- Introduced a manual trigger for the E2E canary workflow, allowing for on-demand execution alongside the existing workflow_run trigger.

* Update conformance workflows to use published action (#647)

* Update conformance workflows to use published action

- Replace inline conformance testing with mcp-use/mcp-conformance-action@v1
- Simplify conformance-comment workflow to use action's comment mode
- Maintains fork PR support via workflow_run pattern

* Trigger conformance tests with fixed action

* Trigger conformance with v1.0.2 (aggressive cleanup)

* Trigger conformance with v1.0.3 (simplified cleanup)

* Trigger conformance with v1.0.4 (detached spawn)

* Trigger conformance after updating comment workflow on main

* Trigger conformance with v1.0.5 (baseline comparison)

* Trigger conformance with v1.0.6 (old artifact format support)

* Potential fix for code scanning alert no. 45: Workflow does not contain permissions

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>

* feat: Add browser tel to typescript  (#651)

* add posthog-js

* refactor(telemetry): enhance telemetry functionality 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.

* feat(telemetry): add ClientAddServerEvent and ClientRemoveServerEvent for server management

- Introduced ClientAddServerEvent and ClientRemoveServerEvent classes to track server addition and removal.
- Enhanced MCPClientInitEvent to include isBrowser property for better environment differentiation.
- Improved properties extraction for new event classes to facilitate server management tracking.

* feat(telemetry): unify telemetry exports and enhance backward compatibility

- Added unified telemetry exports for browser and Node.js environments, including Tel and setTelemetrySource.
- Introduced backward compatibility aliases for existing telemetry functionalities to ensure seamless integration for users transitioning to the new structure.

* feat(telemetry): integrate telemetry tracking in MCPClient methods

- Added telemetry tracking for server addition and removal in BaseMCPClient.
- Implemented client initialization tracking in BrowserMCPClient to capture configuration details and environment context.
- Enhanced error handling for telemetry tracking failures during client initialization.

* feat(telemetry): enhance MCP telemetry tracking in useMcp hook

- Integrated telemetry tracking for connection attempts, tool calls, and resource reads within the useMcp hook.
- Added success and failure tracking for connections, tool executions, and resource accesses to improve monitoring and diagnostics.

* chore(typescript): version packages (canary)

---------

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: Luigi Pederzani <luigipederzani@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-08 19:35:44 +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
Enrico Toniato a145cc7884 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
2025-11-19 19:22:35 +01:00
Pietro Zullo 0106a76673 feat/typescript/hosted inspector & docs (#361)
* Instant deploy Dockerfile

* removed start.sh

* remove slop

* docs: inspector docs

* redirect in sidebar

* fix railway url

* better docker
2025-10-21 14:48:00 +02:00