31
32The MCP TypeScript SDK uses Node-specific APIs that don't play nicely with Deno
33or edge functions:
34
35- https://github.com/modelcontextprotocol/typescript-sdk/issues/260
37 import { createRoot } from 'https://esm.sh/react-dom@18.2.0/client';
38
39 function App() {
40 const [vals, setVals] = useState([]);
41 const [loading, setLoading] = useState(true);
1export async function blobKeyForDemoCache(id: string) {
2 // get the url of this file
3 // we'll use this to get values for the blob key
7 this._createElement = createElement;
8
9 // Initialize goober with prefixing and bind the render function
10 setup(this._vnode.bind(this), prefix);
11
12 // Return the bound render function with attached helpers
13 return Object.assign(this._vnode.bind(this), {
14 toStyleObject: this.toStyleObject.bind(this),
33 // Registers a plugin that mutates props before rendering
34 plugin(fn) {
35 if (typeof fn !== "function") {
36 throw new TypeError("[EnhancedVNode] plugin must be a function");
37 } else {
38 this._plugins.push(fn);
96 }
97
98 // Core render function that normalizes props, applies plugins, and returns a VNode
99 _vnode(type, props, children) {
100 props = this._normalizeProps(props, children);
6const SHEET = Deno.env.get("GSHEET")!;
7
8export default async function handler() {
9 const data: Record<string, any> = {};
10
3import { crypto } from "./ticker_config.tsx";
4
5export default async function daily() {
6 const lows: Record<string, number> = {};
7
3 *
4 * This is the HTTP entry point for the ValTown MCP Server when deployed
5 * on ValTown itself. It excludes CLI-dependent functionality and uses
6 * header-based authentication with Hono and StreamableHTTPServerTransport.
7 */
1export async function pollEnabledStatus() {
2 // this shouldn't run forever just b/c someone forgot to close their browser tab with the demo in it
3 const interval = 1000; // 10000;
1# EnhancedVNode
2
3A minimalist, plugin-ready hyperscript-style utility for rendering elements with style normalization, class processing, and custom behavioral plugins. Compatible with React, Preact, or any functionally similar createElement.
4
5## ✨ Features
6
7- 🧱 Lightweight functional interface: const h = new EnhancedVNode(createElement)
8- 🎨 Normalizes class strings into Set and filters empty entries
9- 🎛️ Parses inline style into clean JS objects
46## 🔌 Plugins
47
48Plugins are just functions that receive and mutate the props object before rendering:
49
50```js
11import {registerPrompts} from "./prompts/promptsTools.ts"
12
13export function registerTools(
14 server: McpServer,
15 config: Config,
29}
30
31export function registerPromptsTools(server: McpServer, config: Config) {
32 registerPrompts(server, config)
33}
Simple functional CSS library for Val Town
A helper function to build a file's email
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.