Skip to content
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
cffe2e0
save
thatguyinabeanie May 30, 2025
b876f8e
native lua neovim mcp server
thatguyinabeanie May 30, 2025
47f9fe1
save
thatguyinabeanie May 30, 2025
d90918a
tests
thatguyinabeanie May 30, 2025
9a6ebac
tests/
thatguyinabeanie May 30, 2025
42583fb
.gitignore
thatguyinabeanie May 30, 2025
487cb25
cleanup docs
thatguyinabeanie May 30, 2025
f0d3545
feat: add configurable Claude CLI path support with robust detection
thatguyinabeanie May 30, 2025
d762e65
feat: add project tree helper with TDD approach
thatguyinabeanie May 30, 2025
2f5576a
feat: implement safe window toggle to prevent process interruption
thatguyinabeanie May 31, 2025
c72f8e8
Enhance documentation and implementation for Claude Code MCP integration
thatguyinabeanie May 31, 2025
007ea84
feat: implement MCP integration with detailed documentation and serve…
thatguyinabeanie May 31, 2025
725be5d
chore: update GitHub Actions checkout action to v4
thatguyinabeanie May 31, 2025
42a3fff
feat: add file reference shortcut to README for Claude prompt input
thatguyinabeanie May 31, 2025
6fa8d5c
feat: implement MCP server CLI entry with integration tests
thatguyinabeanie May 31, 2025
a9d95ed
feat: enhance MCP server CLI with remote and shell functionality
thatguyinabeanie May 31, 2025
2be4f92
feat: add MCP server Ex commands and integration tests
thatguyinabeanie May 31, 2025
a767e27
feat: add plugin contract tests for claude-code.nvim
thatguyinabeanie May 31, 2025
38232a3
save
thatguyinabeanie May 31, 2025
14c6555
fixing tests little bylittle
thatguyinabeanie May 31, 2025
879f877
fix: update Safe Window Toggle tests for improved accuracy
thatguyinabeanie May 31, 2025
fc8d525
fix specs
thatguyinabeanie May 31, 2025
20a3c4a
fix: resolve all test failures and eliminate test pollution
thatguyinabeanie May 31, 2025
306fae2
feat: implement comprehensive PR #30 review feedback with TDD approach
thatguyinabeanie May 31, 2025
e1cf8b8
feat: complete 100% of PR #30 review items with markdown formatting f…
thatguyinabeanie May 31, 2025
211c55c
feat: add comprehensive tutorials documentation for claude-code.nvim
thatguyinabeanie May 31, 2025
b216286
docs: add comprehensive comments to complex code sections
thatguyinabeanie May 31, 2025
df118b9
fix: disable startup notifications by default
thatguyinabeanie May 31, 2025
0e31904
feat: test against multiple Lua versions (5.1, 5.3, 5.4) in CI workflows
thatguyinabeanie May 31, 2025
6b1c2a7
feat: add LuaJIT versions to CI test matrix
thatguyinabeanie May 31, 2025
ae3f2ec
fix: resolve MCP server CI test failures
thatguyinabeanie May 31, 2025
9b8423d
Ci fixes (#1)
thatguyinabeanie Jun 2, 2025
ae5c1e0
feat: add MCP debug mode support (#2)
thatguyinabeanie Jun 8, 2025
059dd36
fix: update tests for mcp-neovim-server integration
thatguyinabeanie Jun 8, 2025
b43778f
docs: clarify mapping between MCP resource URIs and config keys
thatguyinabeanie Jun 9, 2025
d78c3e0
fix: resolve CI test failures and improve test infrastructure
thatguyinabeanie Jun 20, 2025
741c4e1
fix: resolve MCP server lag and add missing commands (#3)
thatguyinabeanie Jun 20, 2025
733a628
feat: make CLI detection notifications configurable (#4)
thatguyinabeanie Jun 23, 2025
e19a455
docs: consolidate CONTRIBUTING.md and document MCP architecture history
thatguyinabeanie Jun 30, 2025
f376d22
refactor: flatten MCP module structure and remove experimental code
thatguyinabeanie Jun 30, 2025
af005aa
docs: consolidate all documentation into official help file
thatguyinabeanie Jun 30, 2025
c031dc9
docs: add floating window documentation and remove CI fixes summary
thatguyinabeanie Jun 30, 2025
9911364
refactor: move test scripts to scripts/ directory
thatguyinabeanie Jun 30, 2025
6ddd0f6
cleanup: remove duplicate test_mcp.sh from root directory
thatguyinabeanie Jun 30, 2025
503d328
refactor: update tests for external mcp-neovim-server architecture
thatguyinabeanie Jun 30, 2025
66f42f6
refactor: remove bin/ directory and simplify MCP integration
thatguyinabeanie Jun 30, 2025
1cb5c94
fix: update test script and validation for new MCP architecture
thatguyinabeanie Jun 30, 2025
c5dd05a
fix: correct MCP module import in commands.lua
thatguyinabeanie Jun 30, 2025
9f6f4ce
fix: update all MCP module imports from claude-code.mcp to claude-cod…
thatguyinabeanie Jun 30, 2025
e6fb0a7
Fix: Resolve CI failures and update tests
thatguyinabeanie Jul 1, 2025
2dd6a39
Fix: Unclosed code block in project-tree-helper.md
thatguyinabeanie Jul 1, 2025
f8b8ca4
Fix: Add GEMINI.md to .gitignore and fix unclosed code block in proje…
thatguyinabeanie Jul 1, 2025
97b1714
Fix: Sanitize buffer names to handle path separators
thatguyinabeanie Jul 1, 2025
eb57d80
Fix: Unfinished string in terminal.lua
thatguyinabeanie Jul 1, 2025
a5ce92b
Fix: Resolve syntax errors and duplicate content in terminal.lua
thatguyinabeanie Jul 8, 2025
997a35a
claude.md
thatguyinabeanie Jul 10, 2025
7983247
Merge upstream changes: floating window support and cleanup
thatguyinabeanie Jul 10, 2025
8995a3f
Fix post-merge issues: restore missing functions and update tests
thatguyinabeanie Jul 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"permissions": {
"allow": [
"WebFetch(domain:docs.anthropic.com)",
"Bash(claude mcp)",
"Bash(claude mcp:*)",
"Bash(npm install:*)",
"Bash(npm run build:*)",
"Bash(./test_mcp.sh)",
"Bash(claude --mcp-debug \"test\")",
"Bash(./bin/claude-code-mcp-server:*)",
"Bash(claude --mcp-debug \"test connection\")",
"Bash(lua tests:*)",
"Bash(nvim:*)",
"Bash(claude --version)",
"Bash(timeout:*)",
"Bash(./scripts/test_mcp.sh:*)",
"Bash(make test:*)",
"Bash(lua:*)",
"Bash(gh pr view:*)",
"Bash(gh api:*)",
"Bash(git push:*)",
"Bash(git commit -m \"$(cat <<'EOF'\nfeat: implement safe window toggle to prevent process interruption\n\n- Add safe window toggle functionality to hide/show Claude Code without stopping execution\n- Implement process state tracking for running, finished, and hidden states \n- Add comprehensive TDD tests covering hide/show behavior and edge cases\n- Create new commands: :ClaudeCodeSafeToggle, :ClaudeCodeHide, :ClaudeCodeShow\n- Add status monitoring with :ClaudeCodeStatus and :ClaudeCodeInstances\n- Support multi-instance environments with independent state tracking\n- Include user notifications for process state changes\n- Add comprehensive documentation in doc/safe-window-toggle.md\n- Update README with new window management features\n- Mark enhanced terminal integration as completed in roadmap\n\nThis addresses the UX issue where toggling Claude Code window would \naccidentally terminate long-running processes.\n\n🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <[email protected]>\nEOF\n)\")",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Extract complex git commit command to improve maintainability.

The git commit command is extremely long and contains complex embedded content that makes the JSON file difficult to read and maintain. Consider extracting this to a separate script file.

Create a separate commit script and reference it:

-      "Bash(git commit -m \"$(cat <<'EOF'\nfeat: implement safe window toggle to prevent process interruption\n\n- Add safe window toggle functionality to hide/show Claude Code without stopping execution\n- Implement process state tracking for running, finished, and hidden states  \n- Add comprehensive TDD tests covering hide/show behavior and edge cases\n- Create new commands: :ClaudeCodeSafeToggle, :ClaudeCodeHide, :ClaudeCodeShow\n- Add status monitoring with :ClaudeCodeStatus and :ClaudeCodeInstances\n- Support multi-instance environments with independent state tracking\n- Include user notifications for process state changes\n- Add comprehensive documentation in doc/safe-window-toggle.md\n- Update README with new window management features\n- Mark enhanced terminal integration as completed in roadmap\n\nThis addresses the UX issue where toggling Claude Code window would \naccidentally terminate long-running processes.\n\n🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <[email protected]>\nEOF\n)\")",
+      "Bash(./scripts/commit-safe-toggle.sh)"

Then create scripts/commit-safe-toggle.sh with the commit message content.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Bash(git commit -m \"$(cat <<'EOF'\nfeat: implement safe window toggle to prevent process interruption\n\n- Add safe window toggle functionality to hide/show Claude Code without stopping execution\n- Implement process state tracking for running, finished, and hidden states \n- Add comprehensive TDD tests covering hide/show behavior and edge cases\n- Create new commands: :ClaudeCodeSafeToggle, :ClaudeCodeHide, :ClaudeCodeShow\n- Add status monitoring with :ClaudeCodeStatus and :ClaudeCodeInstances\n- Support multi-instance environments with independent state tracking\n- Include user notifications for process state changes\n- Add comprehensive documentation in doc/safe-window-toggle.md\n- Update README with new window management features\n- Mark enhanced terminal integration as completed in roadmap\n\nThis addresses the UX issue where toggling Claude Code window would \naccidentally terminate long-running processes.\n\n🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <[email protected]>\nEOF\n)\")",
"Bash(./scripts/commit-safe-toggle.sh)"
🤖 Prompt for AI Agents
In .claude/settings.local.json at line 23, the git commit command is overly long
and complex, embedding a multiline commit message directly in the JSON, which
reduces readability and maintainability. To fix this, extract the entire commit
command and message into a separate shell script file, for example,
scripts/commit-safe-toggle.sh, containing the full git commit command with the
message. Then, replace the long command in the JSON file with a simple reference
to execute this script instead.

"Bash(/Users/beanie/source/claude-code.nvim/fix_mcp_tests.sh)",
"Bash(gh pr list:*)",
"Bash(./scripts/test.sh:*)",
"Bash(gh pr comment:*)",
"Bash(stylua:*)"
],
"deny": []
},
"enableAllProjectMcpServers": true
}
84 changes: 83 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,98 @@ jobs:

- name: Verify test directory structure
run: |
echo "Main tests directory:"
ls -la ./tests/
echo "Unit test specs:"
ls -la ./tests/spec/
echo "Legacy tests:"
ls -la ./tests/legacy/
echo "Interactive tests:"
ls -la ./tests/interactive/

- name: Display Neovim version
run: nvim --version

- name: Run tests
- name: Run unit tests
run: |
export PLUGIN_ROOT="$(pwd)"
./scripts/test.sh
continue-on-error: false

- name: Run MCP integration tests
run: |
make test-mcp
continue-on-error: false

- name: Test MCP server standalone
run: |
# Test that MCP server can start without errors
timeout 5s ./bin/claude-code-mcp-server --help || test $? -eq 124
continue-on-error: false
- name: Test config generation
run: |
# Test config generation in headless mode
nvim --headless --noplugin -u tests/minimal-init.lua \
-c "lua require('claude-code.mcp').generate_config('test-config.json', 'claude-code')" \
-c "qa!"
test -f test-config.json
cat test-config.json
rm test-config.json
continue-on-error: false

mcp-integration:
runs-on: ubuntu-latest
name: MCP Integration Tests

steps:
- uses: actions/checkout@v4

- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: stable

- name: Make MCP server executable
run: chmod +x ./bin/claude-code-mcp-server

- name: Test MCP server initialization
run: |
# Test MCP server can initialize and respond to basic requests
echo '{"method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{"tools":{},"resources":{}},"clientInfo":{"name":"test-client","version":"1.0.0"}}}' | \
timeout 10s ./bin/claude-code-mcp-server > mcp_output.txt 2>&1 &
MCP_PID=$!
sleep 2

# Check if server is still running
if kill -0 $MCP_PID 2>/dev/null; then
echo "✅ MCP server started successfully"
kill $MCP_PID
else
echo "❌ MCP server failed to start"
cat mcp_output.txt
exit 1
fi

- name: Test MCP tools enumeration
run: |
# Create a test that verifies our tools are available
nvim --headless --noplugin -u tests/minimal-init.lua \
-c "lua local tools = require('claude-code.mcp.tools'); local count = 0; for _ in pairs(tools) do count = count + 1 end; print('Tools found: ' .. count); assert(count >= 8, 'Expected at least 8 tools'); print('✅ Tools test passed')" \
-c "qa!"

- name: Test MCP resources enumeration
run: |
# Create a test that verifies our resources are available
nvim --headless --noplugin -u tests/minimal-init.lua \
-c "lua local resources = require('claude-code.mcp.resources'); local count = 0; for _ in pairs(resources) do count = count + 1 end; print('Resources found: ' .. count); assert(count >= 6, 'Expected at least 6 resources'); print('✅ Resources test passed')" \
-c "qa!"

- name: Test MCP Hub functionality
run: |
# Test hub can list servers and generate configs
nvim --headless --noplugin -u tests/minimal-init.lua \
-c "lua local hub = require('claude-code.mcp.hub'); local servers = hub.list_servers(); print('Servers found: ' .. #servers); assert(#servers > 0, 'Expected at least one server'); print('✅ Hub test passed')" \
-c "qa!"

# Documentation validation has been moved to the dedicated docs.yml workflow
11 changes: 3 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ $RECYCLE.BIN/
*.swp
*.swo
*.tmp

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.vscode/

# IDE - JetBrains
.idea/
Expand Down Expand Up @@ -123,4 +117,5 @@ doc/tags-*
luac.out
*.src.rock
*.zip
*.tar.gz
*.tar.gz
.claude
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.PHONY: test test-debug test-legacy test-basic test-config lint format docs clean
.PHONY: test test-debug test-legacy test-basic test-config test-mcp lint format docs clean

# Configuration
LUA_PATH ?= lua/
TEST_PATH ?= test/
TEST_PATH ?= tests/
DOC_PATH ?= doc/

# Test command (runs only Plenary tests by default)
Expand All @@ -23,17 +23,22 @@ test-debug:
# Legacy test commands
test-legacy:
@echo "Running legacy tests..."
@nvim --headless --noplugin -u test/minimal.vim -c "lua print('Running basic tests')" -c "source test/basic_test.vim" -c "qa!"
@nvim --headless --noplugin -u test/minimal.vim -c "lua print('Running config tests')" -c "source test/config_test.vim" -c "qa!"
@nvim --headless --noplugin -u tests/legacy/minimal.vim -c "lua print('Running basic tests')" -c "source tests/legacy/basic_test.vim" -c "qa!"
@nvim --headless --noplugin -u tests/legacy/minimal.vim -c "lua print('Running config tests')" -c "source tests/legacy/config_test.vim" -c "qa!"

# Individual test commands
test-basic:
@echo "Running basic tests..."
@nvim --headless --noplugin -u test/minimal.vim -c "source test/basic_test.vim" -c "qa!"
@nvim --headless --noplugin -u tests/legacy/minimal.vim -c "source tests/legacy/basic_test.vim" -c "qa!"

test-config:
@echo "Running config tests..."
@nvim --headless --noplugin -u test/minimal.vim -c "source test/config_test.vim" -c "qa!"
@nvim --headless --noplugin -u tests/legacy/minimal.vim -c "source tests/legacy/config_test.vim" -c "qa!"

# MCP integration tests
test-mcp:
@echo "Running MCP integration tests..."
@./scripts/test_mcp.sh

# Lint Lua files
lint:
Expand Down Expand Up @@ -66,6 +71,7 @@ help:
@echo "Claude Code development commands:"
@echo " make test - Run all tests (using Plenary test framework)"
@echo " make test-debug - Run all tests with debug output"
@echo " make test-mcp - Run MCP integration tests"
@echo " make test-legacy - Run legacy tests (VimL-based)"
@echo " make test-basic - Run only basic functionality tests (legacy)"
@echo " make test-config - Run only configuration tests (legacy)"
Expand Down
Loading