Skip to content

Integrations Overview

Microfn provides powerful integration capabilities that allow your serverless functions to connect with AI assistants, development tools, and external services. These integrations extend the reach of your functions beyond traditional HTTP APIs.

IntegrationDescriptionUse Cases
Model Context Protocol (MCP)Connect AI assistants to your functionsClaude, AI automation, intelligent workflows

MCP enables AI assistants like Claude to directly interact with your Microfn functions:

  • Direct function discovery - AI can list and understand your functions
  • Intelligent execution - AI determines when and how to call functions
  • Context-aware responses - Functions provide data for AI reasoning
  • Automated workflows - Chain multiple function calls intelligently
// For Claude Desktop or other MCP clients
{
"mcpServers": {
"microfn": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.microfn.dev/sse"]
}
}
}

Microfn functions can integrate with any service that provides an API:

Receive webhooks from external services:

// GitHub webhook receiver
export default async function main(input) {
const { headers, body } = input;
const event = headers["x-github-event"];
switch(event) {
case "push":
return handlePush(body);
case "pull_request":
return handlePR(body);
default:
return { received: true };
}
}

Call external APIs from your functions:

import secret from "@microfn/secret";
export default async function main(input) {
const apiKey = await secret.getRequired("EXTERNAL_API_KEY");
const response = await fetch("https://api.service.com/endpoint", {
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json"
},
body: JSON.stringify(input)
});
return await response.json();
}

Connect Microfn to thousands of apps via Zapier:

  1. Use webhook triggers in Zapier
  2. Point to your Microfn function URL
  3. Process data and return results
  4. Continue workflow in Zapier
// Zapier-compatible function
export default async function main(input) {
// Process Zapier payload
const result = await processData(input);
// Return in Zapier-expected format
return {
id: result.id,
status: "success",
data: result
};
}

Similar to Zapier, integrate with Make.com:

export default async function main(input) {
// Make.com sends data in specific format
const { trigger, data } = input;
const processed = await handleMakeWebhook(trigger, data);
return {
success: true,
output: processed
};
}

Create applets that trigger Microfn functions:

export default async function main(input) {
// IFTTT webhook format
const { value1, value2, value3 } = input;
return {
message: `Processed: ${value1}`,
timestamp: new Date()
};
}

Build Slack apps and slash commands:

export default async function main(input) {
const { command, text, user_name, channel_id } = input;
if (command === "/microfn") {
const result = await processSlackCommand(text, user_name);
return {
response_type: "in_channel",
text: result.message,
attachments: result.attachments
};
}
}

Create Discord bots and webhooks:

export default async function main(input) {
const { content, author, channel } = input;
// Process Discord message
const response = await handleDiscordMessage(content, author);
// Send to Discord webhook
await sendDiscordWebhook(channel, response);
return { processed: true };
}

Integrate with Teams workflows:

export default async function main(input) {
const { type, from, text } = input;
if (type === "message") {
return {
type: "message",
text: `Processed: ${text}`
};
}
}

Trigger functions from GitHub workflows:

.github/workflows/deploy.yml
name: Deploy
on: [push]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Trigger Microfn
run: |
curl -X POST https://microfn.dev/run/user/function \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.MICROFN_TOKEN }}" \
-d '{"event": "deploy", "sha": "${{ github.sha }}"}'

Integrate with any CI/CD system:

// Deployment notification function
export default async function main(input) {
const { pipeline, status, commit, branch } = input;
// Log deployment
await logDeployment({
pipeline,
status,
commit,
branch,
timestamp: new Date()
});
// Send notifications
if (status === "failed") {
await notifyTeam("Deployment failed", input);
}
return { logged: true };
}
import { createClient } from '@supabase/supabase-js';
import secret from "@microfn/secret";
export default async function main(input) {
const supabaseUrl = await secret.getRequired("SUPABASE_URL");
const supabaseKey = await secret.getRequired("SUPABASE_KEY");
const supabase = createClient(supabaseUrl, supabaseKey);
const { data, error } = await supabase
.from('users')
.select('*')
.eq('id', input.userId);
return { user: data[0], error };
}
import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
import secret from "@microfn/secret";
export default async function main(input) {
const firebaseConfig = JSON.parse(
await secret.getRequired("FIREBASE_CONFIG")
);
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
// Use Firestore
const doc = await db.collection('users').doc(input.userId).get();
return { user: doc.data() };
}
import Stripe from 'stripe';
import secret from "@microfn/secret";
export default async function main(input) {
const stripe = new Stripe(
await secret.getRequired("STRIPE_SECRET_KEY")
);
// Handle Stripe webhook
const { type, data } = input;
switch(type) {
case "payment_intent.succeeded":
return handlePaymentSuccess(data.object);
case "customer.subscription.created":
return handleNewSubscription(data.object);
default:
return { received: true };
}
}
export default async function main(input) {
const { event_type, resource } = input;
// Verify PayPal webhook
const verified = await verifyPayPalWebhook(input);
if (!verified) {
return { error: "Invalid webhook signature" };
}
// Process PayPal event
switch(event_type) {
case "PAYMENT.CAPTURE.COMPLETED":
return handlePaymentComplete(resource);
default:
return { processed: true };
}
}
export default async function main(input) {
const { event, parameters } = input;
// Send to Google Analytics
await fetch(`https://www.google-analytics.com/mp/collect`, {
method: 'POST',
body: JSON.stringify({
client_id: input.clientId,
events: [{
name: event,
params: parameters
}]
})
});
return { tracked: true };
}
import Mixpanel from 'mixpanel';
export default async function main(input) {
const mixpanel = Mixpanel.init(
await secret.getRequired("MIXPANEL_TOKEN")
);
mixpanel.track(input.event, {
distinct_id: input.userId,
...input.properties
});
return { tracked: true };
}

Build custom integrations for any service:

import secret from "@microfn/secret";
class CustomServiceClient {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseUrl = "https://api.customservice.com";
}
async request(endpoint, data) {
const response = await fetch(`${this.baseUrl}${endpoint}`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
return await response.json();
}
}
export default async function main(input) {
const apiKey = await secret.getRequired("CUSTOM_SERVICE_KEY");
const client = new CustomServiceClient(apiKey);
const result = await client.request('/process', input);
return result;
}
  1. Use environment variables for API keys and secrets
  2. Validate webhooks with signatures when available
  3. Implement retry logic for unreliable services
  4. Cache responses to reduce API calls
  5. Log integration events for debugging
  6. Handle rate limits gracefully
  7. Document integration requirements
  8. Test with webhook tools like ngrok or webhook.site