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
| // add ...tools to agent.tools[] | |
| const mcp = new MCPClient({ | |
| servers: { | |
| hackernews: { | |
| command: "npx", | |
| args: ["-y", "@devabdultech/hn-mcp-server"], | |
| } | |
| }, |
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
| const weatherTool = createTool({ }); | |
| const server = new MCPServer({ | |
| name: "my-mcp-server", | |
| version: "1.0.0", | |
| tools: { weatherTool }, | |
| }); |
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
| "use client"; | |
| import { useChat } from "@ai-sdk/react"; | |
| import { DefaultChatTransport } from "ai"; | |
| import { useState } from "react"; | |
| export default function Chat() { | |
| const [input, setInput] = useState(""); | |
| const [imageUrl, setImageUrl] = useState(""); | |
| const [imageFile, setImageFile] = useState<File | null>(null); |
OlderNewer