Repository navigation
docs: WebMCP connection tool on docs; advertise WorkOS scopes in PRM #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /** | ||
| * WebMCP tool for agents running in the visitor's browser | ||
| * (https://webmachinelearning.github.io/webmcp/). | ||
| * | ||
| * Mintlify already registers search_docs, read_page, navigate_page, | ||
| * get_site_overview, and read_skill on every docs page. This adds the one | ||
| * thing those don't cover: how to connect to the Terminal49 MCP server. | ||
| * The tool name must not collide with Mintlify's, or registration fails. | ||
| * | ||
| * Mintlify loads every .js file in docs/ on every page, so this is plain | ||
| * browser JavaScript with no build step. | ||
| */ | ||
| (function () { | ||
| var MCP_URL = 'https://mcp.terminal49.com'; | ||
|
|
||
| // Older Chrome builds expose the API on navigator instead of document. | ||
| var modelContext = document.modelContext || navigator.modelContext; | ||
| if (!modelContext || typeof modelContext.registerTool !== 'function') return; | ||
|
|
||
| // Top-level page only, once: Mintlify navigates client-side and may run | ||
| // custom scripts again, and embedded frames would register a duplicate. | ||
| if (window.top !== window || window.__t49WebMcpRegistered) return; | ||
| window.__t49WebMcpRegistered = true; | ||
|
|
||
| var tool = { | ||
| name: 'get_terminal49_mcp_connection', | ||
| title: 'Get Terminal49 MCP server connection details', | ||
| description: | ||
| 'Get the URL, transport, and sign-in details for the Terminal49 MCP server, plus setup guides for Claude, ChatGPT, Cursor, VS Code, and other MCP clients. Use this to connect an agent to a Terminal49 account to search, track, and monitor shipments.', | ||
| inputSchema: { type: 'object', properties: {} }, | ||
| annotations: { readOnlyHint: true }, | ||
| execute: function () { | ||
| var docs = window.location.origin + '/docs/mcp'; | ||
| return Promise.resolve({ | ||
| url: MCP_URL, | ||
| transport: 'streamable-http', | ||
| authentication: | ||
| 'OAuth 2.1 through auth.terminal49.com, discovered from the protected resource metadata; or send a Terminal49 API key as "Authorization: Token YOUR_API_KEY".', | ||
| protected_resource_metadata: MCP_URL + '/.well-known/oauth-protected-resource', | ||
| docs: docs + '/home', | ||
| setup_guides: { | ||
| claude: docs + '/setup/claude', | ||
| claude_code: docs + '/setup/claude-code', | ||
| chatgpt: docs + '/setup/chatgpt', | ||
| cursor: docs + '/setup/cursor', | ||
| vs_code: docs + '/setup/vs-code', | ||
| microsoft_copilot: docs + '/setup/microsoft-copilot', | ||
| other_clients: docs + '/setup/other-clients', | ||
| }, | ||
| }); | ||
| }, | ||
| }; | ||
|
|
||
| // The executor catches a synchronous throw (e.g. InvalidStateError) as well | ||
| // as a rejection, so a failed attempt always clears the flag for a retry. | ||
| new Promise(function (resolve) { | ||
| resolve(modelContext.registerTool(tool)); | ||
| }).catch(function (error) { | ||
| window.__t49WebMcpRegistered = false; | ||
| if (window.console && console.warn) console.warn('WebMCP: could not register tool', error); | ||
| }); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
offline_accessas a resource scopeWhen production is configured with this value, the Protected Resource Metadata makes clients treat
offline_accessas required for basic MCP access. The MCP 2026-07-28 authorization specification explicitly says protected resources SHOULD NOT includeoffline_accessinscopes_supported, because clients that want refresh tokens add it independently after finding it in the authorization-server metadata; remove it from this PRM value and the smoke assertion. MCP authorization specificationAGENTS.md reference: AGENTS.md:L76-L79
Useful? React with 👍 / 👎.