No prebuilt connectors. No manual wiring. Just intent → action.
📖 Read the Self-Integration Manifesto
Quick Navigation:
🚀 Quick Start · 🧠 How It Works · 🛠 Tools · 🖥 UI Components
⭐ Star this repo and make your agents compatible with anything your customers need
A self-integrating AI agent can:
- Connect to external applications (CRM, task managers, communication tools, etc.)
- Discover and use available actions (create tasks, send messages, fetch data)
- Automatically build missing integrations via Membrane Agent delegation
This example provides a working implementation using:
⏱️ Time to first integration: ~2 minutes
npm installCopy .env.example to .env.local and fill in your credentials:
cp .env.example .env.localRequired variables:
MEMBRANE_WORKSPACE_KEY- Get from MembraneMEMBRANE_WORKSPACE_SECRET- Get from MembraneOPENROUTER_API_KEY- Get from OpenRouter. You can also use other LLM providers (Anthropic, OpenAI, Azure) - see the "Configuring LLM Providers" section inopencode-workspace-template/opencode-template.json.
npm run devThis starts:
- OpenCode server at
http://localhost:1337 - Next.js app at
http://localhost:3000
Open http://localhost:3000 and try:
- "Create a task in Linear"
- "Get my recent deals from HubSpot"
- "Send a message in Slack"
The integration capability consists of three parts: a system prompt, custom tools, and UI components.
When implementing this skill for your agent, you need to:
- Add the system prompt to your agent's system prompt.
- Add tools to your agent's list of available tools.
- Implement the custom UI components in your agent UI.
The agent's behavior is defined in opencode-workspace-template/AGENTS.md. It explains to agent how to use tools mentioned below and instructs it to:
- Use Membrane for interacting with external apps: create connections and use tools (actions) to perform user requests.
- Find existing integrations and build new ones if existing ones are not sufficient.
- Interact with Membrane Agent to build integrations on the fly.
Integration skill uses the following tools:
| Tool | Description |
|---|---|
list-connections |
List all existing connections for the current customer |
search-connectibles |
Search for things that connections can be created from (integrations, connectors, external apps) |
request-test-connection |
Request OAuth connection from user (interactive) |
| Tool | Description |
|---|---|
search-actions |
Search for actions by intent (e.g., "create task", "send message") |
run-action |
Execute an action by ID |
| Tool | Description |
|---|---|
create-agent-session |
Start a Membrane Agent session to build connectors/actions |
get-agent-session |
Check Membrane Agent session status (supports long polling) |
send-agent-message |
Send follow-up message to Membrane Agent session |
abort-agent-session |
Stop a running Membrane Agent session |
💡 All tools are implemented in
opencode-workspace-template/.opencode/tool/and can be easily ported to any other tool framework.
To work with Membrane, this agent implements a few custom UI components:
| Component | Description | File |
|---|---|---|
| Request a Connection | Connection UI triggered by request-test-connection tool call when agent needs user to create a connection |
connection-request.tsx |
| Membrane Agent Session Summary | Status widget showing session state (busy/idle/error) right in the agent chat UI | membrane-agent-session.tsx |
| Membrane Agent Session Details | Sidebar showing full Membrane Agent session logs (when user clicks "Show details" button) | membrane-agent-sidebar.tsx |
If you're building agents that need to operate in the real world —
this is the missing integration layer.
⭐ Star this repo if you want agents that don't stop at "I can't do that yet".
