Skip to content

Commit 1d70c44

Browse files
sunchuljungCopilot
andauthored
Updated architecture with consideration to rune-admin (#4)
* Updated architecture with consideration to rune-admin * Initial plan * Fix shell variable interpolation in Python heredoc Co-authored-by: sunchuljung <108503957+sunchuljung@users.noreply.github.com> * Improve error message clarity in Python heredoc Co-authored-by: sunchuljung <108503957+sunchuljung@users.noreply.github.com> * Improve variable naming for better clarity Co-authored-by: sunchuljung <108503957+sunchuljung@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 80530a7 commit 1d70c44

10 files changed

Lines changed: 125 additions & 227 deletions

.claude/mcp_servers.template.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
{
22
"mcpServers": {
33
"rune-vault": {
4-
"command": "python3",
5-
"args": [
6-
"PLUGIN_DIR/mcp/vault/vault_mcp.py"
7-
],
8-
"env": {
9-
"VAULT_CONFIG": "~/.rune/config.json"
10-
},
11-
"description": "Rune-Vault MCP server for FHE key management and decryption"
4+
"type": "sse",
5+
"url": "VAULT_URL/sse",
6+
"description": "Remote Rune-Vault MCP server for FHE decryption (deployed by team admin)"
127
},
138
"envector": {
149
"command": "python3",

.github/claude-plugin.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://claude.ai/schemas/plugin-v1.json",
33
"name": "rune",
44
"displayName": "Rune - Organizational Memory",
5-
"version": "0.2.0",
5+
"version": "0.2.1",
66
"description": "FHE-encrypted organizational memory system for teams. Capture and retrieve institutional knowledge with zero-knowledge privacy.",
77
"author": {
88
"name": "CryptoLabInc",
@@ -111,12 +111,10 @@
111111
},
112112
"mcpServers": {
113113
"rune-vault": {
114-
"description": "Rune-Vault MCP server for FHE key management",
115-
"command": "python3",
116-
"args": ["mcp/vault/vault_mcp.py"],
117-
"env": {
118-
"VAULT_CONFIG": "~/.rune/config.json"
119-
}
114+
"description": "Remote Rune-Vault MCP server for FHE decryption (deployed by team admin)",
115+
"type": "sse",
116+
"url": "${VAULT_URL}/sse",
117+
"note": "VAULT_URL is configured in ~/.rune/config.json and set during /rune configure"
120118
},
121119
"envector": {
122120
"description": "enVector MCP server for encrypted vectors",

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "mcp/envector-mcp-server"]
22
path = mcp/envector-mcp-server
3-
url = git@github.com:CryptoLabInc/envector-mcp-server
3+
url = https://github.com/CryptoLabInc/envector-mcp-server.git

CHANGELOG.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,43 @@ All notable changes to Rune Plugin will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.1] - 2026-02-04
9+
10+
### Changed - Security Architecture Fix
11+
12+
**Critical Fix**: Enforced proper isolation between plugin and Vault.
13+
14+
#### Removed
15+
- **Local Vault MCP**: Removed `mcp/vault/` directory from plugin
16+
- Vault MCP server must run on a separate machine (deployed by team admin)
17+
- SecKey (decryption key) should never exist on user machines
18+
- This enforces the security model where agents cannot decrypt data locally
19+
20+
#### Changed
21+
- **MCP Configuration**: Updated to connect to remote Vault via SSE
22+
- `.claude/mcp_servers.template.json` - Now uses SSE connection to remote Vault
23+
- `.github/claude-plugin.json` - Vault connection via `${VAULT_URL}/sse`
24+
- **start-mcp-servers.sh**: Now only starts envector-mcp-server locally
25+
- Vault MCP is accessed remotely (no local startup needed)
26+
27+
#### Architecture Clarification
28+
```
29+
Plugin (user machine) Vault (admin-deployed VM)
30+
├── envector-mcp-server ──► └── vault_mcp.py (SecKey here only)
31+
│ (encryption only) (decryption capability)
32+
└── No SecKey access
33+
```
34+
35+
---
36+
837
## [0.2.0] - 2026-02-02
938

1039
### Added - Complete Plugin with MCP Servers
1140

1241
**Major Update**: Transformed from documentation-only plugin to full-featured plugin with infrastructure.
1342

1443
#### Infrastructure
15-
- **MCP Servers**: Included Vault MCP server (`mcp/vault/vault_mcp.py`)
44+
- **MCP Servers**: Included envector-mcp-server for encrypted vector operations
1645
- **Agent Specifications**: Added Scribe and Retriever agent specs (`agents/`)
1746
- **Python Dependencies**: Added `requirements.txt` with pyenvector, fastmcp, psutil, prometheus-client
1847
- **Installation Scripts**:

mcp/envector-mcp-server

Submodule envector-mcp-server added at 3c11ad7

mcp/vault/run_vault.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

mcp/vault/vault_mcp.py

Lines changed: 0 additions & 164 deletions
This file was deleted.

scripts/check-infrastructure.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,17 @@ else
5959
print_warn "curl not found, skipping Vault connectivity check"
6060
fi
6161

62-
# Check if MCP servers are running
63-
if pgrep -f "vault_mcp.py" > /dev/null; then
64-
print_check "Vault MCP server is running (PID: $(pgrep -f vault_mcp.py))"
62+
# Check if local envector-mcp-server is running
63+
if pgrep -f "envector-mcp-server" > /dev/null; then
64+
print_check "enVector MCP server is running (PID: $(pgrep -f envector-mcp-server))"
6565
else
66-
print_warn "Vault MCP server is not running"
66+
print_warn "enVector MCP server is not running locally"
6767
echo " Start with: scripts/start-mcp-servers.sh"
6868
# Not failing here, as it can be started later
6969
fi
7070

71+
# Note: Vault MCP runs on remote server (already checked via HTTP above)
72+
7173
# Check if virtual environment exists
7274
PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7375
if [ -d "$PLUGIN_DIR/.venv" ]; then

scripts/configure-claude-mcp.sh

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,63 @@ echo "Config file: $CLAUDE_CONFIG"
2828
TEMP_CONFIG=$(mktemp)
2929
sed "s|PLUGIN_DIR|$PLUGIN_DIR|g" "$PLUGIN_DIR/.claude/mcp_servers.template.json" > "$TEMP_CONFIG"
3030

31-
# Merge with existing config (simple approach: add rune servers)
32-
# TODO: Proper JSON merging for production
31+
# Merge with existing config using jq or Python fallback
32+
merge_json_with_python() {
33+
python3 - "$CLAUDE_CONFIG" "$TEMP_CONFIG" << 'PYEOF'
34+
import json
35+
import sys
36+
37+
def deep_merge(base, overlay):
38+
"""Recursively merge overlay into base."""
39+
for key, value in overlay.items():
40+
if key in base and isinstance(base[key], dict) and isinstance(value, dict):
41+
deep_merge(base[key], value)
42+
else:
43+
base[key] = value
44+
return base
45+
46+
if len(sys.argv) != 3:
47+
print("Error: Expected exactly 2 arguments: base_config_path overlay_config_path", file=sys.stderr)
48+
sys.exit(1)
49+
50+
base_config_file = sys.argv[1]
51+
overlay_config_file = sys.argv[2]
52+
53+
try:
54+
with open(base_config_file, 'r') as f:
55+
base = json.load(f)
56+
except (json.JSONDecodeError, FileNotFoundError):
57+
base = {}
58+
59+
try:
60+
with open(overlay_config_file, 'r') as f:
61+
overlay = json.load(f)
62+
except (json.JSONDecodeError, FileNotFoundError):
63+
print("Error: Failed to read template config", file=sys.stderr)
64+
sys.exit(1)
65+
66+
merged = deep_merge(base, overlay)
67+
68+
with open(base_config_file, 'w') as f:
69+
json.dump(merged, f, indent=2)
70+
71+
print("✓ MCP servers configured successfully")
72+
PYEOF
73+
}
74+
3375
if command -v jq &> /dev/null; then
3476
# Use jq if available
3577
jq -s '.[0] * .[1]' "$CLAUDE_CONFIG" "$TEMP_CONFIG" > "$CLAUDE_CONFIG.tmp"
3678
mv "$CLAUDE_CONFIG.tmp" "$CLAUDE_CONFIG"
3779
echo "✓ MCP servers configured successfully"
80+
elif command -v python3 &> /dev/null; then
81+
# Fallback: use Python for JSON merging
82+
merge_json_with_python
3883
else
39-
# Fallback: just append (may create duplicate keys)
40-
echo "Warning: jq not found. Using simple append."
41-
cat "$TEMP_CONFIG" >> "$CLAUDE_CONFIG"
42-
echo "✓ MCP configuration appended (you may need to manually clean up)"
84+
echo "Error: Neither jq nor python3 found. Cannot merge JSON configuration."
85+
echo "Please install jq (recommended) or python3."
86+
rm "$TEMP_CONFIG"
87+
exit 1
4388
fi
4489

4590
rm "$TEMP_CONFIG"

0 commit comments

Comments
 (0)