Neovim MCP Server for Session Management
Manage Neovim sessions with an MCP server to save, restore, and share workspaces effortlessly.
npx -y @bigcodegen/mcp-neovim-serverOverview
This repository implements an MCP (Model Context Protocol) server tailored for Neovim session management. It provides an API and tooling to save, restore, export, and share Neovim workspaces (sessions) so you can quickly move between projects, reproduce editor state, or distribute a fully configured editing environment to teammates. The server acts as a centralized store for session state and exposes operations that Neovim (or external tools) can call to manage session lifecycles.
For developers, this is useful when you want deterministic session handling across machines, automate workspace setup in CI, or integrate Neovim state with other tooling (such as language servers, workspace snapshots, or LLM-driven agents). The server follows the MCP design goals of simple, debuggable endpoints and a small surface area for integrations.
Source: https://github.com/bigcodegen/mcp-neovim-server
Features
- Save and restore complete Neovim sessions (buffers, windows, layout, cursors, optionally plugin state)
- List, rename, delete, and export/import sessions as portable archives
- HTTP API compatible with MCP-style tooling for LLM and automation integrations
- CLI client for quick local interaction
- Configurable storage backend (local filesystem by default; optional cloud/object store)
- Authentication and basic access control (token-based) for shared setups
- Hooks for Neovim plugin integration to auto-sync session state
Installation / Configuration
The repository can be run locally or deployed to a server. Below are common installation patterns—adjust to the implementation in the repo (language/runtime may vary).
Clone the repo:
Example: Python-based installation
# configure via env or config file (see config.example.yaml)
Example: Node.js-based installation
# If the project is Node-based
# edit .env for storage path, port, auth tokens
Configuration (common options)
# config.yaml (example)
server:
host: "0.0.0.0"
port: 8080
storage:
backend: "filesystem" # "filesystem" | "s3" | "gcs"
path: "/var/lib/mcp-nvim"
auth:
enabled: true
tokens:
- "your-long-token-here"
Run as a systemd service (example)
[Unit]
MCP Neovim Server
[Service]
deployer
/opt/mcp-neovim-server
/opt/mcp-neovim-server/.venv/bin/python -m mcp_neovim_server.main
CONFIG_PATH=/opt/mcp-neovim-server/config.yaml
[Install]
multi-user.target
Available Resources
The server exposes both an HTTP API and a CLI. Below are typical endpoints and commands (names may vary in the repository implementation).
HTTP API (examples)
| Method | Path | Description |
|---|---|---|
| GET | /sessions | List all saved sessions |
| POST | /sessions | Create/save a session (payload: session metadata + archive) |
| GET | /sessions/:id | Retrieve session metadata |
| GET | /sessions/:id/export | Download session archive |
| POST | /sessions/:id/restore | Trigger a restore operation (Neovim client calls back or polls) |
| DELETE | /sessions/:id | Remove stored session |
CLI (examples)
# List sessions
# Save a session from a running Neovim instance
# Restore a session locally (downloads and unpacks)
# Export a session archive
Use Cases
- Workspace portability: Save your exact Neovim layout and buffer selection before switching machines. Restore on another machine to continue work instantly.
- Team onboarding and reproducible reviews: Share a session archive with a teammate so they open the same files and layout for pairing or code review.
- CI reproducible environments: Capture an editor state that includes generated files or temporary buffers to reproduce a debugging session in CI artifacts.
- Teaching and demos: Prepare sessions that show a sequence of files and cursor locations; students can load the same session to follow along.
- LLM-assisted coding: Combine with MCP-capable LLM agents to let models open, inspect, and modify a workspace by requesting session snapshots and restores.
Tips for Developers
- Integrate the Neovim-side plugin (or simple remote commands) to call the server APIs automatically on save/exit.
- Use token-based auth for shared servers; rotate tokens and store them in your editor config manager.
- If using cloud storage backend, set up lifecycle rules to avoid unbounded storage growth for temporary sessions.
For exact command names, runtime details, and implementation-specific flags, refer to the repository README and the included example configuration files in the project.