pauldub
MCP Serverpauldubpublic

claude code nvim

为 Neovim 提供基于 Claude AI 的代码辅助功能。

Repository Info

1
Stars
1
Forks
1
Watchers
0
Issues
Lua
Language
MIT License
License

About This Server

为 Neovim 提供基于 Claude AI 的代码辅助功能。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

claude-code.nvim

A minimal Neovim plugin for Claude Code integration. One command, no fluff.

Requirements

  • Neovim >= 0.5
  • Claude Code CLI installed

Installation

Using lazy.nvim:

{
  "pauldub/claude-code-nvim",
  config = function()
    require('claude-code').setup({
      -- Optional configuration
      timeout = 60000,  -- milliseconds (default: 1 minute)
      split_direction = "horizontal",  -- or "vertical"
      output_format = "json",  -- "text", "json", or "stream-json"
      show_metadata = false  -- show cost/duration info
    })
  end
}

Usage

Normal Mode

:Claude <your prompt>

Examples:

  • :Claude explain this function
  • :Claude refactor for better performance
  • :Claude write tests for this code

Visual Mode

Select code and run :Claude to analyze it:

  1. Select code in visual mode (v, V, or <C-v>)
  2. Type :Claude (or :'<,'>Claude)
  3. Optionally add a prompt: :'<,'>Claude explain this function

When used in visual mode:

  • Without prompt: sends just the selected code
  • With prompt: sends both your prompt and the selected code

The output will open in a new split buffer with markdown syntax highlighting.

Developer Experience

  • Type Annotations: Full LuaLS annotations for autocomplete and type checking
  • Documentation: Access help with :h claude-code
  • Testing: Run tests with ./run_tests.sh

Configuration

require('claude-code').setup({
  timeout = 120000,  -- Timeout in milliseconds (default: 60000 = 1 minute)
  split_direction = "vertical",  -- Split direction: "horizontal" or "vertical"
  output_format = "json",  -- Output format: "text", "json" (default), or "stream-json"
  show_metadata = true,  -- Show cost and timing info (default: false)
  debug = false,  -- Enable debug logging (default: false)
  
  -- Tool restrictions (optional)
  allowed_tools = "Bash,Edit,Read",  -- String or array of allowed tools
  disallowed_tools = {  -- String or array of disallowed tools
    "Bash(git push)",
    "Bash(rm -rf)",
    "Write"
  }
})

Tool Restrictions

Control which tools Claude can use:

  • allowed_tools: Whitelist specific tools or commands
    • "Bash" - allow all Bash commands
    • "Bash(npm install)" - allow only specific commands
    • "mcp__filesystem__*" - allow MCP tool patterns
  • disallowed_tools: Blacklist dangerous operations
    • "Bash(git commit)" - prevent git commits
    • {"Write", "Delete"} - prevent file modifications

## License

MIT

Quick Start

1

Clone the repository

git clone https://github.com/pauldub/claude-code-nvim
2

Install dependencies

cd claude-code-nvim
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerpauldub
Repoclaude-code-nvim
LanguageLua
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation