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.
README
<div align="center">
๐ง 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
</div>
โจ Features
<table> <tr> <td width="50%">
๐ Code Review
- 6 Powerful Analyzers
pylint- Code quality & PEP8flake8- Style enforcementmypy- Type checkingbandit- Security scanningradon- Complexity metricsAST- Custom inspections
- Real-time issue detection
- Security vulnerability scanning
- Complexity & maintainability scores
</td> <td width="50%">
๐งช Test Generation
- Intelligent AST Analysis
- Auto-generate pytest tests
- Happy path coverage
- Edge case handling
- Exception testing
- Type validation tests
- Supports functions & classes
- Type-hint aware
</td> </tr> <tr> <td width="50%">
โถ๏ธ Test Execution
- Comprehensive Testing
- Isolated environment
- Coverage reporting
- Line-by-line analysis
- Timeout protection
- Detailed pass/fail results
- Performance metrics
</td> <td width="50%">
๐จ Code Formatting
- Auto-formatting
black- Opinionated styleautopep8- PEP8 compliance
- Configurable line length
- Consistent code style
- One-command formatting
</td> </tr> </table>
๐ฆ 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
</details>
๐ Quick Start
Step 1: Configure Your MCP Client
<details open> <summary><b>๐ฅ๏ธ Claude Desktop</b></summary>
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
</details>
<details> <summary><b>๐ง Cline (VSCode)</b></summary>
Add to your MCP settings:
{
"neurodev-mcp": {
"command": "python",
"args": ["-m", "neurodev_mcp.server"]
}
}
</details>
<details> <summary><b>๐ Standalone Usage</b></summary>
Run the server directly:
# Using the module
python -m neurodev_mcp.server
# Or as a command (if installed)
neurodev-mcp
</details>
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
<details> <summary><b>Server not appearing in MCP client?</b></summary>
- โ 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
</details>
<details> <summary><b>Import or module errors?</b></summary>
# Reinstall the package
pip install -e .
# Verify installation
python -c "from neurodev_mcp import CodeAnalyzer; print('โ OK')"
# Run installation tests
python test_installation.py
</details>
<details> <summary><b>Tests failing?</b></summary>
- โ Ensure Python 3.8+ is installed
- โ
Activate virtual environment:
source .venv/bin/activate - โ
Reinstall dependencies:
pip install -e . - โ
Run:
python test_installation.pyto diagnose
</details>
<details> <summary><b>Performance issues?</b></summary>
- 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)
</details>
๐ค 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
<div align="center">
Ready to supercharge your Python development! ๐
Made with โค๏ธ by the NeuroDev Team
โญ Star on GitHub โข ๐ Report Bug โข โจ Request Feature
</div>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.