Problem
The MCP server can only read the graph and add conversations. There's no way to add nodes or edges at runtime. Agents can't learn new connections from analysis.
Solution
Add MCP tools for graph mutation:
add_node
{
"name": "add_node",
"inputSchema": {
"label": "Human-readable label",
"kind": "Function, Class, Module, Concept, etc.",
"source_file": "Source file path",
"signature": "Type signature"
}
}
add_edge
{
"name": "add_edge",
"inputSchema": {
"source": "Source node ID",
"target": "Target node ID",
"relation": "calls, references, contains, etc.",
"confidence": "EXTRACTED, INFERRED, or AMBIGUOUS"
}
}
Community assignment:
When a new node is added, assign it to the community of its most-connected neighbor. If no neighbors, assign to community 0.
Re-clustering trigger:
After N mutations (configurable, default: 50), trigger full Leiden re-cluster.
Acceptance Criteria
Files to Modify
- src/Graphos/Domain/Graph/Core.hs — add insertNode, insertEdge, removeNode
- src/Graphos/Domain/Community.hs — add assignNodeToCommunity
- src/Graphos/Infrastructure/Server/MCP.hs — add add_node, add_edge tools
Effort: 2-3 days
Priority: Medium
See: docs/proposals/memory-agent/05-technical-specifications.md (Spec 6, 7)
Problem
The MCP server can only read the graph and add conversations. There's no way to add nodes or edges at runtime. Agents can't learn new connections from analysis.
Solution
Add MCP tools for graph mutation:
add_node
{ "name": "add_node", "inputSchema": { "label": "Human-readable label", "kind": "Function, Class, Module, Concept, etc.", "source_file": "Source file path", "signature": "Type signature" } }add_edge
{ "name": "add_edge", "inputSchema": { "source": "Source node ID", "target": "Target node ID", "relation": "calls, references, contains, etc.", "confidence": "EXTRACTED, INFERRED, or AMBIGUOUS" } }Community assignment:
When a new node is added, assign it to the community of its most-connected neighbor. If no neighbors, assign to community 0.
Re-clustering trigger:
After N mutations (configurable, default: 50), trigger full Leiden re-cluster.
Acceptance Criteria
Files to Modify
Effort: 2-3 days
Priority: Medium
See: docs/proposals/memory-agent/05-technical-specifications.md (Spec 6, 7)