neurodev-mcp

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.

Category
访问服务器

README

<div align="center">

🧠 NeuroDev MCP Server

Intelligent Code Analysis, Test Generation & Execution

Python 3.8+ MCP License: MIT Tests

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.

FeaturesInstallationQuick StartToolsExamples

</div>


✨ Features

<table> <tr> <td width="50%">

🔍 Code Review

  • 6 Powerful Analyzers
    • pylint - Code quality & PEP8
    • flake8 - Style enforcement
    • mypy - Type checking
    • bandit - Security scanning
    • radon - Complexity metrics
    • AST - 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 style
    • autopep8 - 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-mcp with 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.py to 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:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: python test_installation.py
  5. Commit: git commit -m 'Add amazing feature'
  6. Push: git push origin feature/amazing-feature
  7. 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


📞 Support


<div align="center">

Ready to supercharge your Python development! 🚀

Made with ❤️ by the NeuroDev Team

⭐ Star on GitHub🐛 Report Bug✨ Request Feature

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选