MODEL CONTEXT PROTOCOL

Connect your agent. Give it tools.

Give an AI agent a persistent toolbox. It can create, update, deploy, and run reusable JavaScript functions in isolated cloud sandboxes, then use them again in later conversations.

Add this URL in your agent's MCP settings, then sign in to Microfn.

Why connect an agent?

Model Context Protocol gives an agent a standard way to call Microfn. The agent can turn a request into a deployed function, test it, inspect the result, and refine the code without you setting up a separate server for every tool.

The result persists in your account. A weather lookup, internal API wrapper, notification helper, or memory function remains available after the chat ends and can be composed with future tools.

EXAMPLE AGENT CONVERSATION

Create a function that checks a JSON status endpoint, stores the last result, and only sends Slack when the status changes. Deploy it and run a test.
I’ll create the function, add persistent state with @microfn/kv, and leave the Slack webhook value for you to add as a function secret.
create_function · deployed status-change-notifier
execute_function · {"changed": false, "status": "operational"}

See more complete prompts and testable function examples in the Microfn guides .

Setup as Remote MCP

For AI assistants like Claude that support remote MCP servers:

  1. Open your AI assistant's remote MCP / integrations page
  2. Add the MicroFn MCP server URL:
https://mcp.microfn.dev/mcp

The setup process will guide you through authentication with your MicroFn account.

Quick Setup via CLI

If you're using Codex or Claude Code, you can add MicroFn with a single command:

Codex

codex mcp add microfn --url https://mcp.microfn.dev/mcp

Claude Code (MCP)

claude mcp add --transport http microfn https://mcp.microfn.dev/mcp

Claude Code (Plugin)

claude plugin marketplace add microfnhq/skills
claude plugin enable microfn

Or enable it interactively with /plugins

Setup for Local MCP Clients

For local MCP clients, configure your MCP client with the following settings:

{
  "mcpServers": {
    "microfn": {
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.microfn.dev/mcp"
      ],
      "command": "npx"
    }
  }
}

This configuration will prompt you to authenticate with MicroFn when first connecting.

Authentication

MicroFn uses OAuth for secure MCP authentication. When you first connect through MCP:

  1. Your AI assistant will open a browser window
  2. Sign in to your MicroFn account
  3. Authorize the MCP connection

That's it! The OAuth flow handles everything securely, and your AI assistant will have access to your functions.

What an agent can build

Once connected, an agent can work with your Microfn account to:

  • Create and update JavaScript functions
  • Deploy a function, run it with input, and inspect the result
  • Add npm packages for APIs and data formats
  • Build HTTP endpoints, cron jobs, and email automations
  • Use persistent key-value state and call other Microfn functions
  • Expose selected functions as direct MCP tools

Start with a concrete request such as “create a daily function that checks this API and only alerts me when the value changes.” The agent can keep the implementation as a reusable tool instead of generating throwaway code in the chat.

Security boundary

Functions run in isolated cloud sandboxes. The MCP authorization gives the connected client access to your Microfn account, so review tool calls that create, change, or execute functions.

Add credentials through each function’s Secrets panel and read them with @microfn/secret. Give an agent the secret name and intended use, but do not paste the value into a prompt or source file.

See the function secrets guide for a complete example.

Resources

Learn more about MCP and how to use it effectively:

Need Help?

If you need assistance with MCP setup or have questions about the integration, contact us at: [email protected]