Add Gephi AI plugin 1.5.1 - #337
Open
MattArtzAnthro wants to merge 6 commits into
Open
MattArtzAnthro wants to merge 6 commits into
MattArtzAnthro wants to merge 6 commits into
Conversation
MattArtzAnthro
force-pushed
the
gephi-mcp-1.2.17
branch
3 times, most recently
from
August 29, 2026 16:01
b8ea350 to
339ed5a
Compare
mbastian
self-requested a review
September 12, 2026 13:47
Author
|
@mbastian need anything from me on this? |
MattArtzAnthro
force-pushed
the
gephi-mcp-1.2.17
branch
from
September 26, 2026 17:53
339ed5a to
4a51343
Compare
Requires Gephi 0.11.3. Appearance, layout, screenshot and PNG/PDF export go through Gephi's controllers and exporters. The JDK HTTP server replaces NanoHTTPD. PDFs are US Letter. 160 tests.
Writes no longer pause the renderer; measured on Gephi 0.11.3 the pause made no difference. The busy message names a running statistic rather than the renderer. Source reformatted to Gephi core's checkstyle, with SourceRulesTest for lock release, live iterators and the interface thread. README states the Gephi 0.11.3 requirement. 170 tests.
NetBeans runs the module's installer inside the test JVM, which started the API server on 8080. With a Gephi on the same machine holding that port, the bind failure opened an error dialog mid-run. Surefire now sets java.awt.headless=true and gephi.mcp.port=0, pinned by TestEnvironmentTest. 172 tests.
…ailures A second request for a statistic already running is refused. The degree and edge-weight filters choose what to remove after taking the write lock. Requests that fail with an exception log the stack trace. 181 tests.
This branch has not been deployed
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?Rebased onto
master-forgeat 2a6232e and built againstgephi-plugin-parent0.11.3. The diff is the module plus its
<modules>entry in the root POM, with thename, origin and status comments described in CONTRIBUTING.md.
mvn -pl modules/GephiAI clean packagein this checkout: the module builds againstgephi-plugin-parent0.11.3 and its 181 JUnit tests pass. The plugin was also run inGephi 0.11.3 and exercised end to end over its HTTP API.
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.
51 files: the module and its
<modules>entry. No deletions.181 tests, including the loopback and browser-origin guards checked over a real
connection to the server as well as in isolation, request-body and query decoding,
graph operations, colouring that touches only what a filter leaves visible,
lock behaviour under real two-thread contention, a smoke test that boots the
server on an ephemeral port and exercises it over HTTP, a GEXF and GraphML
import round trip that keeps node positions and sizes, the deadline that stops a
statistic that never finishes, and reporting of layout settings that match no
property.
SourceRulesTestchecks that every graph lock is released in afinally, thatno loop runs over a live graph iterator, and that interface-thread blocks neither change
projects nor read the graph. The source follows Gephi core's checkstyle configuration.
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. The server is
the JDK's own
com.sun.net.httpserver, so the module bundles no HTTP library; Gson is itsonly bundled dependency.
Gephi's own controllers. Colouring and sizing go through
AppearanceController, layoutsthrough
LayoutController, statistics through the Statistics panel's controller, and PNG, PDFand screenshot export through Gephi's exporters and
ScreenshotController, so the Appearance,Layout and Statistics panels show what the plugin did.
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 set statistic parameters and readtheir results, since the Statistics SPI has no generic property API. 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, file import, exports,
screenshots, and project and workspace changes run there, as Gephi 0.11.3's own interface runs
project changes off the event dispatch thread. Only Swing work hops to it: updating the
Appearance, Layout and Statistics panels, switching perspective, opening a project, reading
project and workspace details, and emptying the Filters panel before a project closes.
Style and structure changes are welcome. Edits from maintainers are enabled, so
please push directly to the branch rather than routing changes through me.
The plugin, its tests and this update were worked out together with Claude, Anthropic's AI assistant. I built, ran, and verified everything on my own machine, and I am happy to re-run any of it.