Back to MCP directory
publicPublicdnsLocal runtime

notebook-intelligence

Notebook Intelligence (NBI) 是一个为JupyterLab设计的AI编码助手和可扩展AI框架,支持GitHub Copilot及其他LLM提供商的模型,包括本地Ollama模型。它通过代码生成、自动补全和聊天界面等功能显著提升生产力,并支持Model Context Protocol (MCP) 服务集成。

article

README

🚀 笔记本智能

笔记本智能项目为用户提供了一系列实用的功能,如智能代码补全、笔记本增强功能和自动格式化等,能有效提升用户在笔记本环境中的使用体验。同时,还支持 MCP 服务器的灵活配置。

🚀 快速开始

你可以按照下面的步骤来安装本项目。

📦 安装指南

1. 通过 pip 安装

pip install notebook-intelligence

2. 克隆仓库并安装

git clone https://github.com/yourusername/notebook-intelligence.git
cd notebook-intelligence
python setup.py install

✨ 主要特性

1. 智能代码补全

  • 自动补全:输入代码时,系统会根据上下文提供相关建议。
  • 智能感知:支持对数据、函数和方法的动态提示。

2. 笔记本增强功能

a. 快速搜索

  • 使用 /Ctrl + Shift + F 进行全局搜索。
  • 支持在搜索中使用正则表达式。

b. 快速替换

  • 使用 Shift + Ctrl + F 或编辑菜单中的“查找和替换”功能。
  • 支持在替换对话框中直接输入或粘贴多行文本。

3. 自动格式化

  • 代码格式化:支持基于预定义样式(如 Google Python Style Guide)的自动格式化。
  • 自动生成缩进:根据上下文智能调整缩进。

🔧 技术细节

1. MCP 服务器配置

基本配置

nbi-config.json 文件中添加以下内容:

"mcpServers": {
    "filesystem": {
        "command": "npx",
        "args": [
            "-y",
            "@modelcontextprotocol/server-filesystem",
            "/Users/mbektas/mcp-test"
        ]
    }
}

高级配置

a. 环境变量
"mcpServers": {
    "servername": {
        "command": "",
        "args": [],
        "env": {
            "ENV_VAR_NAME": "ENV_VAR_VALUE"
        }
    },
}
b. 安全配置
"mcpServers": {
    "remoterservername": {
        "url": "http://127.0.0.1:8080/sse",
        "headers": {
            "Authorization": "Bearer mysecrettoken"
        }
    },
}
c. 禁用服务器
"mcpServers": {
    "servername2": {
        "command": "",
        "args": [],
        "disabled": true
    },
}

2. 自定义聊天参与者

nbi-config.json 文件中添加以下内容:

"participants": {
    "fs": {
        "name": "MCP - File system",
        "servers": ["filesystem"]
    }
}

3. 集成内置工具

"participants": {
    "fs": {
        "name": "MCP - File system",
    }
}
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client