Add Gephi AI plugin 1.3.0 - #337
Open
MattArtzAnthro wants to merge 1 commit into
Open
Conversation
MattArtzAnthro
force-pushed
the
gephi-mcp-1.2.17
branch
2 times, most recently
from
August 28, 2026 19:42
fe02f38 to
b8ea350
Compare
Gephi AI runs a small HTTP API inside Gephi Desktop so an AI assistant can drive Gephi through the Model Context Protocol: create projects, build and edit graphs, run layouts and statistics, style and filter the result, and export it, while the user watches the work happen in the Gephi window. The plugin is the Gephi half of the system; the assistant talks to it through a separate MCP server that is distributed independently and is not required for this plugin to build or install. The module registers the API server and its control service, adds a Tools menu panel for starting and stopping the server and changing the port, refuses browser-originated requests, and ships unit tests for the API surface, graph operations, lock contention, and service restart.
MattArtzAnthro
force-pushed
the
gephi-mcp-1.2.17
branch
from
August 29, 2026 16:01
b8ea350 to
339ed5a
Compare
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.
New plugin or plugin update?
What is the purpose of this plugin?
Gephi AI adds a local HTTP API to Gephi Desktop so an AI assistant can drive a
running Gephi: build and edit graphs, run layouts and statistics, style, filter,
export, and read the analyst's on-canvas selection. The assistant connects
through a separate Model Context Protocol server, distributed independently; this
plugin does not require it to build, install, or be reviewed.
The API listens on 127.0.0.1 only. It refuses any request whose
Hostheader isnot a loopback address, which blocks DNS rebinding, and any request carrying
OriginorSec-Fetch-Site, which blocks a page the user is merely visitingfrom driving the API with a cross-origin
fetch. Browsers set those headers andpage JavaScript cannot forge them; local clients send neither.
Beyond that the API is not authenticated: it trusts every local process, the same posture as
the Graph Streaming plugin's server. That is deliberate, because the client is a local MCP
server, and the module README states it plainly for users.
Companion server and documentation: https://github.com/MattArtzAnthro/gephi-ai
How to test your plugin in Gephi?
mvn clean package, thenmvn org.gephi:gephi-maven-plugin:runfrom the repository root.stopped) and the listening URL. The server starts automatically, so it should
read
runningonhttp://127.0.0.1:8080.curl http://127.0.0.1:8080/health. Expect JSON with"service": "Gephi AI API"and"status": "running".curl -i http://127.0.0.1:8080/graph/stats -H "Origin: https://example.com".Expect
403 Forbidden. Without the header the same call succeeds.and an edge, then read the graph back:
curl http://127.0.0.1:8080/healthshould nowfail to connect. Click Start to bring it back, then repeat step 5 to confirm the
restarted server still serves requests. Changing the port in the dialog takes effect
on the next start.
Checklist before submission
masterbranch to get the latest updates?Branched from
master-forgeat 47b77d2 and rebuilt against it, so the diff isthe module and one line of the root POM, with no unrelated files.
mvn -B packageon the full reactor: BUILD SUCCESS, 58 modules, 0 failures.67 JUnit tests pass in this module.
pom.xml?Apache 2.0, with
licenseFileso the text is shown at install, plus author,homepage, and source URL. Every source file carries the licence header.
24 files: the module and one added
<module>line. No deletions.67 tests, including the loopback and browser-origin guards, graph operations,
lock behaviour under real two-thread contention, and a smoke test that boots
the server on an ephemeral port and exercises it over HTTP.
Notes for reviewers
Architecture. The plugin registers no Layout, Statistics, or Filter service, because there
is no extension point for a background service, so a reviewer scanning the diff will not find a
@ServiceProvider. The module declares anOpenIDE-Module-Installlifecycle hook instead,which starts and stops the listener with the module and gives
closing()for an orderlyshutdown, plus a Tools menu action so the user can see and control it. The Graph Streaming
plugin is this repository's precedent for an embedded HTTP server inside Gephi.
Reflection. Three field lookups in
GephiControlServicereach theReentrantReadWriteLockbehindGraphLock.GraphLockexposes no timedacquisition, and without a timeout a leaked read hold wedges the session. Each
lookup is cached, wrapped, and falls back to the public blocking API on any
failure, and a unit test fails loudly if graphstore renames the field rather than
letting the plugin degrade silently. The workaround is removed once
gephi/graphstore#294 lands, which adds
tryReadLockandtryWriteLockto the public API. Reflection is also used to configure statistics and the PNGexporter, whose implementation classes expose no configuration API, to pause the renderer, and
in a selection-read fallback for builds whose visualization model does not carry the selection.
All of it is wrapped, and every path degrades to a no-op or an honest error rather than
failing the request.
Threading. Requests are served on HTTP threads. Graph mutations and file import run
there, under the lock, because the graph model does not require the event dispatch thread.
Preview refresh, screenshots, window and camera operations, and the PDF and SVG export
pipelines hop to it.
Style and structure changes are welcome. Edits from maintainers are enabled, so
please push directly to the branch rather than routing changes through me.