NetArk
Provides setup and lifecycle hook integration for Google Antigravity (AGY), wiring agent hooks, plugin MCP configuration, enterprise policy, skills, and workflows to enforce NetArk pre-write guardrails and memory governance.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
NetArk (netark-mcp)
Zero-Dependency Deterministic AI Coding Harness & Portable Markdown Governance MCP.
English | 繁體中文
NetArk gives AI coding agents (Claude Code, Google Antigravity, Pi Agent, and custom MCP hosts) deterministic pre-write AST/secret guardrails and a Git-portable Markdown memory graph — packaged as a single pure-stdlib Python CLI (netark-mcp) with 0 runtime files dropped into your repository.
Key Engineering Benchmarks
Metric | Value | Why It Matters |
MCP Context Footprint |
| Keeps tool-schema overhead near zero ( |
Runtime Dependencies |
| Pure Python 3.10+ standard library; no vector DB, Docker, or Node.js runtime required. |
Pre-Write Hook Latency |
| Deterministic AST nesting, silent-except, secret DLP, and shell inspection before disk writes. |
Turn-1 Context Compression |
| Compresses multi-node specs & AST edges into a frozen |
Related MCP server: io.github.pmgarg/cgraphy
30-Second Quickstart (uv / uvx)
Install netark-mcp once globally for full Hooks + MCP, or run uvx directly for MCP-only:
# 1. Install globally from PyPI (recommended for native-speed PreToolUse hooks)
uv tool install netark-mcp
# Or install directly from GitHub main:
# uv tool install git+https://github.com/joinblue/NetArk
# 2. Initialize your project (creates 0 .py files inside your repo)
cd /path/to/your-project
netark-mcp init --lang en --cwd .Default — Zero Host Intrusion (
--target memory):netark-mcp init --cwd .Creates/merges only
.mcp.json, policy config, and startermemory/nodes without touching host rules or hook files.Claude Code (
--target claude):netark-mcp init --target claude --lang en --cwd .Non-destructively merges
.mcp.json,.claude/settings.json(SessionStart,PreToolUse,PostToolUse,Stop), and.claude/commands/.Google Antigravity / AGY (
--target agy):netark-mcp init --target agy --lang en --cwd .Wires
.agents/hooks.json,.agents/plugins/netark/mcp_config.json,.agents/enterprise-policy.json,.agents/skills/, and.agents/workflows/.Pi Agent / Custom MCP Hosts (
uvx+ Universal Hook Contract):{ "mcpServers": { "netark": { "command": "uvx", "args": ["netark-mcp", "serve", "--cwd", "."] } } }Then instruct your agent to call
netark_guard(action="setup")(or inspect docs/HOOK_CONTRACT.md) to wire the stdin/stdout hook bridge.
How It Works (Hooks + 3-Tool Closed Loop)
flowchart LR
S["SessionStart Hook<br/>Inject Frozen @D/@M/@C/@G Map"] --> Q["1. Query Before Edit<br/>netark_query(query)"]
Q --> P["2. PreToolUse Hook (~62ms)<br/>Secret DLP + AST P1-P4 + RIBC Gate"]
P -->|"DENY + [RuleDoc] Fix"| Q
P -->|"ALLOW"| W["3. Governed Write & Verify<br/>netark_record / PostToolUse / netark_guard(oracle)"]
W --> S1. Deterministic Pre-Write Guardrails (~62ms)
Stops hardcoded credentials (SEC-PREWRITE-SECRET), .env / vault reads (SEC-CRED), silent except: pass (CODE-SILENT-EXCEPT), deep arrow nesting (CODE-ARROW-NESTING), destructive shell subshells, and unguarded subagent dispatches — returning structured [RuleDoc] and [SuggestedAlternative] remediation so the agent fixes itself in one turn.
(Also available as an animated terminal sequence, or regenerate locally with scripts/render_assets/ / demo-prewrite-guard.tape.)
2. Turn-1 @D/@M/@C/@G Context Compression (95.7% Saved)
Instead of flooding every prompt with raw Markdown specs and source files, SessionStart injects a frozen compact directory/node/script/dependency codebook (5.2 KB). Prefix caches remain intact while netark_query resolves exact 1-hop node summaries and AST neighbors on demand.
3. Stub-First Governance Lifecycle & Spec ↔ Code Alignment
Tracks every change from draft ➔ reviewing ➔ stub_ready ➔ verified ➔ archived. STUB-FIRST-GATE and SPEC-AST-SYNC-GATE prevent agents from inventing modules without an approved spec or drifting from declared AST symbols.
3 High-Cohesion MCP Tools
Tool | Purpose | Key Inputs |
| O(1) codebook lookup & 1-hop AST/DAG neighbor resolution |
|
| Schema-validated memory authoring ( |
|
| Policy health check, full-repo DAG oracle, handover audit, or Hook contract |
|
How NetArk Compares to the Ecosystem
Approach | External DB / Runtime | Pre-Write AST & Secret Hooks | Spec ↔ Code Drift & Stub Gate | Prefix-Cache Safe Turn-1 Map |
NetArk ( | None (Python 3.10+ Stdlib) | Yes ( | Yes ( | Yes ( |
Raw | None | No (advisory prompt only) | No | Degrades as docs grow |
Vector / Graph Memory MCP ( | Vector DB / Graph DB / LLM API | No | No | Dynamic retrieval can churn context |
LSP Symbol MCP ( | Language Servers | No | Symbol lookup only | No governance lifecycle |
Documentation & Links
Quickstart & Multi-Host Setup —
uv/uvxsetup,--targetmodes, non-destructive merging, and uninstall.Universal Hook CLI Contract — 5 lifecycle hooks, JSON stdin contract, and
agy/claude/pidialects.Security Guardrails & Remediation Reference — Immutable core rules,
enterprise-policy.jsonschema, and guard code guide.Contributing, CLA & Security Policy — Solo-maintained contribution boundaries, CLA, and zero-dependency guidelines.
Looking for the early TypeScript Pi Coding Agent prototype? See NetArk-preview.
Community & Support
Questions, Ideas & Showcases: GitHub Discussions
Bug Reports: GitHub Issues
Security Vulnerabilities: SECURITY.md (Private Vulnerability Reporting)
Architecture Consulting & Custom Integration:
joinblue42+netark@gmail.com
Licensed under the Apache License 2.0.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Compliance frameworks (SOC 2, ISO 27001, CMMC, NIST, more) delivered to AI agents as MCP tools.
Governed app access for AI agents: 1,000+ apps & 12,000+ tools via Code Mode MCP.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceAnalyzes repositories, explains architecture, calculates change impact, and enforces guardrails for AI Agents like Claude Code, Cursor, and Codex via MCP tools.-
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to query a codebase as a knowledge graph, providing token-budgeted context, search, and impact analysis via MCP tools.27 PyPIMIT
- AlicenseNot gradedqualityBmaintenanceProvides coding agents with governed semantic memory and code-graph context via MCP, enabling code-linked recall, blast-radius impact analysis, and lifecycle-aware memory management.666 PyPI3Apache 2.0
- AlicenseNot gradedqualityCmaintenanceProvides AI agents with a governed, three-layer project memory (guide, code facts, and knowledge) through namespaced MCP tools for code search, context compilation, impact analysis, and proposal-driven documentation updates.2MIT