codex-nvim-context-mcp
v0.1.0
Published
MCP server that exposes Neovim editor context to Codex.
Readme
codex-nvim-context-mcp
MCP server for exposing Neovim editor context to external Codex sessions.
What It Does
- starts a local MCP server over stdio
- starts a localhost HTTP ingest endpoint at
127.0.0.1:8765/session/update - stores the latest editor context published by
codex.nvim - exposes tools for Codex to read active file, selection, and cursor context
Tools
list_editor_sessionsget_active_editor_contextget_active_selectionget_active_cursor_contextping_editor_session
Requirements
- Node.js 20+
codex.nvimconfigured to publish editor context- terminal
codex
Run
npx -y codex-nvim-context-mcpLocal development:
node ./server.mjsEnvironment variables:
CODEX_NVIM_CONTEXT_MCP_HOSTCODEX_NVIM_CONTEXT_MCP_PORTCODEX_NVIM_CONTEXT_MCP_TOKENCODEX_NVIM_CONTEXT_MCP_DEBUG=1CODEX_NVIM_CONTEXT_MCP_LOG_FILE=/path/to/log- legacy
CODEX_NVIM_MCP_*variables are still accepted for compatibility
Codex CLI
Published-package target:
[mcp_servers.codex-nvim]
command = "npx"
args = ["-y", "codex-nvim-context-mcp"]
startup_timeout_sec = 60Local development:
[mcp_servers.codex-nvim]
command = "/absolute/path/to/node"
args = ["/absolute/path/to/codex-nvim-context-mcp/server.mjs"]
startup_timeout_sec = 60The package is MIT-licensed.
Smoke Test
- Start
codex-nvim-context-mcp - Enable
external_context.enabled = trueincodex.nvim - Open a file in Neovim and move the cursor or make a visual selection
- Start terminal
codex - Call
get_active_editor_context - Confirm the returned file path and line range match Neovim
Privacy Notes
- bind to localhost only
- keep
CODEX_NVIM_CONTEXT_MCP_TOKENset when sharing a machine - selection text and cursor-context text may be returned by MCP tools when the client requests them
