|
| 1 | +--- |
| 2 | +title: "Integrating OpenAI Agent Builder with MemMachine MCP Server" |
| 3 | +date: 2025-11-03T17:40:16-06:00 |
| 4 | +featured_image: "featured_image.png" |
| 5 | +tags: ["AI Agent", "MCP", "Generative AI", "Agent Memory", "OpenAI", "OpenAI Builder", "featured"] |
| 6 | +author: "Decheng Xu" |
| 7 | +description: "Integrating OpenAI Agent Builder with MemMachine MCP Server is easy with our step-by-step guide." |
| 8 | +aliases: |
| 9 | +--- |
| 10 | + |
| 11 | +Integrating OpenAI Agent Builder with the MemMachine MCP server allows your AI agents to store and recall information, effectively giving them memory. |
| 12 | + |
| 13 | +The setup connects your locally hosted MemMachine MCP endpoint with OpenAI’s cloud-based Agent Builder workflow system. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +Before you begin, ensure the following are ready: |
| 18 | + |
| 19 | +- MemMachine MCP HTTP server running and accessible in a local or remote environment on port 8080 (default). |
| 20 | +- OpenAI account with access to Agent Builder. |
| 21 | +- ngrok or similar tool to expose your local MCP server to the internet. |
| 22 | + |
| 23 | +## Step 1: Start the MemMachine MCP Server |
| 24 | + |
| 25 | +Start your MCP HTTP server with: |
| 26 | + |
| 27 | +```bash |
| 28 | +export MEMORY_CONFIG=/path/to/configuration.yml |
| 29 | +uv run python -m memmachine.server.mcp_http --host 0.0.0.0 --port 8080 |
| 30 | +``` |
| 31 | + |
| 32 | +Ensure the server is running and accessible. |
| 33 | + |
| 34 | +## Step 2: Open the OpenAI Agent Builder |
| 35 | + |
| 36 | +In your browser, navigate to the OpenAI Agent Builder at https://platform.openai.com/agent-builder. Create a new workflow or open an existing one. |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +## Step 3: Configure MCP Endpoint in Agent Builder |
| 41 | + |
| 42 | +On the workflow canvas, you’ll see a Start node and a default agent block. |
| 43 | +Configure it as follows: |
| 44 | + |
| 45 | +- Name: MemMachineMCP |
| 46 | +- Instructions: You are an intelligent memory assistant powered by MemMachine |
| 47 | +- Model: gpt-5 |
| 48 | +- Reasoning Effort: Low |
| 49 | +- Include Chat History: Enabled |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +## Step 4: Add MCP Memory Tools |
| 54 | + |
| 55 | +Click '+' next to the agent block to add tools. Search for "MCP" and add the following tools: |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +Then click "+ Server" to add your own connection. |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +## Step 5: Configure MCP Server Connection |
| 64 | + |
| 65 | +Run this command if you haven’t started ngrok yet: |
| 66 | + |
| 67 | +```bash |
| 68 | +ngrok http 8080 |
| 69 | +``` |
| 70 | + |
| 71 | +This command will create a secure tunnel to your local MCP server, providing you with a public URL. |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +> Important: Ensure your ngrok URL includes the /mcp/ suffix, for example: `https://abc123.ngrok-free.dev/mcp/` |
| 76 | +
|
| 77 | +You’ll now see a form titled “Connect to MCP Server”. Fill it out as follows: |
| 78 | + |
| 79 | +- MCP Endpoint URL: `https://your-ngrok-url.ngrok-free.dev/mcp/` |
| 80 | +- Label: Memmachine_MCP |
| 81 | +- Authentication Type: Custom Headers |
| 82 | +- Custom Headers: |
| 83 | + - Key: user-id |
| 84 | + - Value: user |
| 85 | + |
| 86 | +Click "Connect" to save the configuration. |
| 87 | + |
| 88 | +> Note: This `user-id` header is used by MemMachine MCP to associate memory operations (add/search) with a specific user. |
| 89 | +
|
| 90 | + |
| 91 | + |
| 92 | +## Step 6: Approve Tools and Add Server |
| 93 | + |
| 94 | +After connecting, approve the MCP tools to use the newly added server. |
| 95 | + |
| 96 | +- add_memory → Memmachine_MCP |
| 97 | +- search_memory → Memmachine_MCP |
| 98 | + |
| 99 | +Select "Always require approval for all tool calls", then click "Add". |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +## Step 7: Test the Integration |
| 104 | + |
| 105 | +Once your MemMachine MCP server is added, it will appear under “Tools” for your agent. |
| 106 | + |
| 107 | +Try these example interactions in the Preview panel: |
| 108 | + |
| 109 | +### Add Memory |
| 110 | + |
| 111 | +In the chat input, type: |
| 112 | + |
| 113 | +```text |
| 114 | +I recently bought AirPods Pro 3. |
| 115 | +``` |
| 116 | + |
| 117 | +### Search Memory |
| 118 | + |
| 119 | +Then ask: |
| 120 | + |
| 121 | +```text |
| 122 | +What did I buy recently? |
| 123 | +``` |
| 124 | + |
| 125 | +You should see the agent successfully storing and retrieving information via the MemMachine MCP server. |
| 126 | + |
| 127 | +## Conclusion |
| 128 | + |
| 129 | +By integrating OpenAI Agent Builder with MemMachine MCP, you empower your AI agents with persistent memory capabilities. This setup allows agents to remember past interactions, enhancing their usefulness and user experience. |
| 130 | + |
| 131 | +## Recommendations |
| 132 | + |
| 133 | +- User ID Consistency: Use consistent user IDs across different sessions to maintain memory continuity. |
| 134 | + - Why this matters: Keeping a consistent user ID ensures that your memory context stays linked across clients such as Claude Desktop and OpenAI Agent Builder. |
| 135 | +- ngrok: For production use, consider deploying your MCP server on a stable hosting solution rather than relying on ngrok for long-term accessibility. |
| 136 | +- Authentication: Use "Custom Headers" for authentication to easily manage user identities. In the future, OAuth support will be added for enhanced security. |
0 commit comments