<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/rss.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Microfn Blog</title><description/><link>https://blog.microfn.dev</link><item><title>How to add microfn to Claude Code</title><link>https://blog.microfn.dev/posts/add-microfn-to-claude-code</link><guid isPermaLink="true">https://blog.microfn.dev/posts/add-microfn-to-claude-code</guid><pubDate>Tue, 17 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Give Claude Code a persistent, self-evolving toolkit. Add microfn as a plugin and Claude Code can create custom functions, update them as needs change, and build a reusable library—all deployed instantly to a secure sandbox.&lt;/p&gt;
&lt;p&gt;Build tools once, then refine them. Every function persists across sessions, ready to be patched, composed, and evolved.&lt;/p&gt;
&lt;h2&gt;1. Install via CLI&lt;/h2&gt;
&lt;p&gt;Run the following commands to add and enable microfn:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;claude plugin marketplace add microfnhq/skills
claude plugin enable microfn
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Or: Enable via &lt;code&gt;/plugin&lt;/code&gt; command&lt;/h3&gt;
&lt;p&gt;Instead of running &lt;code&gt;claude plugin enable microfn&lt;/code&gt;, you can type &lt;code&gt;/plugin&lt;/code&gt; inside a Claude Code session and follow the prompts to enable microfn.&lt;/p&gt;
&lt;h2&gt;2. Authenticate&lt;/h2&gt;
&lt;p&gt;When you first run a command using the microfn server, you will be prompted to authenticate via OAuth in your browser.&lt;/p&gt;
&lt;h2&gt;Read more&lt;/h2&gt;
&lt;p&gt;For more details on available tools and advanced configuration, check out the &lt;a href=&quot;https://microfn.dev/mcp&quot;&gt;microfn MCP documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Built with microfn, your toolbox for composable functions&lt;/h2&gt;
&lt;p&gt;Microfn is a tiny cloud runner for composable JavaScript functions. Write your function, hit save, and microfn deploys it instantly.&lt;/p&gt;
</content:encoded><author>Microfn</author></item><item><title>How to add microfn to ChatGPT</title><link>https://blog.microfn.dev/posts/add-microfn-to-chatgpt</link><guid isPermaLink="true">https://blog.microfn.dev/posts/add-microfn-to-chatgpt</guid><pubDate>Mon, 16 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Turn ChatGPT into a tool-building agent with its own persistent arsenal. With microfn&apos;s MCP integration, ChatGPT creates reusable functions that it can update, patch, and evolve—not just one-off code execution.&lt;/p&gt;
&lt;p&gt;Each function becomes part of ChatGPT&apos;s growing toolbox, deployed instantly to a secure cloud environment and ready to reuse across conversations.&lt;/p&gt;
&lt;h2&gt;1. Access settings&lt;/h2&gt;
&lt;p&gt;Navigate to &lt;a href=&quot;https://chatgpt.com/apps#settings/Connectors/Advanced&quot;&gt;chatgpt.com/apps#settings/Connectors/Advanced&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;2. Enable Developer Mode&lt;/h2&gt;
&lt;p&gt;In the &lt;strong&gt;Advanced&lt;/strong&gt; settings, ensure &lt;strong&gt;Developer Mode&lt;/strong&gt; is toggled &lt;strong&gt;ON&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./chatgpt-developer-mode.png&quot; alt=&quot;ChatGPT Developer Mode toggle&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;3. Create MCP Server&lt;/h2&gt;
&lt;p&gt;Click the &lt;strong&gt;Create&lt;/strong&gt; button (often labeled as &quot;Create App&quot; in the developer view) to add a new MCP Server.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./chatgpt-create-app.png&quot; alt=&quot;ChatGPT Create App dialog for MCP servers&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Fill in the following details:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Name:&lt;/strong&gt; microfn&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server URL:&lt;/strong&gt; &lt;code&gt;https://mcp.microfn.dev/mcp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authentication:&lt;/strong&gt; OAuth&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Trust:&lt;/strong&gt; Toggle &lt;strong&gt;I trust this application&lt;/strong&gt; to ON.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;4. Connect and Authorize&lt;/h2&gt;
&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;, then find &lt;strong&gt;microfn&lt;/strong&gt; in your list of servers and click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You will be redirected to authorize the connection via OAuth. Follow the prompts to log in to your microfn account and authorize the integration.&lt;/p&gt;
&lt;h2&gt;5. Verify&lt;/h2&gt;
&lt;p&gt;To use microfn in a new chat, ensure it is enabled in the model selector.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./chatgpt-enable-microfn.png&quot; alt=&quot;Enabling microfn in a new ChatGPT chat&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once enabled, you can verify the integration by asking ChatGPT to run a command, like &quot;whoami&quot;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./chatgpt-whoami-execution.png&quot; alt=&quot;ChatGPT execution of whoami using microfn MCP&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Read more&lt;/h2&gt;
&lt;p&gt;For more details on available tools and advanced configuration, check out the &lt;a href=&quot;https://microfn.dev/mcp&quot;&gt;microfn MCP documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Built with microfn, your toolbox for composable functions&lt;/h2&gt;
&lt;p&gt;Microfn is a tiny cloud runner for composable JavaScript functions. Write your function, hit save, and microfn deploys it instantly.&lt;/p&gt;
</content:encoded><author>Microfn</author></item><item><title>How to add microfn to Claude</title><link>https://blog.microfn.dev/posts/add-microfn-to-claude</link><guid isPermaLink="true">https://blog.microfn.dev/posts/add-microfn-to-claude</guid><pubDate>Mon, 16 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Give Claude its own evolving toolbox. Connect microfn via MCP and Claude can create, update, and reuse custom JavaScript functions—building a persistent library of tools that grows smarter over time.&lt;/p&gt;
&lt;p&gt;Build a weather function once, then refine it. Create an API integration, then patch it when requirements change. Every tool runs instantly in a secure sandbox and stays ready for the next conversation.&lt;/p&gt;
&lt;h2&gt;1. Access settings&lt;/h2&gt;
&lt;p&gt;Navigate to your &lt;a href=&quot;https://claude.ai/settings/connectors&quot;&gt;Claude.ai connector settings&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;2. Add Custom Connector&lt;/h2&gt;
&lt;p&gt;Click the &lt;strong&gt;Add Custom Connector&lt;/strong&gt; button and fill out the form with the following details:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Name:&lt;/strong&gt; microfn&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remote URL:&lt;/strong&gt; &lt;code&gt;https://mcp.microfn.dev/mcp&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;./add-custom-connector.png&quot; alt=&quot;Claude Add Custom Connector dialog&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;3. Connect and Authorize&lt;/h2&gt;
&lt;p&gt;After adding it, find &lt;strong&gt;microfn&lt;/strong&gt; in your connectors list and click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You will be prompted to authorize the connection via OAuth. Simply follow the browser prompts to log in and grant access to your microfn account.&lt;/p&gt;
&lt;h2&gt;4. Verify&lt;/h2&gt;
&lt;p&gt;Once connected, you can verify the integration by asking Claude to run a command. For example, ask &quot;whoami&quot; to see your microfn user details.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./claude-whoami-execution.png&quot; alt=&quot;Claude execution of whoami using microfn MCP&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can also ask Claude to call any of your microfn functions directly.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./claude-function-execution.png&quot; alt=&quot;Claude execution of a custom microfn function&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Read more&lt;/h2&gt;
&lt;p&gt;For more details on available tools and advanced configuration, check out the &lt;a href=&quot;https://microfn.dev/mcp&quot;&gt;microfn MCP documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Built with microfn, your toolbox for composable functions&lt;/h2&gt;
&lt;p&gt;Microfn is a tiny cloud runner for composable JavaScript functions. Write your function, hit save, and microfn deploys it instantly.&lt;/p&gt;
</content:encoded><author>Microfn</author></item><item><title>Extending OpenClaw with Microfn Skills</title><link>https://blog.microfn.dev/posts/extending-openclaw-with-microfn-skills</link><guid isPermaLink="true">https://blog.microfn.dev/posts/extending-openclaw-with-microfn-skills</guid><pubDate>Mon, 16 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Give OpenClaw its own persistent toolkit. Connect microfn and your agent can create reusable functions, update them as needs change, and build a growing library of custom capabilities.&lt;/p&gt;
&lt;p&gt;Build tools once, then reuse them. Need to change the logic? Patch existing functions. New integration? Compose existing tools or create new ones. All running securely in microfn&apos;s cloud sandbox.&lt;/p&gt;
&lt;h2&gt;1. Install the Microfn Skill&lt;/h2&gt;
&lt;p&gt;To get started, you need to tell OpenClaw to install the Microfn skill. You can do this by pointing it to the official skills repository:&lt;/p&gt;
&lt;p&gt;&quot;Install the microfn skill from github.com/microfnhq/skills&quot;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./openclaw-install-skill.png&quot; alt=&quot;Telling OpenClaw to install the microfn skill via Telegram&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;2. Generate an API Token&lt;/h2&gt;
&lt;p&gt;OpenClaw needs to authenticate with Microfn to deploy and run your functions.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to your &lt;a href=&quot;https://microfn.dev/users/settings/api&quot;&gt;Microfn API settings&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Generate a new &lt;strong&gt;API Token&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Copy the token; you&apos;ll need to give it to OpenClaw in the next step.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;3. Configure OpenClaw&lt;/h2&gt;
&lt;p&gt;Once you have your token, tell OpenClaw to save it securely:&lt;/p&gt;
&lt;p&gt;&quot;Use my microfn API token: &amp;lt;YOUR_TOKEN&amp;gt;&quot;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./openclaw-set-token.png&quot; alt=&quot;Telling OpenClaw to use the microfn API token via Telegram&quot; /&gt;&lt;/p&gt;
&lt;p&gt;OpenClaw will store this token and use it to communicate with the Microfn cloud.&lt;/p&gt;
&lt;h2&gt;4. Building Tools on the Fly&lt;/h2&gt;
&lt;p&gt;Now that OpenClaw is connected, it can build its own tools. You can ask it to perform complex tasks, and it will automatically determine if it needs to create a new function to get the job done.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./openclaw-generate-function.png&quot; alt=&quot;Asking OpenClaw to build a new tool using the microfn skill&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Example prompts for OpenClaw:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Create a tool to fetch the current price of Bitcoin and send me a notification if it drops below $50k.&quot;&lt;/li&gt;
&lt;li&gt;&quot;Write a function to summarize the last 5 emails from my inbox and save the summary to KV storage.&quot;&lt;/li&gt;
&lt;li&gt;&quot;Build a custom API integration for my internal CRM.&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Why use Microfn with OpenClaw?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Secure Sandbox&lt;/strong&gt;: Code runs in an isolated cloud environment, protecting your local machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Persistent Storage&lt;/strong&gt;: Use built-in KV storage for stateful workflows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secrets Management&lt;/strong&gt;: Safely handle API keys and credentials.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zero Configuration&lt;/strong&gt;: Functions are deployed and ready to run instantly.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Read more&lt;/h2&gt;
&lt;p&gt;For more details on building and managing skills, check out the &lt;a href=&quot;https://microfn.dev/openclaw&quot;&gt;OpenClaw documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Built with microfn, your toolbox for composable functions&lt;/h2&gt;
&lt;p&gt;Microfn is a tiny cloud runner for composable JavaScript functions. Write your function, hit save, and microfn deploys it instantly.&lt;/p&gt;
</content:encoded><author>Microfn</author></item><item><title>How to add microfn to OpenAI Codex</title><link>https://blog.microfn.dev/posts/add-microfn-to-openai-codex</link><guid isPermaLink="true">https://blog.microfn.dev/posts/add-microfn-to-openai-codex</guid><pubDate>Mon, 16 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Give Codex a persistent, self-evolving toolkit. Add microfn as an MCP server and Codex can create custom functions, update them as needs change, and build a reusable library—all deployed instantly to a secure sandbox.&lt;/p&gt;
&lt;p&gt;Build tools once, then refine them. Every function persists across sessions, ready to be patched, composed, and evolved.&lt;/p&gt;
&lt;h2&gt;1. Install via CLI&lt;/h2&gt;
&lt;p&gt;Run the following command to add microfn as an MCP server:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;codex mcp add microfn --url https://mcp.microfn.dev/mcp
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Or: Edit configuration manually&lt;/h3&gt;
&lt;p&gt;Open &lt;code&gt;~/.codex/config.toml&lt;/code&gt; in your preferred editor. If it doesn&apos;t exist, you can create it.&lt;/p&gt;
&lt;p&gt;Add the following &lt;code&gt;[mcp_servers.microfn]&lt;/code&gt; block to the file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[mcp_servers.microfn]
url = &quot;https://mcp.microfn.dev/mcp&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;3. Authenticate&lt;/h2&gt;
&lt;p&gt;When you first run a command using the microfn server, you will be prompted to authenticate via OAuth in your browser.&lt;/p&gt;
&lt;h2&gt;Read more&lt;/h2&gt;
&lt;p&gt;For more details on available tools and advanced configuration, check out the &lt;a href=&quot;https://microfn.dev/mcp&quot;&gt;microfn MCP documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Built with microfn, your toolbox for composable functions&lt;/h2&gt;
&lt;p&gt;Microfn is a tiny cloud runner for composable JavaScript functions. Write your function, hit save, and microfn deploys it instantly.&lt;/p&gt;
</content:encoded><author>Microfn</author></item><item><title>Connecting GitHub notifications to Discord or Slack in less than 5 minutes with microfn</title><link>https://blog.microfn.dev/posts/connect-github-notifications-to-discord</link><guid isPermaLink="true">https://blog.microfn.dev/posts/connect-github-notifications-to-discord</guid><pubDate>Fri, 26 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In today’s guide we’ll hook GitHub repository events into Discord (or Slack) using microfn.&lt;/p&gt;
&lt;p&gt;It only takes a few minutes to capture GitHub webhooks in a function and relay the highlights to the chat channel your team actually watches.&lt;/p&gt;
&lt;h2&gt;1. Create a microfn account&lt;/h2&gt;
&lt;p&gt;If you don’t have one yet, head to https://microfn.dev. Sign up for free—no credit card required.&lt;/p&gt;
&lt;h2&gt;2. Create a new function&lt;/h2&gt;
&lt;p&gt;Tap the “+” button in the top-left to create a function. Give it a descriptive name like &lt;code&gt;github-notifier&lt;/code&gt;, or fork an existing notifier if you already have one in your workspace.&lt;/p&gt;
&lt;p&gt;After saving, open the &lt;strong&gt;Triggers&lt;/strong&gt; tab and copy the webhook URL. It looks like &lt;code&gt;https://microfn.dev/run/:username/:functionName&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./webhook-trigger-ui.png&quot; alt=&quot;Webhook trigger URL in microfn&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;3. Connect the function to GitHub&lt;/h2&gt;
&lt;p&gt;In GitHub, open the repository you want to monitor and navigate to &lt;strong&gt;Settings → Webhooks&lt;/strong&gt;. Paste the microfn URL into the webhook target field (&lt;code&gt;https://microfn.dev/run/:username/:functionName&lt;/code&gt;) and keep the default &lt;code&gt;application/json&lt;/code&gt; content type.&lt;/p&gt;
&lt;p&gt;Choose the events you care about (start with “Just the push event” if you’re not sure), then hit &lt;strong&gt;Add webhook&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;4. Check the GitHub webhook that arrived at your function&lt;/h2&gt;
&lt;p&gt;Head back to microfn, select your function, and open the &lt;strong&gt;Executions&lt;/strong&gt; tab. You should see the incoming GitHub webhook, complete with its JSON payload.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./execution-detail.png&quot; alt=&quot;Execution detail showing the GitHub webhook payload&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Click &lt;strong&gt;Replay&lt;/strong&gt; to resend the event while you iterate and add downstream actions.&lt;/p&gt;
&lt;h2&gt;5. Forward alerts to Discord or Slack&lt;/h2&gt;
&lt;p&gt;Use the webhook payload to craft a message, then hand it off to a reusable notifier function.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import fn from &apos;@microfn/fn&apos;;

export async function main(input) {
  const payload = input.body ?? input;
  const repo = payload.repository?.full_name ?? &apos;unknown-repo&apos;;
  const actor = payload.sender?.login ?? &apos;someone&apos;;
  const branch = payload.ref?.split(&apos;/&apos;)?.at(-1) ?? &apos;main&apos;;
  const commits = (payload.commits ?? [])
    .map((commit) =&amp;gt; `• ${commit.message}`)
    .join(&apos;\n&apos;);

  const message = `🔔 ${actor} pushed to ${repo}/${branch}` + (commits ? `\n${commits}` : &apos;&apos;);

  await fn.executeFunction(&apos;david/send-discord-message&apos;, {
    channelId: process.env.DISCORD_CHANNEL_ID,
    content: message
  });

  return { status: &apos;delivered&apos; };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Store &lt;code&gt;DISCORD_CHANNEL_ID&lt;/code&gt; as a secret or environment variable in microfn. When a push arrives, the helper function handles Discord authentication and posting.&lt;/p&gt;
&lt;p&gt;Need the helper? You can fork &lt;a href=&quot;https://microfn.dev/david/send-discord-message/run&quot;&gt;david/send-discord-message&lt;/a&gt;, or drop in the implementation below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import secret from &apos;@microfn/secret&apos;;

export async function main(input) {
  const token = await secret.getRequired(&apos;DISCORD_BOT_TOKEN&apos;);

  let actualInput = input;
  if (actualInput.input) {
    actualInput = actualInput.input;
  }

  const { channelId, content } = actualInput;

  const response = await fetch(
    `https://discord.com/api/v10/channels/${channelId}/messages`,
    {
      method: &apos;POST&apos;,
      headers: {
        Authorization: `Bot ${token}`,
        &apos;Content-Type&apos;: &apos;application/json&apos;
      },
      body: JSON.stringify({ content })
    }
  );

  const data = await response.json();
  if (!response.ok) {
    throw new Error(
      `Discord API error: ${response.status} ${JSON.stringify(data)}`
    );
  }

  return data;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Swap in Slack by calling your Slack webhook instead, or branch on the payload to send to both platforms.&lt;/p&gt;
&lt;h2&gt;Built in microfn, your toolbox for small composable functions&lt;/h2&gt;
&lt;p&gt;Microfn is a tiny cloud runner for composable JavaScript functions. Write your function, hit save, and microfn deploys it anywhere you need it.&lt;/p&gt;
&lt;p&gt;Start for free—no credit card required!&lt;/p&gt;
</content:encoded><author>Microfn</author></item><item><title>How to quickly act on incoming emails with microfn</title><link>https://blog.microfn.dev/posts/how-to-act-on-incoming-emails</link><guid isPermaLink="true">https://blog.microfn.dev/posts/how-to-act-on-incoming-emails</guid><pubDate>Wed, 24 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Microfn comes with a built-in email connector, so you can forward any message into a function and respond automatically.&lt;/p&gt;
&lt;p&gt;With a few clicks you can triage, forward, or archive email directly from a microfn workflow. Here’s how to wire it up:&lt;/p&gt;
&lt;h2&gt;1. Create a new function&lt;/h2&gt;
&lt;p&gt;In microfn, tap the “+” button to create a new function and give it a name that matches the job you want it to do.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export async function main(input) {
  return {
    message: &quot;Hello from Microfn!&quot;,
    timestamp: new Date().toISOString(),
    receivedInput: input
  };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;2. Enable the Email trigger&lt;/h2&gt;
&lt;p&gt;Once the function is saved, open the &lt;strong&gt;Triggers&lt;/strong&gt; tab and enable the &lt;strong&gt;Email Trigger&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The email trigger generates a unique address for your function. Every message sent to that inbox calls your function with the email’s contents.&lt;/p&gt;
&lt;p&gt;Need more detail? Check out the &lt;a href=&quot;https://docs.microfn.dev/triggers/email/&quot;&gt;Microfn email trigger docs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./triggers-ui.png&quot; alt=&quot;Email trigger configuration in microfn&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Microfn also adds a new &lt;code&gt;email()&lt;/code&gt; export to your workspace so each incoming message is dispatched automatically. Here’s a complete example you can drop into a new function:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export async function main(input) {
  return {
    message: &quot;Hello from Microfn!&quot;,
    timestamp: new Date().toISOString(),
    receivedInput: input
  };
}

export async function email(emailPayload) {
  // handle email trigger
  console.log(&quot;email received&quot;);
  console.log(emailPayload);

  return {
    status: &quot;processed&quot;,
    receivedSubject: emailPayload.email.subject
  };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2.1 Check executions for incoming email data&lt;/h3&gt;
&lt;p&gt;Send a message to the generated address and watch it appear in the &lt;strong&gt;Executions&lt;/strong&gt; panel.&lt;/p&gt;
&lt;p&gt;Hit &lt;strong&gt;Replay&lt;/strong&gt; to resend the same payload while you iterate, so you can verify your function behaves the way you expect.&lt;/p&gt;
&lt;h2&gt;3. Forward, categorize, save&lt;/h2&gt;
&lt;p&gt;From here, the workflow is yours to design—forward high-priority mail to Discord, store attachments in cloud storage, or build filters that only alert you when it matters.&lt;/p&gt;
&lt;h2&gt;Email trigger input shape&lt;/h2&gt;
&lt;p&gt;Here’s an example payload delivered to &lt;code&gt;email()&lt;/code&gt; when a message arrives:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;email&quot;: {
    &quot;body&quot;: &quot;Hi team, we just received a new inbound lead from the website. Can you follow up today?&quot;,
    &quot;from&quot;: &quot;alerts@example.com&quot;,
    &quot;rawSize&quot;: 4821,
    &quot;subject&quot;: &quot;New lead: Acme Corp&quot;,
    &quot;timestamp&quot;: &quot;2025-09-20T15:46:14.515Z&quot;,
    &quot;to&quot;: &quot;fn-cdmixwn7kw7p@mail.microfn.dev&quot;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Built with microfn, your toolbox for composable functions&lt;/h2&gt;
&lt;p&gt;Microfn is a tiny cloud runner for composable JavaScript functions. Write your function, hit save, and microfn deploys it instantly.&lt;/p&gt;
&lt;p&gt;Ready to automate your inbox? Get started for free—no credit card required.&lt;/p&gt;
</content:encoded><author>Microfn</author></item><item><title>How to call microfn functions from other functions</title><link>https://blog.microfn.dev/posts/how-to-call-functions-from-functions</link><guid isPermaLink="true">https://blog.microfn.dev/posts/how-to-call-functions-from-functions</guid><pubDate>Mon, 22 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Microfn supports cross-function calls, so your functions can call other functions.&lt;/p&gt;
&lt;p&gt;This makes it possible to create reusable functions that you can plug into all kinds of scenarios.&lt;/p&gt;
&lt;p&gt;For example, you could have a &lt;code&gt;send-discord-message&lt;/code&gt; function that is responsible for sending a message to Discord and use it across every other function you’d like to hook up to Discord.&lt;/p&gt;
&lt;p&gt;Here’s how it works:&lt;/p&gt;
&lt;h2&gt;1. Create a new function&lt;/h2&gt;
&lt;p&gt;Head to https://microfn.dev and tap the “+” button to create a new function. Give it a nice name.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export async function main(input) {
  return {
    message: &quot;Hello there, I&apos;m a function!&quot;,
    timestamp: new Date().toISOString(),
    receivedInput: input
  };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;2. Import the @microfn/fn module&lt;/h2&gt;
&lt;p&gt;In your function, add our &lt;code&gt;@microfn/fn&lt;/code&gt; module. This is a built-in module provided by microfnhq to facilitate cross-function calls.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import fn from &apos;@microfn/fn&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;3. Use fn to send data between your functions&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;import fn from &quot;@microfn/fn&quot;;

export async function main(input) {
  const res = await fn.executeFunction(&quot;david/call-me&quot;, &quot;foobar&quot;);

  return {
    message: &quot;Hello there, I&apos;m the main function&quot;,
    timestamp: new Date().toISOString(),
    receivedOutput: res
  };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;4. Call your function&lt;/h2&gt;
&lt;p&gt;Calling the function gives us the following output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;message&quot;: &quot;Hello there, I&apos;m the main function&quot;,
  &quot;receivedOutput&quot;: {
    &quot;message&quot;: &quot;Hello there, I&apos;m a function!&quot;,
    &quot;receivedInput&quot;: {
      &quot;input&quot;: &quot;foobar&quot;
    },
    &quot;timestamp&quot;: &quot;2025-09-22T08:00:52.972Z&quot;
  },
  &quot;timestamp&quot;: &quot;2025-09-22T08:00:53.175Z&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Caveats&lt;/h2&gt;
&lt;p&gt;Only cross-calls across your account are currently supported. You will not be able to call functions not owned by you.&lt;/p&gt;
&lt;p&gt;Check out the full documentation of the &lt;code&gt;@microfn/fn&lt;/code&gt; module at https://docs.microfn.dev/modules/fn/&lt;/p&gt;
</content:encoded><author>Microfn</author></item><item><title>How to turn Any JavaScript Function Into a MCP Tool</title><link>https://blog.microfn.dev/posts/turn-functions-into-mcp-tools</link><guid isPermaLink="true">https://blog.microfn.dev/posts/turn-functions-into-mcp-tools</guid><pubDate>Sun, 20 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In today&apos;s guide, we explain how to use microfn to turn any JavaScript or TypeScript function into a MCP tool that can be plugged into your favorite agent.&lt;/p&gt;
&lt;h2&gt;Getting started&lt;/h2&gt;
&lt;p&gt;First, let&apos;s figure out what our new MCP tool should do. For this guide, I thought it would be interesting to create a tool that can store memory for the agent in the cloud, so we can use the same memory storage across differnt agents.&lt;/p&gt;
&lt;p&gt;Let&apos;s scaffold something quick. We can also ask AI directly to do this for us using the microfn MCP.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import kv from &quot;@microfn/kv&quot;;

const MEMORY_KEY = &quot;mcp-memory&quot;;

// Helper to get all memories from the KV store
async function getMemories(): Promise&amp;lt;Record&amp;lt;string, any&amp;gt;&amp;gt; {
  const memories = await kv.get&amp;lt;Record&amp;lt;string, any&amp;gt;&amp;gt;(MEMORY_KEY);
  return memories || {};
}

// Helper to save all memories to the KV store
async function saveMemories(memories: Record&amp;lt;string, any&amp;gt;) {
  await kv.set(MEMORY_KEY, memories);
}

// --- Command Functions ---

async function listAllMemories() {
  console.log(&quot;Fetching all memories.&quot;);
  const memories = await getMemories();
  console.log(`Found ${Object.keys(memories).length} memories.`);
  return memories;
}

async function createOrUpdateMemory(key: string, value: any) {
  console.log(`Creating/updating memory for key: &apos;${key}&apos;.`);
  const memories = await getMemories();
  memories[key] = value;
  await saveMemories(memories);
  console.log(`Memory for &apos;${key}&apos; successfully saved.`);
  return { success: true, message: `Memory &apos;${key}&apos; has been created/updated.` };
}

async function deleteMemory(key: string) {
  console.log(`Attempting to delete memory with key: &apos;${key}&apos;.`);
  const memories = await getMemories();
  if (key in memories) {
    delete memories[key];
    await saveMemories(memories);
    console.log(`Memory for &apos;${key}&apos; was deleted.`);
    return { success: true, message: `Memory &apos;${key}&apos; has been deleted.` };
  } else {
    console.log(`Memory with key &apos;${key}&apos; not found.`);
    return { success: false, message: `Memory &apos;${key}&apos; not found.` };
  }
}

// --- Main Handler ---

export async function main(input: { command: &quot;list&quot; | &quot;create&quot; | &quot;delete&quot;, key?: string, value?: any }) {
  const { command, key, value } = input;
  console.log(`Command: &apos;${command}&apos;`);

  switch (command) {
    case &quot;list&quot;:
      return await listAllMemories();

    case &quot;create&quot;:
      if (!key || value === undefined) {
        throw new Error(&quot;The &apos;key&apos; and &apos;value&apos; parameters are required for the &apos;create&apos; command.&quot;);
      }
      return await createOrUpdateMemory(key, value);

    case &quot;delete&quot;:
      if (!key) {
        throw new Error(&quot;The &apos;key&apos; parameter is required for the &apos;delete&apos; command.&quot;);
      }
      return await deleteMemory(key);

    default:
      // This part should be unreachable given the TypeScript type, but it&apos;s good practice
      // to have a default case for robustness.
      const exhaustiveCheck: never = command;
      throw new Error(`Unhandled command: ${exhaustiveCheck}`);
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This function&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;takes a command, whether to &lt;code&gt;list&lt;/code&gt;, &lt;code&gt;create&lt;/code&gt;, or &lt;code&gt;delete&lt;/code&gt; a memory&lt;/li&gt;
&lt;li&gt;persists the memory to kv storage&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Because we need some kind of persistence, we&apos;ll be using &lt;code&gt;@microfn/kv&lt;/code&gt; for this (&lt;a href=&quot;https://docs.microfn.dev/modules/kv/&quot;&gt;docs here&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Now let&apos;s turn this function into a MCP tool&lt;/p&gt;
&lt;h2&gt;Deploying the function&lt;/h2&gt;
&lt;p&gt;If the AI agent hasn&apos;t already done it, let&apos;s deploy this to the microfn platform and create a new function. We&apos;ll call this &lt;code&gt;memory-store&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./image-20250815134114704.png&quot; alt=&quot;Create Function Dialog&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the editor, paste the code from above and hit save, this will deploy the function onto microfn&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./image-20250815134208724.png&quot; alt=&quot;Microfn Editor&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once deployed, we can already play with our new memory store through cURL:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ curl -X POST https://microfn.dev/run/david/memory-store -d &apos;{ &quot;command&quot;: &quot;list&quot; }&apos;
{}⏎

❯ curl -X POST https://microfn.dev/run/david/memory-store -d &apos;{ &quot;command&quot;: &quot;create&quot;, &quot;key&quot;: &quot;my name&quot;, &quot;value&quot;: &quot;microfn&quot; }&apos;
{&quot;success&quot;:true,&quot;message&quot;:&quot;Memory &apos;my name&apos; has been created/updated.&quot;}⏎

❯ curl -X POST https://microfn.dev/run/david/memory-store -d &apos;{ &quot;command&quot;: &quot;list&quot; }&apos;
{&quot;my name&quot;:&quot;microfn&quot;}⏎
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Using our new function through MCP&lt;/h2&gt;
&lt;p&gt;Setting up the microfn MCP is easy. For most clients we can just do&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;mcpServers&quot;: {
    &quot;microfn&quot;: {
      &quot;command&quot;: &quot;npx&quot;,
      &quot;args&quot;: [&quot;-y&quot;, &quot;mcp-remote&quot;, &quot;https://mcp.microfn.dev/sse&quot;]
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For clients that support remote-mcp directly, we can also just use &lt;code&gt;mcp.microfn.dev/sse&lt;/code&gt; without mcp-remote. Check out https://microfn.dev/mcp for more info&lt;/p&gt;
&lt;p&gt;Once setup, let&apos;s ask cloud to use the new store:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./image-20250815134747791.png&quot; alt=&quot;Claude using microfn&quot; /&gt; Neat!&lt;/p&gt;
&lt;p&gt;Teaching Claude to use the new memory store is also super easy:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./image-20250815135044696.png&quot; alt=&quot;Claude using microfn functions&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;We can do even better&lt;/h3&gt;
&lt;p&gt;Currently an agent needs to execute the tool through the &lt;code&gt;executeFunction&lt;/code&gt; MCP tool, but we can do better.&lt;/p&gt;
&lt;p&gt;Head over to settings and enable &quot;Expose as direct MCP tool&quot;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./image-20250815135105981.png&quot; alt=&quot;Expose as direct MCP tool&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This will turn our new function into a direct MCP tool, so next time you ask Claude something, it can directly call the function:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./image-20250815180555975.png&quot; alt=&quot;Direct Tool Call&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Under the hood, microfn created a new function within the MCP server&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./image-20250815180643404.png&quot; alt=&quot;Internal Tool&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Give microfn a try&lt;/h3&gt;
&lt;p&gt;Microfn is available to use for free with a paid plan. Check it out over at https://microfn.dev and let us know what you think!&lt;/p&gt;
</content:encoded><author>Microfn</author></item></channel></rss>