Skip to main content
Glama
nebula-mcp

nebula-mcp

by MuYiYong

nebula-mcp

在 Codex 中连接悦数图数据库 5.3,执行 GQL,查看表格、交互图、PROFILE 和结果解释。MCP 安装在使用者电脑上,无需部署到数据库服务器。

安装

准备 Python 3.10+、Codex,以及可访问的悦数图数据库 5.3。安装需要访问 GitHub 和 Python 包源。

macOS / Linux:

curl -fL https://github.com/MuYiYong/nebula-mcp/releases/latest/download/install.py -o install.py
python3 install.py --mode mcp

Windows PowerShell:

Invoke-WebRequest -Uri "https://github.com/MuYiYong/nebula-mcp/releases/latest/download/install.py" -OutFile install.py
py -3 install.py --mode mcp

安装器会校验并安装程序包,将 nebula 注册为独立 MCP 服务器。如果未找到 Codex CLI,按安装器输出的命令完成注册。下载或分享固定版本请使用 GitHub Releases。

Related MCP server: mcp4gql

配置连接

如果 Codex 中的 nebula 只出现在 “来自插件” 分组,且这一行没有齿轮按钮,就不能在该插件条目上编辑连接参数。请先按上面的安装命令运行 python3 install.py --mode mcp(Windows 为 py -3 install.py --mode mcp);已经安装过插件也可以运行。完成后重新打开 Codex 设置,在 插件 → MCP → 服务器 分组找到带齿轮的独立 nebula,点击齿轮,在环境变量中填写:

新建的独立条目会预置以下字段名;地址、用户名和密码留空,其他字段采用表中的默认值。已有条目升级时保留原配置,不会重置这些字段。

字段

内容

NEBULA_ADDRESSES

数据库地址 HOST:PORT;多个地址用逗号分隔

NEBULA_USERNAME

数据库用户名

NEBULA_PASSWORD

数据库密码

NEBULA_CONNECT_TIMEOUT_MS

30000

NEBULA_ALLOW_MUTATIONS

false,默认只读

NEBULA_ENVIRONMENT

环境名称,例如 dev_nebula,用于结果标识

保存并重启该 MCP,然后在新对话中输入“测试 Nebula 连接”。如果仍只看到“来自插件”的条目,先重启 Codex,再确认安装命令没有报错;不要在无齿轮的插件条目上寻找环境变量编辑入口。插件条目可以继续保留,连接配置以“服务器”分组中的独立 nebula 为准。

连接信息保存在本机 Codex config.toml 中,包含明文密码;页面编辑密码时也可能可见,请勿分享该文件或把它加入版本库。若更希望在终端无回显输入密码,可使用高级配置命令,但页面配置不需要运行该命令。

多套环境

每套环境添加一个独立的 STDIO MCP 服务器,名称由你定义,例如 dev_nebula、prod_nebula、test_nebula,不限制为两套。

根据当前公开的 Codex 插件接口,本项目不能在原生 MCP 设置页的 nebula 齿轮旁添加“复制集群”按钮。添加另一套环境时,请在同一设置页新建独立 MCP 服务器并按下面步骤配置。

  1. 在 MCP 设置中添加自定义服务器,填写一个不重复的名称。

  2. 复制已安装 nebula 的命令和参数,复用同一程序,无需重复安装。launcher.py 路径应作为一个完整参数,含空格时不要拆开。

  3. 分别填写该环境的地址、用户名和密码;建议 NEBULA_ENVIRONMENT 与服务器名称一致。

  4. 保存后按客户端提示重启对应服务器,测试连接。

切换时关闭当前条目、开启目标条目。若同时启用多套,请在查询请求中明确指定服务器名称。尚未配置的条目,以及不再使用的默认或插件条目,应保持关闭。

使用

直接输入 GQL:

使用 dev_nebula,执行 MATCH (n) RETURN n LIMIT 20

用自然语言提出查询:

使用 dev_nebula,先查看图和 Schema,再查找指定球员的队友关系。

未选图时,客户端会列出可用图并请你选择;选择后自动继续刚才的查询,不需要重复发送。后续查询沿用所选图。

自然语言、Cypher 或 nGQL 转换可配合客户端的 gql-query-generator 技能。已有 GQL 可以直接执行,不需要额外安装该技能。

查询结果可显示表格、交互图、图表、PROFILE 和解释。点击点或边查看属性与主键;复制图标复制原始 GQL 并提示“已复制”。自动添加的 PROFILE 不出现在复制的语句中。客户端不支持 MCP Apps 时,仍可查看文本和表格结果。

默认只读。需要写入时,应使用具备相应权限的账号,将 NEBULA_ALLOW_MUTATIONS 设为 true,重启 MCP,并在每次写入时明确确认。请按业务需要限制数据库账号权限。

升级

重新执行上面的下载与安装命令即可。安装器会保留已管理服务器的连接配置;自定义条目共用同一启动程序,升级后重启相关 MCP。

卸载

如添加了多个自定义条目,先在 Codex 中删除共用此程序的条目,再卸载程序:

python3 install.py --uninstall

Windows 使用 py -3 install.py --uninstall。卸载会删除受管 MCP 程序;仅删除某个环境时,在 Codex 中删除对应条目即可,不必卸载程序。

常见问题

  • CONFIGURATION_REQUIRED:程序已启动,但连接信息尚未填完整。检查地址、用户名和密码。

  • 连接失败:检查数据库服务、端口、网络和账号权限;保存配置后重启相应 MCP。

  • 没有交互图:语句需要返回点、边或路径;聚合值通常只显示表格或图表。客户端也需要支持 MCP Apps。

  • 结果被截断:仅展示了部分数据,解释和统计也仅针对返回部分;请收紧查询范围。

  • 安装时提示同名冲突:先检查已有条目的启动命令,避免覆盖其他程序的配置。

高级安装与配置 · 工具用途与兼容性

Available Tools

12 tools
nebula_configure_connectionB

Configure the database inside MCP without restarting. Connection settings stay in this process only; replacing a connection resets its session and graph choice. Passwords are never returned, but tool arguments may be stored by the host. Use installer --configure for local no-echo password entry instead if preferred.

Inputs: password (required), username (required), addresses (required), tls_enabled, +3 more. Returns: Redacted connectivity evidence.

nebula_execute_mutationA
Destructive

Execute one mutation only when NEBULA_ALLOW_MUTATIONS=true and confirm_mutation=true. This tool is destructive and returns no charts.

Inputs: statement (required), graph, confirm_mutation. Returns: Mutation status without query visualization artifacts.

nebula_execute_queryA
Read-onlyIdempotent

Execute one approved read-only GQL statement. Graph, analysis, and charts are independently configurable and default to enabled. Present all enabled results together: render a non-empty cytoscape-elements-v1 graph, render every non-empty vega-lite-v5 chart, and write a human-readable explanation from explanation_context. A table does not replace charts or the explanation.

Inputs: statement (required), graph, max_rows, render_mode, +3 more. Returns: Unified read-only query output.

nebula_get_graph_schemaC
Read-onlyIdempotent

Read a Graph Type schema; optionally include a UTF-8 byte-bounded DDL string.

Inputs: schema (required), graph_type (required), include_ddl, max_ddl_bytes. Returns: Structured Graph Type schema with optional bounded DDL.

nebula_list_environmentsA
Read-onlyIdempotent

List preconfigured environment names and the active environment; no credentials.

Inputs: no named parameters. Returns: active, environments

nebula_list_graphsA
Read-onlyIdempotent

List persistent graphs before choosing schema and graph context.

Inputs: limit, offset, schema. Returns: Typed page of available graphs.

nebula_render_graphA
Read-onlyIdempotent

Legacy compatibility entry; prefer nebula_render_result. Render a non-empty query graph together with its table, charts, explanation, and exact executed GQL. Explain specific findings, their meaning and limitations; counts alone are insufficient.

Inputs: result (required), explanation (required). Returns: Non-empty graph result and client-authored explanation for the MCP App.

nebula_render_resultA
Read-onlyIdempotent

Display a query result: graph entities open as an interactive graph, otherwise open the table. Supply an evidence-based explanation of result meaning, specific observations, insights and limitations, not only counts. Includes charts and actual GQL.

Inputs: result (required), explanation (required). Returns: Any query result and client-authored explanation for the MCP App.

nebula_select_graphA

Choose the user's graph using SESSION SET GRAPH in the existing database session. Automatically execute the last read-only query blocked by a missing graph. Return its result; do not execute that query again.

Inputs: graph (required). Returns: graph, result, session_statement

nebula_switch_environmentA

Switch to a preconfigured environment after testing its connection. Failure keeps the existing session. Success resets selected graph and pending query. Does not execute pending queries in the new environment or switch host MCP servers.

Inputs: name (required). Returns: Redacted connectivity evidence.

nebula_test_connectionA
Read-onlyIdempotent

Test the configured YueShu connection and return only redacted settings.

Inputs: no named parameters. Returns: Redacted connectivity evidence.

nebula_validate_gqlA
Read-onlyIdempotent

Validate YueShu 5.3 GQL for placeholders, dialect residuals, policy, and optional EXPLAIN. This never executes the original statement.

Inputs: statement (required), graph, run_explain. Returns: Static policy evidence and optional non-executing EXPLAIN result.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 12 tools

    Disambiguation4/5

    Tools mostly target distinct resources and actions: environment listing, connection setup/testing, graph listing/selection, schema retrieval, GQL validation, read execution, mutation execution, and rendering. However, nebula_render_graph is explicitly a legacy alias of nebula_render_result, and nebula_execute_query also renders results, creating mild ambiguity about when to use render_result separately. The descriptions mitigate but do not fully eliminate this overlap.

    Naming Consistency5/5

    All 12 tools use consistent snake_case with a nebula_ prefix and a verb_noun pattern: list_environments, select_graph, execute_query, validate_gql, etc. There is no mixing of conventions or vague verb styles.

    Tool Count5/5

    12 tools sit well within the 3-15 sweet spot for a graph database MCP. Each tool covers a distinct operational area (connection, environment, graph selection, schema, validation, execution, mutation, rendering) without excessive redundancy.

    Completeness4/5

    The surface covers connection and environment setup, graph listing and selection, schema retrieval, GQL validation, read query execution, mutation execution, and result rendering. Minor gaps exist for explicit graph creation/deletion or query cancellation, but the core query lifecycle is well covered and mutations may handle DDL.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A MCP server that exposes GraphQL schema information to LLMs like Claude. This server allows an LLM to explore and understand large GraphQL schemas through a set of specialized tools, without needing to load the whole schema into the context
      46
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      GraphQL MCP Server that acts as a bridge allowing MCP clients (like Cursor or Claude Desktop) to interact with target GraphQL APIs through standard tools for schema introspection and operation execution.
      2
      3
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      A high-performance code knowledge graph server implementing MCP, indexing codebases into a structured AST knowledge graph with semantic search, call graph traversal, and HTTP route tracing.
      4,211 npm
      97
      MIT