Skip to content

Instantly share code, notes, and snippets.

View CoffeeVampir3's full-sized avatar

Z CoffeeVampir3

View GitHub Profile
@CoffeeVampir3
CoffeeVampir3 / sadadjnsauhd897uashd98sahd9a897udshq.ts
Created April 29, 2025 03:45
wefjuejwuiofwjeuifchwie9ofh8i0923hf89023hf892h89fh298fh289f3h892hf.ts
import { StreamingWebSocket, CancellationError } from "./streamingWebSocket.ts";
/**
* Example of client-side streaming inference implementation
* Following the exact flow described in the specification
*/
async function streamInference(
socket: StreamingWebSocket,
onContent: (content: string) => void
): Promise<void> {
[TOOL_CALLS][{"name": "add", "arguments": {"a": 5, "b": 3}}][/TOOL_CALLS]
import express from "npm:express";
import { randomUUID } from "node:crypto";
import { McpServer } from "npm:@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "npm:@modelcontextprotocol/sdk/server/streamableHttp.js";
import { z } from "npm:zod";
const PORT = 3000;
const MCP_ENDPOINT = "/mcp";
const app = express();