v0.3.4
[v0.3.4] - 2026-04-07
Added
- Type-safe Cloudflare bindings: Add generic
TEnvtoToolContextfor type-safe access to worker bindings createMCPServer<TEnv>(): Pass your Cloudflare.Env type through to tools -context.bindings?.AIis now fully typedgetUser()helper: Fetch user profile from OAuth providers without manual fetch codeUSERINFO_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.mdwith Cloudflare Bindings and user info sections - Updated
README.mdwith 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