-
-
Notifications
You must be signed in to change notification settings - Fork 1
Codex Integration
Complete guide for connecting MCP Local Memory Service to Codex — OpenAI's AI coding agent.
- Node.js 20+ installed
- Codex CLI installed (download)
- Internet access for first-time setup
npm install -g @vheins/local-memory-mcpGlobal install gives faster startup and no re-download; then configure the MCP server in Codex (see below).
Codex stores MCP configuration in config.toml (TOML format, not JSON). There are two levels:
Open ~/.codex/config.toml and add:
[mcp_servers.local-memory]
command = "npx"
args = ["-y", "@vheins/local-memory-mcp"]If already globally installed:
[mcp_servers.local-memory]
command = "local-memory-mcp"
args = []Create .codex/config.toml in the project root with the same [mcp_servers.local-memory] block.
# Add MCP server
codex mcp add local-memory -- npx -y @vheins/local-memory-mcp
# List servers
codex mcp list
# Remove server
codex mcp remove local-memoryInside a Codex session, /mcp displays all active MCP servers including local-memory.
Codex uses TOML for env vars:
[mcp_servers.local-memory]
command = "npx"
args = ["-y", "@vheins/local-memory-mcp"]
[mcp_servers.local-memory.env]
PORT = "3456"
STORAGE_PATH = "/custom/path"Use env_vars to inherit variables from the Codex environment:
[mcp_servers.local-memory]
command = "npx"
args = ["-y", "@vheins/local-memory-mcp"]
env_vars = ["HOME", "USER"]Or with a specific source:
env_vars = [
"LOCAL_TOKEN",
{ name = "REMOTE_TOKEN", source = "remote" }
]Control whether Codex needs to ask permission before calling a tool:
[mcp_servers.local-memory]
command = "npx"
args = ["-y", "@vheins/local-memory-mcp"]
default_tools_approval_mode = "prompt"| Mode | Behavior |
|---|---|
auto |
Auto-approve all tools |
prompt |
Ask the user each time (default) |
approve |
Always approve without prompt |
[mcp_servers.local-memory]
command = "npx"
args = ["-y", "@vheins/local-memory-mcp"]
default_tools_approval_mode = "prompt"
[mcp_servers.local-memory.tools.memory-read]
approval_mode = "auto"
[mcp_servers.local-memory.tools.memory-write]
approval_mode = "prompt"
[mcp_servers.local-memory.tools.task-delete]
approval_mode = "approve"# Only these tools may be used
enabled_tools = ["memory-read", "task-read", "standard-read"]
# Disallowed tools (applied after enabled_tools)
disabled_tools = ["memory-delete", "task-delete"][mcp_servers.local-memory]
command = "npx"
args = ["-y", "@vheins/local-memory-mcp"]
enabled = false[mcp_servers.local-memory]
command = "npx"
args = ["-y", "@vheins/local-memory-mcp"]
startup_timeout_sec = 30
tool_timeout_sec = 60codex mcp listOutput:
local-memory — running
Tools: memory-read, memory-write, task-read, ...
Inside the Codex TUI, open /mcp to check server status, then test the connection by asking:
"Check local memory for this project"
If Codex responds with "No memory" (not an error), the connection is successful.
npx @vheins/local-memory-mcp dashboard
# Open http://localhost:3456Here is a complete configuration example for ~/.codex/config.toml or .codex/config.toml:
[mcp_servers.local-memory]
command = "npx"
args = ["-y", "@vheins/local-memory-mcp"]
enabled = true
startup_timeout_sec = 20
tool_timeout_sec = 45
default_tools_approval_mode = "prompt"
enabled_tools = [
"memory-read", "memory-write",
"task-read", "task-write",
"standard-read", "standard-write"
]
disabled_tools = ["memory-delete", "task-delete"]
# Tool-specific approval overrides
[mcp_servers.local-memory.tools.memory-read]
approval_mode = "auto"
[mcp_servers.local-memory.tools.task-read]
approval_mode = "auto"
[mcp_servers.local-memory.tools.memory-write]
approval_mode = "prompt"
[mcp_servers.local-memory.tools.task-write]
approval_mode = "prompt"Codex CLI does not support MCP prompts (the prompts/list and prompts/get capabilities), so prompt templates like memory-agent-core, project-briefing, or task-management-guidelines cannot be invoked as slash commands in Codex.
However, Tools and Resources work fully — you can still use the server's tools directly (e.g. memory-read, memory-write, task-read); only the predefined prompt templates are unavailable. For agents with full prompt support, see MCP Protocol Reference.
-
Server not found: check registration with
codex mcp list, check PATH (which npx,which local-memory-mcp), and re-add withcodex mcp add local-memory -- npx -y @vheins/local-memory-mcp. -
Server error / disconnect: run directly to see errors:
npx -y @vheins/local-memory-mcp. -
Configuration not taking effect: Codex reads
config.toml— make sure the TOML format is valid (not JSON). -
Slow startup: global install is faster than
npx. Codex also supportsstartup_timeout_sec— increase it if the server needs more time.
MCP Local Memory Service — local-first long-term memory (SQLite + semantic search), a web dashboard, and a codebase index for AI agents. Back to Home
Provided "AS IS", without warranty of any kind.
Home
English
- Getting Started
- Tools Reference
- MCP Concepts
- Features
- Hybrid Search
- Dashboard Guide
- Troubleshooting
- Auto-Start Dashboard
- Claude Code Integration
- Codex Integration
- Kiro Integration
Bahasa Indonesia
- Memulai
- Referensi Alat
- Referensi Protokol MCP
- Fitur Inti
- Pencarian Hibrida
- Panduan Dasbor
- Pemecahan Masalah
- Auto-Start Dasbor
- Integrasi Claude Code
- Integrasi Codex
- Integrasi Kiro
Features