hermify-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,106 @@
1
+ name: ๐Ÿš€ Build, Test, and Release
2
+
3
+ on:
4
+ # Trigger on semantic version tags (e.g., v0.2.0)
5
+ push:
6
+ tags:
7
+ - 'v*'
8
+ # Allow manual triggering from the GitHub Actions UI
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ # -------------------------------------------------------------------
13
+ # Job 1: Build & Verify
14
+ # -------------------------------------------------------------------
15
+ build-and-test:
16
+ name: ๐Ÿงช Build & Test
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v3
24
+ with:
25
+ enable-cache: true
26
+ cache-dependency-glob: "uv.lock"
27
+
28
+ - name: Set up Python
29
+ run: uv python install 3.11
30
+
31
+ - name: Install dependencies
32
+ run: uv sync --frozen
33
+
34
+ - name: ๐Ÿงน Lint (Ruff)
35
+ run: uv run ruff check .
36
+
37
+ - name: ๐Ÿง  Type Check (Mypy)
38
+ run: uv run mypy .
39
+
40
+ - name: ๐Ÿงช Run Tests (Pytest)
41
+ run: uv run pytest -v
42
+
43
+ - name: ๐Ÿ“ฆ Build Package
44
+ run: uv build
45
+
46
+ - name: Upload Build Artifacts
47
+ uses: actions/upload-artifact@v4
48
+ with:
49
+ name: python-package-dist
50
+ path: dist/
51
+ retention-days: 7
52
+
53
+ # -------------------------------------------------------------------
54
+ # Job 2: Publish to PyPI (Trusted Publishing / OIDC)
55
+ # -------------------------------------------------------------------
56
+ publish-to-pypi:
57
+ name: ๐Ÿ“ค Publish to PyPI
58
+ needs: build-and-test
59
+ runs-on: ubuntu-latest
60
+ # The environment name MUST match the one configured in PyPI settings
61
+ environment:
62
+ name: pypi
63
+ url: https://pypi.org/p/hermify-mcp
64
+ permissions:
65
+ # CRITICAL: This permission is required for OIDC Trusted Publishing
66
+ id-token: write
67
+ steps:
68
+ - name: Download Build Artifacts
69
+ uses: actions/download-artifact@v4
70
+ with:
71
+ name: python-package-dist
72
+ path: dist/
73
+
74
+ - name: Publish to PyPI
75
+ uses: pypa/gh-action-pypi-publish@release/v1
76
+ # NOTE: We intentionally DO NOT provide user/password.
77
+ # The action uses the id-token to authenticate via OIDC.
78
+
79
+ # -------------------------------------------------------------------
80
+ # Job 3: Create GitHub Release
81
+ # -------------------------------------------------------------------
82
+ github-release:
83
+ name: ๐Ÿท๏ธ Create GitHub Release
84
+ needs: publish-to-pypi
85
+ runs-on: ubuntu-latest
86
+ permissions:
87
+ contents: write # Required to create releases
88
+ steps:
89
+ - name: Checkout repository
90
+ uses: actions/checkout@v4
91
+ with:
92
+ fetch-depth: 0 # Fetch all history for release notes
93
+
94
+ - name: Download Build Artifacts
95
+ uses: actions/download-artifact@v4
96
+ with:
97
+ name: python-package-dist
98
+ path: dist/
99
+
100
+ - name: Create GitHub Release
101
+ uses: softprops/action-gh-release@v2
102
+ with:
103
+ files: dist/*
104
+ generate_release_notes: true
105
+ draft: false
106
+ prerelease: false
@@ -0,0 +1,10 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,72 @@
1
+
2
+ # Contributing to hermify-mcp
3
+
4
+ Welcome! We're building the future of cross-agent memory and skill sharing. This guide will help you get set up and understand our architectural principles.
5
+
6
+ ## ๐Ÿ› ๏ธ Development Setup
7
+
8
+ We use [`uv`](https://github.com/astral-sh/uv) for lightning-fast dependency management and Python versioning.
9
+
10
+ 1. **Clone the repository:**
11
+ ```bash
12
+ git clone https://github.com/your-org/hermify-mcp.git
13
+ cd hermify-mcp
14
+ ```
15
+
16
+ 2. **Install dependencies and set up the environment:**
17
+ ```bash
18
+ uv sync
19
+ ```
20
+
21
+ 3. **Run the test suite to verify your setup:**
22
+ ```bash
23
+ uv run pytest
24
+ ```
25
+
26
+ ## ๐Ÿ—๏ธ Architectural Principles
27
+
28
+ Before writing code, please internalize these core design pillars:
29
+
30
+ 1. **Local-First, Dataset-Backed**: All MCP tool writes MUST go to the local DuckDB buffer first. Network calls to Hugging Face Hub are strictly asynchronous (handled by `sync_push`). The agent loop must never block on I/O.
31
+ 2. **Event-Sourced Immutability**: Skills and memory are not "updated" in place. State changes (e.g., `draft` โ†’ `active`) are handled by appending new rows with incremented versions or status flags.
32
+ 3. **Extensible Storage**: The `DatasetStore` should implement a clear interface. If you are adding a new storage backend, ensure it adheres to the same ACID and audit-chain guarantees as the DuckDB implementation.
33
+
34
+ ## ๐Ÿงช Test-Driven Development (TDD) Workflow
35
+
36
+ We strictly follow TDD. **Do not submit a PR without tests.**
37
+
38
+ 1. **Write the test first**: Define the expected behavior in `tests/`. Mock external dependencies (like the HF Hub API or LLM Judge).
39
+ ```python
40
+ def test_propose_skill_creates_draft(store):
41
+ skill_md = "name: test\n---\nBody"
42
+ result = store.propose_skill(skill_md, agent_id="agent-1")
43
+ assert result['status'] == 'draft'
44
+ ```
45
+ 2. **Watch it fail**: Run `uv run pytest tests/test_dataset_store.py::test_propose_skill_creates_draft`.
46
+ 3. **Write the minimal code**: Implement the feature in `src/hermify_mcp/` to make the test pass.
47
+ 4. **Refactor**: Clean up the code while keeping the test green.
48
+
49
+ ## ๐Ÿ“ Code Quality & Linting
50
+
51
+ We enforce strict code quality standards. Before pushing, run:
52
+
53
+ ```bash
54
+ # Format and lint
55
+ uv run ruff format .
56
+ uv run ruff check . --fix
57
+
58
+ # Type checking
59
+ uv run mypy src/hermify_mcp
60
+ ```
61
+
62
+ ## ๐Ÿš€ Pull Request Process
63
+
64
+ 1. Create a feature branch: `git checkout -b feat/your-feature-name`
65
+ 2. Ensure all tests pass: `uv run pytest`
66
+ 3. Ensure linting and typing pass.
67
+ 4. Open a Pull Request with a clear description of the problem solved and how the TDD approach was applied.
68
+ 5. A maintainer will review, focusing on architectural alignment and test coverage.
69
+
70
+ ## ๐Ÿ’ก Questions?
71
+
72
+ Open an issue or start a discussion in the GitHub repo. We're happy to help you navigate the codebase!
@@ -0,0 +1,26 @@
1
+ # Dockerfile
2
+ FROM python:3.11-slim
3
+
4
+ # Install uv for lightning-fast dependency resolution
5
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
6
+
7
+ # Set environment variables
8
+ ENV PYTHONUNBUFFERED=1 \
9
+ PORT=7860 \
10
+ HERMIFY_HOME=/data/.hermify
11
+
12
+ # Set working directory
13
+ WORKDIR /app
14
+
15
+ # Copy project files
16
+ COPY . .
17
+
18
+ # Install dependencies and the package itself
19
+ RUN uv sync --frozen
20
+
21
+ # Expose the port HF Spaces expects
22
+ EXPOSE 7860
23
+
24
+ # Run the CLI directly in HTTP mode
25
+ # We use /data/.hermify so we can mount a persistent volume later if needed
26
+ CMD ["uv", "run", "hermify", "serve", "--transport", "http", "--host", "0.0.0.0", "--port", "7860"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 hermify-mcp contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,219 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermify-mcp
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.14
7
+ Requires-Dist: datasets>=5.0.0
8
+ Requires-Dist: duckdb>=1.5.3
9
+ Requires-Dist: fastmcp>=3.4.2
10
+ Requires-Dist: pydantic>=2.13.4
11
+ Requires-Dist: pyyaml>=6.0.3
12
+ Requires-Dist: rich>=15.0.0
13
+ Requires-Dist: typer>=0.26.7
14
+ Description-Content-Type: text/markdown
15
+
16
+ # hermify-mcp
17
+
18
+ > Cross-agent, dataset-backed skill and memory sync via MCP.
19
+ > Hermify your agent interactions - push from Claude, pull into Gemini, improve without friction.
20
+
21
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
22
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](https://python.org)
23
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
24
+ [![agentskills.io](https://img.shields.io/badge/skills-agentskills.io-purple)](https://agentskills.io)
25
+
26
+ ---
27
+
28
+ ## What it does
29
+
30
+ `hermify-mcp` is an MCP server that gives any agent runtime a shared, **event-sourced, dataset-backed** knowledge base following the [agentskills.io](https://agentskills.io) open standard.
31
+
32
+ Instead of relying on traditional file-based version control, `hermify-mcp` treats agent skills, memory, and logs as structured, queryable data. It uses a **local-first DuckDB buffer** for lightning-fast, non-blocking agent interactions, which seamlessly syncs to **Hugging Face Datasets** as the immutable source of truth.
33
+
34
+ ```text
35
+ Claude session โ”€โ”€โ–บ hermify_log() โ”€โ”€โ–บ Local DuckDB Buffer (Instant, ACID)
36
+ โ”‚
37
+ (Async Sync)
38
+ โ”‚
39
+ Hugging Face Datasets (Parquet Shards)
40
+ โ”‚
41
+ Gemini / Hermes / next Claude
42
+ session pulls & queries on start
43
+ ```
44
+
45
+ **Non-intrusive by design.** The server never injects into the agent loop. Agents call `propose_skill` or `hermify_log` post-session. The main workflow is never blocked waiting for network sync.
46
+
47
+ ---
48
+
49
+ ## ๐Ÿš€ Quick Start & Agent Setup
50
+
51
+ The recommended way to run `hermify-mcp` is via **`uvx`**, which allows your agent runtime to spawn the server in an isolated, ephemeral environment without polluting your global Python packages.
52
+
53
+ ### 1. Bootstrap your local configuration (One-time setup)
54
+ Run this in your terminal to create your local DuckDB buffer and configure your Hugging Face target.
55
+
56
+ ```bash
57
+ # Install uv if you haven't already (https://docs.astral.sh/uv/)
58
+ # Bootstrap local config (creates ~/.hermify/config.yaml)
59
+ uvx hermify-mcp init --hf-repo your-username/hermify-agent-memory --mode hf_push
60
+
61
+ # Optional: Enable YOLO auto-approval mode (uses LLM-as-a-Judge)
62
+ # uvx hermify-mcp init --hf-repo your-username/hermify-agent-memory --mode hf_push --yolo
63
+ ```
64
+
65
+ ### 2. Connect your Agent Runtime
66
+
67
+ #### Option A: Local Private Brain (Claude Desktop / Cursor / Windsurf)
68
+ Add the following to your MCP client configuration. This uses `uvx` to run the server locally via `stdio`.
69
+
70
+ *Note: We inject `HF_TOKEN` via the `env` block so the server can sync to Hugging Face.*
71
+
72
+ **Claude Desktop (`claude_desktop_config.json`)** / **Cursor (`mcp.json`)**:
73
+ ```json
74
+ {
75
+ "mcpServers": {
76
+ "hermify": {
77
+ "command": "uvx",
78
+ "args": ["hermify-mcp", "serve", "--transport", "stdio"],
79
+ "env": {
80
+ "HF_TOKEN": "hf_YOUR_HUGGINGFACE_TOKEN_HERE"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ #### Option B: Shared Team Brain (Hugging Face Spaces / Remote HTTP)
88
+ Want to host a centralized, team-wide agent brain or a public demo? You can deploy `hermify-mcp` to Hugging Face Spaces using Docker.
89
+
90
+ This allows multiple agents (or multiple users) to connect to the same shared memory and skill library via HTTP, without needing to manage local files or sync conflicts.
91
+
92
+ ๐Ÿ‘‰ **[Read the full Docker Deployment Guide here](docs/DEPLOY_HF_SPACES.md)**
93
+
94
+ Once your Space is deployed and running, you don't use `uvx` or `stdio`. Instead, point your agent's MCP configuration directly to your Space's URL.
95
+
96
+ Update your agent's MCP configuration (e.g., `claude_desktop_config.json` or Cursor's `mcp.json`):
97
+
98
+ ```json
99
+ {
100
+ "mcpServers": {
101
+ "hermify-team-brain": {
102
+ "url": "https://YOUR_USERNAME-hermify-team-brain.hf.space/mcp"
103
+ }
104
+ }
105
+ }
106
+ ```
107
+ *Note: FastMCP's HTTP transport automatically handles the `/mcp` or `/sse` routing based on the client's negotiation.*
108
+
109
+ ---
110
+
111
+ ## ๐Ÿ—๏ธ Architecture
112
+
113
+ `hermify-mcp` is built on a pluggable storage architecture, making it easy to scale or swap backends while maintaining a consistent MCP tool surface.
114
+
115
+ ```text
116
+ src/hermify_mcp/
117
+ โ”œโ”€โ”€ config.py # HermifyConfig (Pydantic) + domain models
118
+ โ”œโ”€โ”€ dataset_store.py # Local-first DuckDB store (Skills, Memory, Audit Chain)
119
+ โ”œโ”€โ”€ hf_sync.py # Hugging Face Datasets sync engine (Parquet <-> Hub)
120
+ โ”œโ”€โ”€ eval.py # LLM-as-a-Judge evaluation pipeline (YOLO governance)
121
+ โ”œโ”€โ”€ server.py # FastMCP server - dataset-native tools
122
+ โ””โ”€โ”€ cli.py # Typer CLI (hermify init/serve/sync)
123
+ ```
124
+
125
+ ### Governance & Approval Modes
126
+ Every skill write goes through a strict state machine (`draft` โ†’ `sandbox` โ†’ `active`).
127
+
128
+ | Mode | Behaviour |
129
+ |---|---|
130
+ | `human_review` | Skills stay `draft`. Humans review via HF Hub UI or CLI before promoting to `active`. |
131
+ | `yolo_eval` | An LLM-as-a-Judge automatically evaluates drafts. High-scoring skills auto-promote to `sandbox` (probationary use) or `active` (pure YOLO). |
132
+ | `local_only` | Skills and memory stay in the local DuckDB buffer. No network calls. Default for air-gapped environments. |
133
+
134
+ ---
135
+
136
+ ## ๐Ÿ› ๏ธ CLI Reference
137
+
138
+ While agents interact with the server via MCP, you can manage your local brain directly from the terminal.
139
+
140
+ ```bash
141
+ # Show help
142
+ uvx hermify-mcp --help
143
+
144
+ # Initialize / Reconfigure
145
+ uvx hermify-mcp init --home ~/.hermify --hf-repo user/repo --mode hf_push --yolo
146
+
147
+ # Manual Sync Operations (Useful for cron jobs or CI/CD)
148
+ uvx hermify-mcp sync push # Force push local DuckDB to HF Hub
149
+ uvx hermify-mcp sync pull # Pull latest Parquet shards from HF Hub
150
+ uvx hermify-mcp sync status # View local buffer metrics and sync state
151
+
152
+ # Start server manually (defaults to stdio)
153
+ uvx hermify-mcp serve
154
+ uvx hermify-mcp serve --transport http --port 8742
155
+ ```
156
+
157
+ ---
158
+
159
+ ## ๐Ÿงฐ MCP Tools Surface
160
+
161
+ ### Skills & Governance
162
+ | Tool | Description |
163
+ |---|---|
164
+ | `propose_skill` | Append a new skill draft to the local dataset. Triggers YOLO eval if enabled. |
165
+ | `evaluate_skill` | Manually trigger the LLM Judge to score a draft and auto-transition state. |
166
+ | `approve_skill` | Human override to promote a `draft` or `sandbox` skill to `active`. |
167
+ | `search_skills` | Semantic or keyword search across the active dataset. |
168
+
169
+ ### Core: hermify_log
170
+ ```python
171
+ hermify_log(
172
+ raw_transcript, # full session text
173
+ skill_md, # pre-generated SKILL.md from reflective phase
174
+ source_agent, # "claude" | "gemini" | "hermes"
175
+ session_id,
176
+ task_goal,
177
+ )
178
+ ```
179
+ Stores the log + creates a draft skill in the local buffer. One call = full hermification.
180
+
181
+ ### Sync & Memory
182
+ | Tool | Description |
183
+ |---|---|
184
+ | `append_memory` | Append semantic memory to the local dataset buffer. |
185
+ | `get_memory` | Retrieve chronological memory entries for an agent. |
186
+ | `sync_status` | Show local buffer size, last sync timestamp, and HF Hub revision. |
187
+ | `sync_push` | Batch local DuckDB changes into Parquet and push to HF Hub. |
188
+ | `sync_pull` | Download latest Parquet shards from HF Hub and merge into local DB. |
189
+
190
+ ---
191
+
192
+ ## ๐Ÿงฉ Extensibility
193
+
194
+ The storage layer is abstracted. While DuckDB + Hugging Face Datasets is the default, the `BaseStore` protocol allows you to implement custom backends (e.g., PostgreSQL, LanceDB, or cloud object storage) without changing the MCP server interface.
195
+
196
+ Similarly, the `EvalJudge` protocol allows you to plug in any LLM (OpenAI, Anthropic, Ollama) for YOLO governance.
197
+
198
+ ---
199
+
200
+ ## ๐Ÿค Contributing
201
+
202
+ We follow strict TDD. Please read [CONTRIBUTING.md](CONTRIBUTING.md) before submitting PRs.
203
+
204
+ ```bash
205
+ # Clone and setup
206
+ git clone https://github.com/your-org/hermify-mcp.git
207
+ cd hermify-mcp
208
+ uv sync
209
+
210
+ # Run tests
211
+ uv run pytest
212
+
213
+ # Type checking
214
+ uv run mypy .
215
+ ```
216
+
217
+ ## License
218
+
219
+ MIT - see [LICENSE](LICENSE)
@@ -0,0 +1,204 @@
1
+ # hermify-mcp
2
+
3
+ > Cross-agent, dataset-backed skill and memory sync via MCP.
4
+ > Hermify your agent interactions - push from Claude, pull into Gemini, improve without friction.
5
+
6
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](https://python.org)
8
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
9
+ [![agentskills.io](https://img.shields.io/badge/skills-agentskills.io-purple)](https://agentskills.io)
10
+
11
+ ---
12
+
13
+ ## What it does
14
+
15
+ `hermify-mcp` is an MCP server that gives any agent runtime a shared, **event-sourced, dataset-backed** knowledge base following the [agentskills.io](https://agentskills.io) open standard.
16
+
17
+ Instead of relying on traditional file-based version control, `hermify-mcp` treats agent skills, memory, and logs as structured, queryable data. It uses a **local-first DuckDB buffer** for lightning-fast, non-blocking agent interactions, which seamlessly syncs to **Hugging Face Datasets** as the immutable source of truth.
18
+
19
+ ```text
20
+ Claude session โ”€โ”€โ–บ hermify_log() โ”€โ”€โ–บ Local DuckDB Buffer (Instant, ACID)
21
+ โ”‚
22
+ (Async Sync)
23
+ โ”‚
24
+ Hugging Face Datasets (Parquet Shards)
25
+ โ”‚
26
+ Gemini / Hermes / next Claude
27
+ session pulls & queries on start
28
+ ```
29
+
30
+ **Non-intrusive by design.** The server never injects into the agent loop. Agents call `propose_skill` or `hermify_log` post-session. The main workflow is never blocked waiting for network sync.
31
+
32
+ ---
33
+
34
+ ## ๐Ÿš€ Quick Start & Agent Setup
35
+
36
+ The recommended way to run `hermify-mcp` is via **`uvx`**, which allows your agent runtime to spawn the server in an isolated, ephemeral environment without polluting your global Python packages.
37
+
38
+ ### 1. Bootstrap your local configuration (One-time setup)
39
+ Run this in your terminal to create your local DuckDB buffer and configure your Hugging Face target.
40
+
41
+ ```bash
42
+ # Install uv if you haven't already (https://docs.astral.sh/uv/)
43
+ # Bootstrap local config (creates ~/.hermify/config.yaml)
44
+ uvx hermify-mcp init --hf-repo your-username/hermify-agent-memory --mode hf_push
45
+
46
+ # Optional: Enable YOLO auto-approval mode (uses LLM-as-a-Judge)
47
+ # uvx hermify-mcp init --hf-repo your-username/hermify-agent-memory --mode hf_push --yolo
48
+ ```
49
+
50
+ ### 2. Connect your Agent Runtime
51
+
52
+ #### Option A: Local Private Brain (Claude Desktop / Cursor / Windsurf)
53
+ Add the following to your MCP client configuration. This uses `uvx` to run the server locally via `stdio`.
54
+
55
+ *Note: We inject `HF_TOKEN` via the `env` block so the server can sync to Hugging Face.*
56
+
57
+ **Claude Desktop (`claude_desktop_config.json`)** / **Cursor (`mcp.json`)**:
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "hermify": {
62
+ "command": "uvx",
63
+ "args": ["hermify-mcp", "serve", "--transport", "stdio"],
64
+ "env": {
65
+ "HF_TOKEN": "hf_YOUR_HUGGINGFACE_TOKEN_HERE"
66
+ }
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ #### Option B: Shared Team Brain (Hugging Face Spaces / Remote HTTP)
73
+ Want to host a centralized, team-wide agent brain or a public demo? You can deploy `hermify-mcp` to Hugging Face Spaces using Docker.
74
+
75
+ This allows multiple agents (or multiple users) to connect to the same shared memory and skill library via HTTP, without needing to manage local files or sync conflicts.
76
+
77
+ ๐Ÿ‘‰ **[Read the full Docker Deployment Guide here](docs/DEPLOY_HF_SPACES.md)**
78
+
79
+ Once your Space is deployed and running, you don't use `uvx` or `stdio`. Instead, point your agent's MCP configuration directly to your Space's URL.
80
+
81
+ Update your agent's MCP configuration (e.g., `claude_desktop_config.json` or Cursor's `mcp.json`):
82
+
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "hermify-team-brain": {
87
+ "url": "https://YOUR_USERNAME-hermify-team-brain.hf.space/mcp"
88
+ }
89
+ }
90
+ }
91
+ ```
92
+ *Note: FastMCP's HTTP transport automatically handles the `/mcp` or `/sse` routing based on the client's negotiation.*
93
+
94
+ ---
95
+
96
+ ## ๐Ÿ—๏ธ Architecture
97
+
98
+ `hermify-mcp` is built on a pluggable storage architecture, making it easy to scale or swap backends while maintaining a consistent MCP tool surface.
99
+
100
+ ```text
101
+ src/hermify_mcp/
102
+ โ”œโ”€โ”€ config.py # HermifyConfig (Pydantic) + domain models
103
+ โ”œโ”€โ”€ dataset_store.py # Local-first DuckDB store (Skills, Memory, Audit Chain)
104
+ โ”œโ”€โ”€ hf_sync.py # Hugging Face Datasets sync engine (Parquet <-> Hub)
105
+ โ”œโ”€โ”€ eval.py # LLM-as-a-Judge evaluation pipeline (YOLO governance)
106
+ โ”œโ”€โ”€ server.py # FastMCP server - dataset-native tools
107
+ โ””โ”€โ”€ cli.py # Typer CLI (hermify init/serve/sync)
108
+ ```
109
+
110
+ ### Governance & Approval Modes
111
+ Every skill write goes through a strict state machine (`draft` โ†’ `sandbox` โ†’ `active`).
112
+
113
+ | Mode | Behaviour |
114
+ |---|---|
115
+ | `human_review` | Skills stay `draft`. Humans review via HF Hub UI or CLI before promoting to `active`. |
116
+ | `yolo_eval` | An LLM-as-a-Judge automatically evaluates drafts. High-scoring skills auto-promote to `sandbox` (probationary use) or `active` (pure YOLO). |
117
+ | `local_only` | Skills and memory stay in the local DuckDB buffer. No network calls. Default for air-gapped environments. |
118
+
119
+ ---
120
+
121
+ ## ๐Ÿ› ๏ธ CLI Reference
122
+
123
+ While agents interact with the server via MCP, you can manage your local brain directly from the terminal.
124
+
125
+ ```bash
126
+ # Show help
127
+ uvx hermify-mcp --help
128
+
129
+ # Initialize / Reconfigure
130
+ uvx hermify-mcp init --home ~/.hermify --hf-repo user/repo --mode hf_push --yolo
131
+
132
+ # Manual Sync Operations (Useful for cron jobs or CI/CD)
133
+ uvx hermify-mcp sync push # Force push local DuckDB to HF Hub
134
+ uvx hermify-mcp sync pull # Pull latest Parquet shards from HF Hub
135
+ uvx hermify-mcp sync status # View local buffer metrics and sync state
136
+
137
+ # Start server manually (defaults to stdio)
138
+ uvx hermify-mcp serve
139
+ uvx hermify-mcp serve --transport http --port 8742
140
+ ```
141
+
142
+ ---
143
+
144
+ ## ๐Ÿงฐ MCP Tools Surface
145
+
146
+ ### Skills & Governance
147
+ | Tool | Description |
148
+ |---|---|
149
+ | `propose_skill` | Append a new skill draft to the local dataset. Triggers YOLO eval if enabled. |
150
+ | `evaluate_skill` | Manually trigger the LLM Judge to score a draft and auto-transition state. |
151
+ | `approve_skill` | Human override to promote a `draft` or `sandbox` skill to `active`. |
152
+ | `search_skills` | Semantic or keyword search across the active dataset. |
153
+
154
+ ### Core: hermify_log
155
+ ```python
156
+ hermify_log(
157
+ raw_transcript, # full session text
158
+ skill_md, # pre-generated SKILL.md from reflective phase
159
+ source_agent, # "claude" | "gemini" | "hermes"
160
+ session_id,
161
+ task_goal,
162
+ )
163
+ ```
164
+ Stores the log + creates a draft skill in the local buffer. One call = full hermification.
165
+
166
+ ### Sync & Memory
167
+ | Tool | Description |
168
+ |---|---|
169
+ | `append_memory` | Append semantic memory to the local dataset buffer. |
170
+ | `get_memory` | Retrieve chronological memory entries for an agent. |
171
+ | `sync_status` | Show local buffer size, last sync timestamp, and HF Hub revision. |
172
+ | `sync_push` | Batch local DuckDB changes into Parquet and push to HF Hub. |
173
+ | `sync_pull` | Download latest Parquet shards from HF Hub and merge into local DB. |
174
+
175
+ ---
176
+
177
+ ## ๐Ÿงฉ Extensibility
178
+
179
+ The storage layer is abstracted. While DuckDB + Hugging Face Datasets is the default, the `BaseStore` protocol allows you to implement custom backends (e.g., PostgreSQL, LanceDB, or cloud object storage) without changing the MCP server interface.
180
+
181
+ Similarly, the `EvalJudge` protocol allows you to plug in any LLM (OpenAI, Anthropic, Ollama) for YOLO governance.
182
+
183
+ ---
184
+
185
+ ## ๐Ÿค Contributing
186
+
187
+ We follow strict TDD. Please read [CONTRIBUTING.md](CONTRIBUTING.md) before submitting PRs.
188
+
189
+ ```bash
190
+ # Clone and setup
191
+ git clone https://github.com/your-org/hermify-mcp.git
192
+ cd hermify-mcp
193
+ uv sync
194
+
195
+ # Run tests
196
+ uv run pytest
197
+
198
+ # Type checking
199
+ uv run mypy .
200
+ ```
201
+
202
+ ## License
203
+
204
+ MIT - see [LICENSE](LICENSE)