本地LLM网络搜索与知识图谱服务

MCP服务器为本地LLM提供网络搜索、页面抓取、arXiv查询及知识图谱存储功能,适用于LM Studio等MCP兼容客户端。

  • by Bjacobwork
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 Bjacobwork/Neo4j-MCP-Server

使用说明

研究MCP

MCP服务器,使本地LLM能够搜索网络、获取页面、查询arXiv并将知识存储在图形数据库中。

专为 LM 工作室 以及其他MCP兼容客户端。

特性

工具 说明
web_search 通过DuckDuckGo或Brave搜索网络
web_fetch 从URL中提取干净的内容
arxiv_search 在arXiv上搜索学术论文
neo4j_* Neo4j图形数据库上的完整CRUD操作

文档

指南 说明
安装指南 适用于Windows/macOS/Linux的Python、Node.js、Neo4j设置
LM工作室设置 MCP配置、测试、故障排除

快速开始

# Install dependencies
pip install -r requirements.txt

# Configure credentials
cp .env.example .env
# Edit .env with your Neo4j password

# Start the server
python server.py

服务器运行于 http://localhost:5003.

LM工作室集成

添加到LM工作室 mcp.json (位于 ~/.lmstudio/mcp.json 或 %USERPROFILE%\.lmstudio\mcp.json):

{
  "mcpServers": {
    "research_mcp": {
      "command": "node",
      "args": ["/full/path/to/research_mcp/mcp_shim.js"]
    }
  }
}

垫片将LM Studio的stdio协议桥接到HTTP服务器。

需求

  • Python 3.10+
  • Node.js 18+
  • Neo4j 5.x

API终点

端点 方法 描述
/health GET 健康检查
/mcp/rpc POST MCP JSON-RPC端点
/tools/execute POST REST工具执行

可用工具

Web工具

  • 网络搜索 -查询: string,max_results: int
  • web_fetch -网址: string,render_js: bool,超时: int

arXiv

  • arxiv-search -带可选前缀的查询(ti:, abs:, au:),排序选项

Neo4j

  • neo4j_create_node -创建具有标签和属性的节点
  • neo4j_find_nodes -按标签/属性查询节点
  • neo4j_update_node -更新节点属性
  • neo4j_delete_node -删除节点
  • neo4j_create关系 -将节点链接在一起
  • neo4j_get关系 -查询节点关系
  • neo4j_query -执行原始Cypher
  • neo4j_clear_tabase -擦除所有数据

配置

凭据按顺序加载: 环境变量 → .env 文件 → config/config.yaml

环境变量(推荐)

export NEO4J_URI="bolt://localhost:7687"
export NEO4J_USER="neo4j"
export NEO4J_PASSWORD="your_password"
export NEO4J_DATABASE="neo4j"
export BRAVE_API_KEY=""  # Optional

.env文件

cp .env.example .env
# Edit .env with your credentials

配置文件(回退)

cp config/config.example.yaml config/config.yaml
# Edit config/config.yaml

如果从配置文件加载了密码,服务器会记录一条警告。

可选依赖关系

# JavaScript rendering for web_fetch
pip install playwright
playwright install chromium

许可证

麻省理工学院