-
Notifications
You must be signed in to change notification settings - Fork 24
docs(mcp): cover image and video generation on the MCP server page #192
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
+187
−22
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fcc4b55
docs(mcp): cover image and video generation on the MCP server page
Suntorlin 72d22b8
docs(mcp): one "Try it" card per media capability
Suntorlin af6f992
docs(mcp): make "Try it" cards copy their prompt on click
Suntorlin fc7455e
docs(mcp): equal-height prompt cards and a setup line in copied prompts
Suntorlin 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
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
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,72 @@ | ||
| import { useState, useRef, useEffect } from "react"; | ||
|
|
||
| export const PromptCard = ({ title, icon, prompt, note }) => { | ||
| const [state, setState] = useState("idle"); | ||
| const timer = useRef(null); | ||
|
|
||
| useEffect(() => () => clearTimeout(timer.current), []); | ||
|
|
||
| const hints = { idle: "Copy", copied: "Copied", failed: "Copy failed" }; | ||
|
|
||
| // Appended to every copied prompt so an agent without the server can still act on it. | ||
| const setup = | ||
| "Use the Fish Audio MCP server for this (https://api.fish.audio/mcp, streamable HTTP with OAuth sign-in). If it is not connected yet, help me add it before you start."; | ||
|
|
||
| const copyWithTextarea = text => { | ||
| const area = document.createElement("textarea"); | ||
| area.value = text; | ||
| area.setAttribute("readonly", ""); | ||
| area.style.position = "fixed"; | ||
| area.style.opacity = "0"; | ||
| document.body.appendChild(area); | ||
| area.select(); | ||
| const ok = document.execCommand("copy"); | ||
| document.body.removeChild(area); | ||
| if (!ok) throw new Error("copy command failed"); | ||
| }; | ||
|
|
||
| const writeClipboard = async text => { | ||
| try { | ||
| await navigator.clipboard.writeText(text); | ||
| } catch { | ||
| copyWithTextarea(text); | ||
| } | ||
| }; | ||
|
|
||
| const copy = async () => { | ||
| try { | ||
| await writeClipboard(`${prompt}\n\n${setup}`); | ||
| setState("copied"); | ||
| } catch { | ||
| setState("failed"); | ||
| } | ||
| clearTimeout(timer.current); | ||
| timer.current = setTimeout(() => setState("idle"), 2000); | ||
| }; | ||
|
|
||
| const onKeyDown = event => { | ||
| if (event.key === "Enter" || event.key === " ") { | ||
| event.preventDefault(); | ||
| copy(); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <div | ||
| className="prompt-card" | ||
| data-state={state} | ||
| role="button" | ||
| tabIndex={0} | ||
| aria-label={`Copy prompt: ${title}`} | ||
| onClick={copy} | ||
| onKeyDown={onKeyDown} | ||
| > | ||
| <Card title={title} icon={icon}> | ||
| “{prompt}”{note ? ` ${note}` : ""} | ||
| <span className="prompt-card-hint" aria-live="polite"> | ||
| {hints[state]} | ||
| </span> | ||
| </Card> | ||
| </div> | ||
| ); | ||
| }; | ||
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: fishaudio/docs
Length of output: 11075
🏁 Script executed:
Repository: fishaudio/docs
Length of output: 37201
🌐 Web query:
Mintlify custom snippets JSX component imports Card available in snippet direct import parent MDX💡 Result:
<search_synthesis>
In Mintlify, you can use custom JSX React components within your documentation, but they are subject to specific import and architectural constraints [1][2]. Cross-snippet imports are not supported; snippet files cannot import other snippet files [1][3]. If you have a JSX component (such as a custom Card or any other interactive element) defined in a file, you must import it directly into the parent MDX page where it will be rendered [1][4]. To use a JSX component in your documentation: 1. Create your component file (e.g., in the /snippets/ directory) using arrow function syntax, as the function keyword is not supported [2][5]. 2. Import the component directly into the parent MDX file using either an absolute or relative path [2][6]. 3. Ensure the component name starts with an uppercase letter to allow MDX to treat it as a React component rather than an HTML tag [2]. Regarding the Card component specifically, Mintlify provides a built-in Card component that can be used directly in MDX without custom JSX implementation [7]. If you are attempting to create a custom wrapper for a Card or incorporate one into a reusable JSX snippet, you must follow the rule of importing that snippet or component directly into the parent MDX file [1][5]. Key constraints for custom JSX components in Mintlify: - No cross-snippet imports: All dependencies must be imported directly into the parent MDX page [1][8]. - No code splitting: Dynamic imports and React.lazy are not supported [1][3]. - Pre-injected hooks: Hooks like useState, useEffect, and others are available automatically without imports [1][4]. - No JSON imports: Importing.json files is not supported [1][3].
</search_synthesis>
<source_evidence>
Citations:
Bind
CardwithinPromptCardor remove this reference.Cardis available as a Mintlify component in MDX, but the importedsnippets/prompt-card.jsxmodule has its own scope.overview/mcp.mdximports onlyPromptCard, so its page-levelCardbinding is not available here. Rendering anyPromptCardcan therefore fail withReferenceError: Card is not defined.Use local markup in
PromptCard, or move theCardwrapper tooverview/mcp.mdxand keep the copy control inside it.🤖 Prompt for AI Agents