MCP Server Neurolorap

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • The MCP server integrates with Codecov for tracking code coverage metrics, as evidenced by the Codecov badge in the README.

  • The MCP server integrates with GitHub for version control, repository hosting, and showing build status through badges.

  • The MCP server uses GitHub Actions for continuous integration and deployment, running tests across Python versions, checking code formatting, performing type checking, security scans, and generating coverage reports.

MCP 服务器 Neurolorap

MCP 服务器提供代码分析和文档工具。

特征

代码收集工具

  • 从整个项目收集代码
  • 从特定目录或文件收集代码
  • 从多个路径收集代码
  • 带有语法高亮的 Markdown 输出
  • 目录生成
  • 支持多种编程语言

项目结构报告工具

  • 分析项目结构和指标
  • 以 markdown 格式生成详细报告
  • 文件大小和复杂性分析
  • 基于树的可视化
  • 代码组织建议
  • 可定制的忽略模式

快速概览

# Using uvx (recommended) uvx mcp-server-neurolorap # Or using pip (not recommended) pip install mcp-server-neurolorap

您无需手动安装或配置任何依赖项。该工具将设置您分析和记录代码所需的一切。

安装

您需要在您的机器上安装UV >= 0.4.10。

要安装并运行服务器:

# Install using uvx (recommended) uvx mcp-server-neurolorap # Or install using pip (not recommended) pip install mcp-server-neurolorap

这将自动:

  • 安装所有必需的依赖项
  • 配置 Cline 集成
  • 设置服务器以供立即使用

该服务器将通过 Cline 中的 MCP 协议提供。您可以使用它来分析和记录任何项目的代码。

用法

开发者模式

服务器包含一个带有 JSON-RPC 终端接口的开发者模式,可直接交互:

# Start the server in developer mode python -m mcp_server_neurolorap --dev

可用命令:

  • help :显示可用的命令
  • list_tools :列出可用的 MCP 工具
  • collect <path> :从指定路径收集代码
  • report [path] : 生成项目结构报告
  • exit :退出开发者模式

示例会话:

> help Available commands: - help: Show this help message - list_tools: List available MCP tools - collect <path>: Collect code from specified path - report [path]: Generate project structure report - exit: Exit the terminal > list_tools ["code_collector", "project_structure_reporter"] > collect src Code collection complete! Output file: code_collection.md > report Project structure report generated: PROJECT_STRUCTURE_REPORT.md > exit Goodbye!

通过 MCP 工具

代码收集

from modelcontextprotocol import use_mcp_tool # Collect code from entire project result = use_mcp_tool( "code_collector", { "input": ".", "title": "My Project" } ) # Collect code from specific directory result = use_mcp_tool( "code_collector", { "input": "./src", "title": "Source Code" } ) # Collect code from multiple paths result = use_mcp_tool( "code_collector", { "input": ["./src", "./tests"], "title": "Project Files" } )

项目结构分析

# Generate project structure report result = use_mcp_tool( "project_structure_reporter", { "output_filename": "PROJECT_STRUCTURE_REPORT.md" } ) # Analyze specific directory with custom ignore patterns result = use_mcp_tool( "project_structure_reporter", { "output_filename": "src_structure.md", "ignore_patterns": ["*.pyc", "__pycache__"] } )

文件存储

服务器采用结构化方法存储文件:

  1. 所有生成的文件都存储在~/.mcp-docs/<project-name>/
  2. 在您的项目根目录中创建一个指向此目录的.neurolora符号链接

这确保了:

  • 清理项目结构
  • 一致的文件组织
  • 轻松访问生成的文件
  • 支持多个项目
  • 跨不同操作系统环境的可靠文件同步
  • 在 IDE 和文件浏览器中快速查看文件

自定义忽略模式

在项目根目录中创建一个.neuroloraignore文件来自定义忽略哪些文件:

# Dependencies node_modules/ venv/ # Build dist/ build/ # Cache __pycache__/ *.pyc # IDE .vscode/ .idea/ # Generated files .neurolora/

如果不存在.neuroloraignore文件,则将使用常见的忽略模式创建一个默认文件。

发展

  1. 克隆存储库
  2. 创建并激活虚拟环境:
python -m venv .venv source .venv/bin/activate # On Unix # or .venv\Scripts\activate # On Windows
  1. 安装开发依赖项:
pip install -e ".[dev]"
  1. 运行服务器:
# Normal mode (MCP server with stdio transport) python -m mcp_server_neurolorap # Developer mode (JSON-RPC terminal interface) python -m mcp_server_neurolorap --dev

测试

该项目通过自动化测试和持续集成保持高质量标准:

  • 全面的测试套件,代码覆盖率超过 80%
  • 在 Python 3.10、3.11 和 3.12 上进行自动测试
  • 通过 GitHub Actions 进行持续集成
  • 定期安全扫描和依赖性检查

有关开发和测试的详细信息,请参阅 PROJECT_SUMMARY.md。

代码质量

该项目通过各种工具保持较高的代码质量标准:

# Format code black . # Sort imports isort . # Lint code flake8 . # Type check mypy src tests # Security check bandit -r src/ safety check

所有这些检查都会通过 GitHub Actions 在拉取请求上自动运行。

CI/CD 管道

该项目使用 GitHub Actions 进行持续集成和部署:

  • 在 Python 3.10、3.11 和 3.12 上运行测试
  • 检查代码格式和样式
  • 执行类型检查
  • 运行安全扫描
  • 生成覆盖率报告
  • 构建并验证包
  • 上传测试工件

合并任何更改之前,管道必须通过。

贡献

欢迎大家贡献!请参阅CONTRIBUTING.md中的指南。

执照

MIT 许可证。详情请参阅 LICENSE 文件。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

MCP 服务器用于将文件和目录中的代码收集到单个 markdown 文档中。

  1. Features
    1. Code Collection Tool
    2. Project Structure Reporter Tool
  2. Quick Overview
    1. Installation
      1. Usage
        1. Developer Mode
        2. Through MCP Tools
        3. File Storage
        4. Customizing Ignore Patterns
      2. Development
        1. Testing
        2. Code Quality
        3. CI/CD Pipeline
      3. Contributing
        1. License
          ID: rg07wseeqe