feat(mcp): add HugeGraph MCP V1 tools and harden guarded writes - #368
Open
UIengF wants to merge 18 commits into
Open
feat(mcp): add HugeGraph MCP V1 tools and harden guarded writes#368UIengF wants to merge 18 commits into
UIengF wants to merge 18 commits into
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
7 times, most recently
from
August 14, 2026 09:33
6b775e3 to
d8ffd93
Compare
added 4 commits
August 14, 2026 19:42
Change-Id: I067e93324436c8dcc1fa0c0bc3651c40620e7d55
Change-Id: I485e122e5f8da1aedf21736a9ea583a527d4f0d8
Change-Id: Iab12433dd083f901d4999f4d21f3d0560e513f2a
Change-Id: Icc7b4df3633e4f01ab6dda5404592686a825d943
UIengF
force-pushed
the
graph-mcp
branch
4 times, most recently
from
August 14, 2026 12:36
c0b4c73 to
8c7e824
Compare
Change-Id: I81854014b95699bd5d613412476a9e9ba3cc66a5
…/rag client_config Apply the GRAPH-47 M4/M3/C2 ruling: reject oversized schema and graph-data plans before plan_hash, keep inspect counts opt-in with null fields, and stop hard-400ing /rag client_config without mutating process globals. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Change-Id: Idd2d0d70accb44cc582c230a83c7519b59b99fcd
Change-Id: I7a2f02243fd77686b16f36bf4df63136214a176b
Change-Id: I6e4b6fae84175d4eb8386878c94e31bde2c7b7f0
Change-Id: Iaa86e91bc875bc9ecf4219a9cc686ec30da45c49
Change-Id: I1c21c1a19cb4e229ac3586444554a5c74b6a62c9
Change-Id: I90ef3bb12822ec484c493f07e5d1b386ef34c338
Change-Id: I29be647aa2f41672f91206ab00100cfd36200378
Change-Id: I7024e01e62fc1822ae85d133e80b6bedd61c7d57
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.