Commit Graph

7 Commits

Author SHA1 Message Date
Andrew Khadder 01208e052a Revert "docs: split TypeScript V1 and V2 documentation (#2010)" (#2036)
This reverts commit 5b5fe96d28.
2026-07-28 10:23:24 -07:00
Andrew Khadder 5b5fe96d28 docs: split TypeScript V1 and V2 documentation (#2010)
Preserve the V1 TypeScript docs, add independently navigable V2 beta documentation, and align shared documentation. Rename both V2 migration guides to “Migrating to v2”.
2026-07-28 10:16:33 -07:00
Ayaan Gazali 9978343d63 docs(inspector): add self-hosting guide (#1861)
* docs(inspector): add self-hosting guide

The inspector README and feature table reference self-hosting with Docker,
but the docs site had no page for it (mcp-use.com/docs/inspector/self-hosting
404s). Add the guide based on the README's self-hosting section: Docker Hub
image, docker run / compose deployment, environment variables, and how
self-hosting compares to the hosted and CLI options.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(inspector): bind examples to loopback, add exposure warning and air-gapped transfer steps

Addresses review feedback on #1861:
- trim wordy intro sentence
- quick start and deployment examples now bind 127.0.0.1 to avoid
  exposing the Inspector proxy on all interfaces; added Warning with
  reverse-proxy/firewall guidance for remote access
- add docker save/load transfer steps for air-gapped hosts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: ayaanmacmini3 <ayaanmacmini3@ayaanmacmini3s-Mac-mini.local>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 10:00:46 -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
Enrico Toniato 3d787bab34 Canary (#970)
* feat(inspector): add environment variable for iframe embedding configuration (#965)

* feat(inspector): add environment variable for iframe embedding configuration

- Introduced `MCP_INSPECTOR_FRAME_ANCESTORS` environment variable to control which origins can embed the inspector widget in iframes, enhancing security and flexibility for both development and production environments.
- Updated documentation to include usage examples and best practices for setting the variable, ensuring clarity for users embedding the inspector in their applications.
- Refactored server routes and utilities to utilize the new environment variable for setting Content Security Policy (CSP) headers, improving security measures against unauthorized embedding.

* feat(server): enhance tool and resource change handling

- Added logic to ensure tool request handlers are registered on the SDK server, improving initialization for sessions with no tools.
- Updated change detection for tools, prompts, resources, and templates to include removal events, ensuring accurate notifications for list changes.
- Enhanced session server communication by sending updates when tools, prompts, resources, or templates are added or removed, improving responsiveness and user experience.

* feat(server): pre-initialize request handlers for improved error handling

- Added pre-initialization logic for tool, prompt, and resource request handlers on the SDK server to ensure they are available even when starting with zero registrations.
- This change prevents -32601 "Method not found" errors on clients by ensuring that necessary handlers are set up during server initialization.

* feat(inspector): implement localhost URL conversion for server-side fetches

- Added a new utility function `toLocalhostUrl` to convert external proxy URLs to localhost for server-side fetches, ensuring correct content retrieval when running behind reverse proxies.
- Updated the inspector's route handling to utilize the new function, improving reliability of widget content fetching.
- Enhanced handling of asset URLs to ensure they are correctly rewritten for both external and localhost scenarios, addressing potential issues with proxy catch-all routes.
- Configured Vite middleware to allow all hosts, facilitating smoother operation behind various reverse proxies.

* feat(inspector): enhance widget URL handling and logging

- Improved URL rewriting logic for widget assets to ensure correct resolution both locally and behind reverse proxies.
- Added debug logging for fetching and processing widget HTML, aiding in troubleshooting and development.
- Introduced a new global variable `__mcpServerUrl` for widgets to dynamically reference the server origin in API calls, enhancing flexibility.
- Updated handling of asset paths to preserve query parameters, ensuring accurate resource fetching from the development server.

* feat(server): enhance Vite HMR WebSocket support and MCP_URL handling

- Updated MCP_URL assignment to only set if not provided by the user, allowing for external proxy configurations.
- Implemented WebSocket proxy setup for Vite HMR, enabling hot module reloading through reverse proxies.
- Added optional httpServer parameter in ServerConfig for Vite HMR WebSocket support.
- Improved WebSocket upgrade request handling to ensure compatibility with various deployment scenarios.

* feat(server): enhance HMR support for custom routes and widget management

- Introduced a new `shouldRemove` predicate in the sync options to prevent the removal of specific items during HMR, protecting widget-registered tools.
- Added a mutable `_customRoutes` registry in the MCP server to manage custom HTTP route handlers, enabling HMR for routes without re-registering.
- Implemented a middleware to dispatch custom route handlers from the mutable map, ensuring compatibility with Hono's routing system.
- Updated widget tool management to return a boolean indicating existence, allowing for fallback registration if tools are removed during HMR sync.
- Enhanced resource directory handling in the widget mounting process to ensure directories are created dynamically for Vite file watching.

* feat(inspector): enhance runtime configuration for inspector middleware

- Added new configuration options to `mountInspector` for `devMode` and `sandboxOrigin`, allowing for improved handling of development environments and reverse proxy setups.
- Updated `registerStaticRoutes` to inject runtime configuration into the HTML, enabling client-side components to access these settings.
- Modified the inspector UI mounting process to utilize the new configuration options, enhancing flexibility and usability in various deployment scenarios.

* fix(widget-handling): refine widget type determination logic

- Updated widget type assignment to prioritize `appsSdk` when only `appsSdkMetadata` is present, ensuring accurate widget classification.
- Enhanced metadata handling in widget registration to default to an empty object for `ui` when no metadata is available, improving robustness in widget rendering.

* Enhance reverse proxy support and widget handling in inspector

- Introduced `MCP_URL` environment variable to allow users to set an external proxy URL, ensuring correct widget asset URLs and HMR WebSocket connections.
- Updated `mountInspector` configuration options to include `devMode` and `sandboxOrigin`, improving flexibility for development environments.
- Added support for dynamic widget creation and improved HMR reliability, allowing for seamless integration behind reverse proxies.
- Documented best practices for using `MCP_URL` and reverse proxy setups, ensuring clarity for users.

* chore: enter canary prerelease mode

* chore(typescript): version packages (canary)

* feat(typescript): add completion support to resource templates and publish completion capabilities (#966)

* add util for normalizing list callback completions for resource templates

* add resource template completion and publish completion capabilites

* add tests for toResourceTemplateCompleteCallbacks

* add docs for resource templates completion

* add changeset

* update typescript conformance test server to include prompts and resource templates completion examples

* revert default values for arg1 and arg2 and z.string().optional(), change to callback fn

* run lint

* chore(typescript): version packages (canary)

* refactor(tests): remove serial mode configuration from E2E tests for UI widgets, chat, command palette, and setup

* fix(inspector): update sandbox permissions for McpUIRenderer and MCPUIResource components (#974)

- Removed 'allow-same-origin' and 'allow-popups-to-escape-sandbox' from sandbox permissions to enhance security and simplify iframe configurations.

* chore(typescript): version packages (canary)

* feat(inspector, typescript): release v0.18.5 and v1.17.0 with iframe embedding, reverse proxy support, and resource template completion

- Introduced `MCP_INSPECTOR_FRAME_ANCESTORS` for iframe embedding control.
- Enhanced `mountInspector` with `devMode` and `sandboxOrigin` options.
- Added runtime config injection for improved deployment flexibility.
- Improved server-side widget fetches and asset URL handling for reverse proxies.
- Released v1.17.0 with resource template variable completion and custom route HMR support.
- Updated dependencies to ensure compatibility with new features.

* fix(tests): update hmr test prompts to use completable for default values

---------

Co-authored-by: Joaquin Coromina <75667013+bjoaquinc@users.noreply.github.com>
2026-02-09 17:08:47 -08: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