Skip to content

v0.3.4

Choose a tag to compare

@fuongz fuongz released this 07 Apr 13:25
· 9 commits to main since this release
9867d6d

[v0.3.4] - 2026-04-07

Added

  • Type-safe Cloudflare bindings: Add generic TEnv to ToolContext for type-safe access to worker bindings
  • createMCPServer<TEnv>(): Pass your Cloudflare.Env type through to tools - context.bindings?.AI is now fully typed
  • getUser() helper: Fetch user profile from OAuth providers without manual fetch code
  • USERINFO_ENDPOINTS: Predefined endpoints for Google and GitHub

Example - Cloudflare Bindings

interface Env extends Cloudflare.Env {
  AI: unknown;
  VECTORIZE: unknown;
}

const tool = defineTool({
  handler: async (_, context: ToolContext<Env>) => {
    const ai = context.bindings?.AI; // Fully typed!
  }
});

createMCPServer<Env>({ tools: [tool] });

Example - Get User Info

import { getUser, USERINFO_ENDPOINTS } from "@phake/mcp";

const userinfo = await getUser(accessToken, USERINFO_ENDPOINTS.google);
// userinfo.email, userinfo.name, etc.

Documentation

  • Updated docs/authentication.md with Cloudflare Bindings and user info sections
  • Updated README.md with new usage examples

Internal

  • Add generic to SharedToolDefinition, defineTool, McpHandlerDeps, McpDispatchContext
  • Biome config: exclude examples/templates from lint

Full Changelog: v0.3.3...v0.3.4