Neurodev MCP
NeuroDev MCP is a smart Model Context Protocol server for Python development. It performs deep code review, generates high-quality unit tests, runs test suites with coverage, and formats code automatically β all through an AI assistant like Claude or Cline.
Installation
npx neurodev-mcpAsk AI about Neurodev MCP
Powered by Claude Β· Grounded in docs
I know everything about Neurodev MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
π§ NeuroDev MCP Server
Intelligent Code Analysis, Test Generation & Execution
A powerful Model Context Protocol (MCP) server that supercharges your Python development workflow with AI-powered code review, intelligent test generation, and comprehensive test execution.
Features β’ Installation β’ Quick Start β’ Tools β’ Examples
β¨ Features
π Code Review
|
π§ͺ Test Generation
|
βΆοΈ Test Execution
|
π¨ Code Formatting
|
π¦ Installation
Quick Install
```bash
# Clone the repository
git clone https://github.com/ravikant1918/neurodev-mcp.git
cd neurodev-mcp
# Create virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\\Scripts\\activate
# Install the package
pip install -e .
\`\`\`
### **Verify Installation**
\`\`\`bash
# Run tests (should show 15/15 passing)
python test_installation.py
# Test the server
python -m neurodev_mcp.server
\`\`\`
<details>
<summary><b>π Project Structure</b> (click to expand)</summary>
\`\`\`
neurodev-mcp/
ββ neurodev_mcp/ # π¦ Main package
β ββ __init__.py # Package exports
β ββ server.py # MCP server entry point
β ββ analyzers/ # π Code analysis
β β ββ __init__.py
β β ββ code_analyzer.py # Multi-tool static analysis
β ββ generators/ # π§ͺ Test generation
β β ββ __init__.py
β β ββ test_generator.py # AST-based test creation
β ββ executors/ # βΆοΈ Test execution
β ββ __init__.py
β ββ test_executor.py # Test running & formatting
ββ pyproject.toml # Project configuration
ββ README.md # This file
ββ test_installation.py # Installation validator
ββ examples.py # Usage examples
ββ requirements.txt # Dependencies
π Quick Start
Step 1: Configure Your MCP Client
π₯οΈ Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"neurodev-mcp": {
"command": "/absolute/path/to/neurodev-mcp/.venv/bin/python",
"args": ["-m", "neurodev_mcp.server"]
}
}
}
π‘ Tip: Replace
/absolute/path/to/neurodev-mcpwith your actual path
π§ Cline (VSCode)
Add to your MCP settings:
{
"neurodev-mcp": {
"command": "python",
"args": ["-m", "neurodev_mcp.server"]
}
}
π Standalone Usage
Run the server directly:
# Using the module
python -m neurodev_mcp.server
# Or as a command (if installed)
neurodev-mcp
Step 2: Restart Your Client
Restart Claude Desktop or reload VSCode to load the server.
Step 3: Start Using! π
Try these commands with your AI assistant:
- "Review this Python code for issues"
- "Generate unit tests for this function"
- "Run these tests with coverage"
- "Format this code to PEP8 standards"
π Transport Options
NeuroDev MCP supports multiple transport protocols for different use cases:
STDIO (Default) - Local CLI
Perfect for local development with MCP clients like Claude Desktop or Cline:
# Default STDIO transport
neurodev-mcp
# Or explicitly specify STDIO
neurodev-mcp --transport stdio
Configuration (Claude Desktop):
{
"mcpServers": {
"neurodev-mcp": {
"command": "neurodev-mcp",
"args": ["--transport", "stdio"]
}
}
}
SSE (Server-Sent Events) - Web Integration
For web-based integrations and HTTP streaming:
# Run with SSE on default port (8000)
neurodev-mcp --transport sse
# Custom host and port
neurodev-mcp --transport sse --host 0.0.0.0 --port 3000
Endpoints:
- SSE Stream:
http://localhost:8000/sse - Messages:
http://localhost:8000/messages(POST)
Web Client Example:
const sse = new EventSource('http://localhost:8000/sse');
sse.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Received:', data);
};
// Send message
fetch('http://localhost:8000/messages', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
method: 'tools/call',
params: {
name: 'code_review',
arguments: { code: 'def test(): pass', analyzers: ['pylint'] }
}
})
});
Transport Comparison
| Transport | Use Case | Best For |
|---|---|---|
| STDIO | Local CLI clients | Claude Desktop, Cline, local development |
| SSE | Web integrations | Browser apps, webhooks, remote clients |
π οΈ Available Tools
1. code_review
π Comprehensive code analysis with multiple static analysis tools
Input:
{
"code": "def calculate(x):\n return x * 2",
"analyzers": ["pylint", "flake8", "mypy", "bandit", "radon", "ast"]
}
Output:
- Detailed issue reports from each analyzer
- Security vulnerabilities
- Complexity metrics
- Code quality scores
- Line-by-line suggestions
2. generate_tests
π§ͺ Intelligent pytest test generation using AST analysis
Input:
{
"code": "def add(a: int, b: int) -> int:\n return a + b",
"module_name": "calculator",
"save": false
}
Output:
- Complete pytest test suite
- Multiple test cases (happy path, edge cases, exceptions)
- Type validation tests
- Ready-to-run test code
3. run_tests
βΆοΈ Execute pytest tests with coverage reporting
Input:
{
"test_code": "def test_add():\n assert add(1, 2) == 3",
"source_code": "def add(a, b):\n return a + b",
"timeout": 30
}
Output:
- Pass/fail status
- Coverage percentage
- Line coverage details
- Execution time
- Detailed stdout/stderr
4. format_code
π¨ Auto-format Python code to PEP8 standards
Input:
{
"code": "def messy( x,y ):\n return x+y",
"line_length": 88
}
Output:
- Beautifully formatted code
- PEP8 compliant
- Consistent style
- Change detection
π‘ Usage Examples
Example 1: Complete Code Review Workflow
You: "Review this code for issues and security problems"
[paste code]
AI: [Uses code_review tool]
β Finds 3 style issues
β Detects 1 security vulnerability
β Suggests complexity improvements
You: "Fix those issues and show me the updated code"
AI: [Provides fixed code with explanations]
Example 2: Test Generation & Execution
You: "Generate tests for this function and run them"
def divide(a: float, b: float) -> float:
if b == 0:
raise ValueError("Cannot divide by zero")
return a / b
AI: [Uses generate_tests tool]
β Creates 5 test cases
β Includes edge cases (zero, negative numbers)
β Tests exception handling
[Uses run_tests tool]
β 5/5 tests passing β
β 100% code coverage
β All edge cases handled
Example 3: Code Formatting
You: "Format this messy code"
def calculate( x,y,z ):
result=x+y+z
if result>10:
return True
return False
AI: [Uses format_code tool]
β Applies black formatting
β Returns clean, PEP8-compliant code
def calculate(x, y, z):
result = x + y + z
if result > 10:
return True
return False
π Requirements
| Package | Version | Purpose |
|---|---|---|
mcp | β₯0.9.0 | Model Context Protocol SDK |
pylint | β₯3.0.0 | Code quality analysis |
flake8 | β₯7.0.0 | Style checking |
mypy | β₯1.7.0 | Static type checking |
bandit | β₯1.7.5 | Security scanning |
radon | β₯6.0.1 | Complexity metrics |
black | β₯23.12.0 | Code formatting |
autopep8 | β₯2.0.4 | PEP8 formatting |
pytest | β₯7.4.3 | Testing framework |
pytest-cov | β₯4.1.0 | Coverage reporting |
pytest-timeout | β₯2.2.0 | Test timeouts |
Python: 3.8 or higher
π§ͺ Development
Running Tests
# Run installation tests
python test_installation.py
# Run examples
python examples.py
# Run pytest (if you add tests)
pytest
Using as a Library
from neurodev_mcp import CodeAnalyzer, TestGenerator, TestExecutor
import asyncio
# Analyze code
code = "def hello(): print('world')"
result = asyncio.run(CodeAnalyzer.analyze_ast(code))
# Generate tests
tests = TestGenerator.generate_tests(code, "mymodule")
# Run tests
output = TestExecutor.run_tests(test_code, source_code)
β Troubleshooting
Server not appearing in MCP client?
- β Check that the path in config is absolute
- β Ensure the Python executable path is correct
- β Restart Claude Desktop or VSCode completely
- β Check server logs for errors
Import or module errors?
# Reinstall the package
pip install -e .
# Verify installation
python -c "from neurodev_mcp import CodeAnalyzer; print('β OK')"
# Run installation tests
python test_installation.py
Tests failing?
- β Ensure Python 3.8+ is installed
- β
Activate virtual environment:
source .venv/bin/activate - β
Reinstall dependencies:
pip install -e . - β
Run:
python test_installation.pyto diagnose
Performance issues?
- Some analyzers (pylint, mypy) can be slow on large files
- Use specific analyzers:
"analyzers": ["flake8", "ast"] - Increase timeout for large test suites
- Consider caching results (future feature)
π€ Contributing
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
python test_installation.py - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
Future Enhancements
- Additional analyzers (pydocstyle, vulture)
- Result caching for performance
- Configuration file support
- Web dashboard
- Multi-language support
- CI/CD pipeline
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Built with the Model Context Protocol
- Powered by pylint, flake8, mypy, bandit, radon
- Testing with pytest
- Formatting with black
π Support
- π Documentation: You're reading it!
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π§ Email: team@neurodev.io
Ready to supercharge your Python development! π
Made with β€οΈ by the NeuroDev Team
β Star on GitHub β’ π Report Bug β’ β¨ Request Feature
