Token导航 LogoToken导航TokenDH.com
Neurodev MCP logo
开发工具stdio官方级别未说明来源级核验

Neurodev MCP

MCP Server

NeuroDev MCP Server是一个基于AI的Python代码分析、测试生成与执行工具,提供全面的代码审查、智能测试生成和格式化功能,适用于Python开发工作流。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
代码分析PythonClaudeClaude DesktopClaudeCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ravikant1918

提供方

ravikant1918

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv .venv

详细介绍

🧠 NeuroDev MCP服务器

*智能代码分析、测试生成和执行*

![Python 3.8+](https://www.python.org/downloads/) ![MCP](https://modelcontextprotocol.io/) ![License: MIT](https://opensource.org/licenses/MIT) ![Tests](./test_installation.py)

一个强大的模型上下文协议(MCP)服务器,通过AI驱动的代码审查、智能测试生成和全面的测试执行来增强Python开发工作流程。

特性安装快速开始工具例子

______________________________________________________________________

✨ 特性

🔍 代码审查

  • 6强大的分析仪

- pylint -代码质量和PEP8 - flake8 -风格强制 - mypy -类型检查 - bandit -安全扫描 - radon -复杂性度量 - AST -海关检查

  • 实时问题检测
  • 安全漏洞扫描
  • 复杂性和可维护性得分

🧪 测试生成

  • 智能AST分析

- 自动生成pytest测试 - 快乐之路覆盖 - 边缘案例处理 - 异常测试 - 型式验证试验

  • 支持函数和类
  • 类型提示感知

▶️ 测试执行

  • 综合测试

- 孤立的环境 - 覆盖率报告 - 逐行分析 - 超时保护

  • 详细的通过/失败结果
  • 性能指标

🎨 代码格式化

  • 自动格式化

- black -观点化风格 - autopep8 -PEP8合规性

  • 可配置的线路长度
  • 一致的代码风格
  • 一个命令格式化

______________________________________________________________________

📦 安装

快速安装

\\\`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
\`\`\`

📁 Project Structure (click to expand)

\`\`\`
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

______________________________________________________________________

🚀 快速开始

步骤1:配置MCP客户端

🖥️ Claude Desktop

编辑 ~/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"]
    }
  }
}
💡 提示: 替换 /absolute/path/to/neurodev-mcp 与你的实际路径

🔧 Cline (VSCode)

添加到MCP设置中:

{
  "neurodev-mcp": {
    "command": "python",
    "args": ["-m", "neurodev_mcp.server"]
  }
}

🐍 Standalone Usage

直接运行服务器:

# Using the module
python -m neurodev_mcp.server

# Or as a command (if installed)
neurodev-mcp

步骤2:重新启动客户端

重新启动Claude Desktop或重新加载VSCode以加载服务器。

第三步:开始使用! 🎉

使用您的AI助手尝试以下命令:

  • *“检查此Python代码是否存在问题”*
  • *“为此功能生成单元测试”*
  • *“以覆盖率运行这些测试”*
  • *“将此代码格式化为PEP8标准”*

______________________________________________________________________

🌐 运输选项

NeuroDev MCP支持不同用例的多种传输协议:

STDIO(默认)-本地CLI

非常适合与Claude Desktop或Cline等MCP客户进行本地开发:

# Default STDIO transport
neurodev-mcp

# Or explicitly specify STDIO
neurodev-mcp --transport stdio

配置(克劳德桌面):

{
  "mcpServers": {
    "neurodev-mcp": {
      "command": "neurodev-mcp",
      "args": ["--transport", "stdio"]
    }
  }
}

SSE(服务器发送事件)-Web集成

对于基于web的集成和HTTP流:

# 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

终点:

  • SSE流: http://localhost:8000/sse
  • 信息: http://localhost:8000/messages (职位)

Web客户端示例:

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'] }
    }
  })
});

运输比较

运输用例最适合
工作室本地CLI客户端Claude Desktop、Cline、本地开发
上海证券交易所Web集成浏览器应用程序、webhooks、远程客户端

______________________________________________________________________

🛠️ 可用工具

1. code_review

🔍 使用多种静态分析工具进行全面的代码分析

输入:

{
  "code": "def calculate(x):\n    return x * 2",
  "analyzers": ["pylint", "flake8", "mypy", "bandit", "radon", "ast"]
}

输出:

  • 每个分析器的详细问题报告
  • 安全漏洞
  • 复杂性度量
  • 代码质量分数
  • 逐行建议

______________________________________________________________________

2. generate_tests

🧪 使用AST分析生成智能pytest测试

输入:

{
  "code": "def add(a: int, b: int) -> int:\n    return a + b",
  "module_name": "calculator",
  "save": false
}

输出:

  • 完整的pytest测试套件
  • 多个测试用例(快乐路径、边缘用例、异常)
  • 型式验证试验
  • 准备运行测试代码

______________________________________________________________________

3. run_tests

▶️ 使用覆盖率报告执行pytest测试

输入:

{
  "test_code": "def test_add():\n    assert add(1, 2) == 3",
  "source_code": "def add(a, b):\n    return a + b",
  "timeout": 30
}

输出:

  • 通过/失败状态
  • 覆盖率
  • 线路覆盖详细信息
  • 执行时间
  • 详细的stdout/stderr

______________________________________________________________________

4. format_code

🎨 将Python代码自动格式化为PEP8标准

输入:

{
  "code": "def   messy(  x,y  ):\n        return x+y",
  "line_length": 88
}

输出:

  • 格式优美的代码
  • 符合PEP8标准
  • 风格一致
  • 变化检测

______________________________________________________________________

💡 用法示例

示例1:完成代码审查工作流

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]

示例2:测试生成和执行

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

示例3:代码格式

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

______________________________________________________________________

📋 需求

包装版本用途
mcp≥0.9.0模型上下文协议SDK
pylint≥3.0.0代码质量分析
flake8≥7.0.0样式检查
mypy≥1.7.0静态类型检查
bandit≥1.7.5安全扫描
radon≥6.0.1复杂性度量
black≥23.12.0代码格式化
autopep8≥2.0.4PEP8格式化
pytest≥7.4.3测试框架
pytest-cov≥4.1.0覆盖率报告
pytest-timeout≥2.2.0测试超时

python 3.8或更高

______________________________________________________________________

🧪 发展

运行测试

# Run installation tests
python test_installation.py

# Run examples
python examples.py

# Run pytest (if you add tests)
pytest

用作图书馆

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)

______________________________________________________________________

❓ 故障排除

Server not appearing in MCP client?

  • ✅ 检查配置中的路径是否为 绝对的
  • ✅ 确保Python可执行文件路径正确
  • ✅ 重新启动克劳德桌面或VSCode 完全
  • ✅ 检查服务器日志是否有错误

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?

  • ✅ 确保已安装Python 3.8+
  • ✅ 激活虚拟环境: source .venv/bin/activate
  • ✅ 重新安装依赖关系: pip install -e .
  • ✅ 运行: python test_installation.py 诊断

Performance issues?

  • 一些分析器(pylint、mypy)在处理大文件时可能会很慢
  • 使用特定分析仪: "analyzers": ["flake8", "ast"]
  • 增加大型测试套件的超时时间
  • 考虑缓存结果(未来功能)

______________________________________________________________________

🤝 贡献

欢迎投稿!方法如下:

  1. 分叉存储库
  2. 创建要素分支: git checkout -b feature/amazing-feature
  3. 进行更改
  4. 运行测试: python test_installation.py
  5. 承诺: git commit -m 'Add amazing feature'
  6. 推: git push origin feature/amazing-feature
  7. 打开拉取请求

未来的增强功能

  • \[\]附加分析器(pydocstyle、秃鹫)
  • \[\]结果缓存以提高性能
  • \[\]配置文件支持
  • \[\]Web仪表板
  • \[\]多语言支持
  • \[\]CI/CD管道

______________________________________________________________________

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

______________________________________________________________________

🙏 致谢

______________________________________________________________________

📞 支持

  • 📖 文档:你在读!
  • 🐛 问题:
  • 💬 讨论:
  • 📧 电子邮件: team@neurodev.io

______________________________________________________________________

准备好加速你的Python开发了! 🚀

由以下材料制成❤️ NeuroDev团队

目录标签

目录标签

代码分析PythonClaude本地部署测试生成Python开发静态分析代码格式化

支持客户端

Claude DesktopClaudeCline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP