Repository navigation
feat(mcp): add graph-mcp module V1 - #368
Merged
Merged
Conversation
imbajin
reviewed
Jun 29, 2026
imbajin
left a comment
Member
There was a problem hiding this comment.
Reviewed the current MCP/client changes at head 8842bb53007102b47d50e4eaabb6e2cc51e9b526. I found several install/runtime safety issues that should be addressed before relying on the new MCP package independently. Local non-live checks passed, so these comments focus on behavioral and packaging gaps rather than test failures.
VGalaxies
reviewed
Jun 29, 2026
VGalaxies
left a comment
Contributor
There was a problem hiding this comment.
Review summary
- Blocking: yes
- Summary: The PR still has blocking correctness and write-safety issues in the new MCP/Thin API surface.
- Evidence:
- static review of
git diff origin/main...HEAD git diff --check origin/main...HEADonly reports the known blank-line style issue
- static review of
UIengF
force-pushed
the
graph-mcp
branch
3 times, most recently
from
July 16, 2026 11:05
acd7490 to
8dac401
Compare
UIengF
force-pushed
the
graph-mcp
branch
3 times, most recently
from
August 12, 2026 05:26
73c47ad to
e207127
Compare
UIengF
force-pushed
the
graph-mcp
branch
12 times, most recently
from
August 16, 2026 07:38
8c7e824 to
a7bbc63
Compare
- Introduce the MCP server, configuration, and tool modules. - Integrate the standalone package into development workflows. - Preserve the existing repository workflow configuration. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Align graph extraction and RAG API contracts. - Adapt supporting client calls for the MCP integration. - Keep graph connection context consistent across callers.
- Add MCP coverage and quality checks. - Document tool usage and update examples. - Introduce the initial package publishing workflow.
- Tighten Gremlin tokenization and schema field validation. - Enforce write limits and make inspection counts optional. - Handle schema readiness and server-managed metadata. - Cover malformed predicates and schema user data. Co-authored-by: Duyifeng <uleng@DuyifengdeMacBook-Pro.local>
- Define the supporting client safety contracts. - Enforce runtime limits and guarded tool capabilities. - Preserve fail-closed behavior for unsupported operations.
- Add durable server-issued plans and operation receipts. - Coordinate confirmation, replay protection, and reconciliation. - Test confirmed-write safety and failure outcomes.
- Document canonical write confirmation workflows. - Describe supported operations and preview-only boundaries. - Normalize license headers and formatting checks.
- Use the official Python client distribution. - Enforce structured-query output budgets. - Reject malformed AI envelopes without losing errors. - Align user guidance and integration-check ordering. Co-authored-by: UlengF <djd21036@gmail.com>
- Align client and MCP versions and dependency bounds. - Add isolated uvx distribution smoke checks. - Centralize publication in the actions repository. - Document versioned package installation.
- Preserve schema design context and extraction metadata. - Reject duplicate vertex identities before preview reads. - Honor index exclusion in schema inspection. - Close SQLite connections on all operation outcomes. - Cover the corrected contracts with regression tests.
- Remove temporary write-safety plans and execution logs. - Consolidate architecture, capability boundaries, and next steps. - Retain a practical integration checklist with stable naming. - Align publishing guidance with the paired component workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds
hugegraph-mcp, a standalone thin adapter that gives MCP clients and agents controlled access to HugeGraph and HugeGraph-AI. The MCP layer owns stable tool contracts, configuration and authorization, typed queries, immutable server-side write plans, durable operation receipts, status inspection, and reconciliation.The default public contract is
v2_core;v1remains available as a compatibility mode. The runtime requires Python>= 3.10and HugeGraph Server>= 1.7.0; unverified versions, backends, and atomic capabilities fail closed.Public tool contract
v2_coreregisters 16 tools by default.v1registers 10 compatibility tools and omitsinspect_schema_tool,query_graph_data_tool,mutate_graph_properties_tool,confirm_write_tool,get_write_status_tool, andreconcile_write_tool.import_graph_data_tool(mode=table)remainsFEATURE_DISABLED; unimplementedtable_dataandmappingparameters are not exposed in the MCP JSON Schema.HUGEGRAPH_MCP_READONLY=true,HUGEGRAPH_MCP_ALLOW_AI=false, andHUGEGRAPH_MCP_ADMIN_MODE=false.Confirmed-write safety model
The canonical flow is:
plan_id. Backend IDs, endpoints, expected and desired state, operation order, graph target, principal, and expiry are loaded from the persisted server plan.plan_idagain returns the durable result without issuing another write.APPLIED,ALREADY_APPLIED,REJECTED,CONFLICT,PARTIAL,UNKNOWN, andRETRYABLE_NOT_APPLIEDretain distinct meanings.UNKNOWNandPARTIALare never retried automatically.plan_hash,nonce, andexpires_atfields remain locator-only compatibility inputs for one release. They must be provided together, cannot be mixed withplan_id, and produce a deprecation warning.v1.Executable boundaries
The canonical user-confirmed flow currently supports:
The following operations are preview-only, issue no
plan_id, returnFEATURE_DISABLEDon confirmation, and perform no write:cascade=false, because Docker concurrency testing reproduced a non-isolated edge-add/delete race.refresh_vid_embeddings_toolremains a separate admin write tool gated by readonly, AI, and admin configuration.Raw Gremlin boundary
All public Raw Gremlin execution paths are currently disabled:
execute_gremlin_read_toolexecute_gremlin_write_toolgenerate_gremlin_tool(execute=true)Admin mode cannot bypass this gate. Raw execution can only be enabled after the deployment enforces a read-only database principal, server evaluation/wait timeouts, a server-side result cap, and a streaming client-side byte cap. Typed reads and
generate_gremlin_tool(execute=false)remain available.Additional changes
SINGLE,LIST,SET, UUID, DATE, BLOB, OBJECT, and numeric bounds.Verification
Current head
845baaf2:784 passed, 17 skipped71 passed, 70 skipped15 passed, with 5 dependency deprecation warnings13 passed8 passed16 passedgit diff --check: passedtools/list, andinspect_graph_toolcall passedOut of scope
This PR does not add GraphRAG question answering, SQL/table import, arbitrary Raw Gremlin execution, general unconditional graph-data update, index/rebuild, destructive schema apply, MCP resources, HTTP/SSE transport, or multi-replica writes backed by independent SQLite files.