Skip to content

Commit c6bc820

Browse files
committed
Add Agent Bridge addon
Agent Bridge embeds a control bridge in a running Gramps session so an AI agent can drive the live application: read and modify the tree, operate the UI, and create and load plugins on the fly. It ships an MCP (Model Context Protocol) server so any MCP-capable AI can drive Gramps through standard tools. The gramplet polls a watched control directory on the GTK main thread and executes submitted Python in a persistent namespace with dbstate, db, uistate, gui and gramps_lib bound; the MCP server is a thin stdio adapter over that directory. No network port is opened. As defense-in-depth, every request must carry a shared secret token. The gramplet generates it on first run at ~/.gramps_agent/token (owner-only) and refuses any request without it; the MCP server and the debug CLI read the same file automatically. GRAMPS_AGENT_TOKEN overrides the file.
1 parent 771db58 commit c6bc820

7 files changed

Lines changed: 977 additions & 0 deletions

File tree

AgentBridge/AgentBridge.gpr.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#
2+
# Gramps - a GTK+/GNOME based genealogy program
3+
#
4+
# Copyright (C) 2026 Brian Caudill
5+
#
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 2 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License along
17+
# with this program; if not, see <https://www.gnu.org/licenses/>.
18+
#
19+
20+
# ------------------------------------------------------------------------
21+
#
22+
# Register the Agent Bridge gramplet
23+
#
24+
# ------------------------------------------------------------------------
25+
register(
26+
GRAMPLET,
27+
id="Agent Bridge",
28+
name=_("Agent Bridge"),
29+
description=_(
30+
"Embeds a control bridge in Gramps so an AI agent can drive the live "
31+
"application through a watched directory or an MCP server. Executes "
32+
"submitted Python on the GTK main thread. For developers and power "
33+
"users; runs arbitrary code at your privileges."
34+
),
35+
version="0.0.1",
36+
gramps_target_version="6.0",
37+
status=STABLE,
38+
audience=DEVELOPER,
39+
fname="AgentBridge.py",
40+
gramplet="AgentBridge",
41+
gramplet_title=_("Agent Bridge"),
42+
height=140,
43+
expand=True,
44+
detached_width=520,
45+
detached_height=300,
46+
navtypes=["Dashboard"],
47+
authors=["Brian Caudill"],
48+
authors_email=["brian.m.caudill@gmail.com"],
49+
maintainers=["Brian Caudill"],
50+
maintainers_email=["brian.m.caudill@gmail.com"],
51+
help_url="Addon:AgentBridge",
52+
)

0 commit comments

Comments
 (0)