Skip to content

Instantly share code, notes, and snippets.

View bookercodes's full-sized avatar

Alex Booker bookercodes

View GitHub Profile
// add ...tools to agent.tools[]
const mcp = new MCPClient({
servers: {
hackernews: {
command: "npx",
args: ["-y", "@devabdultech/hn-mcp-server"],
}
},
const weatherTool = createTool({ });
const server = new MCPServer({
name: "my-mcp-server",
version: "1.0.0",
tools: { weatherTool },
});
"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);