0MCP

0MCP: Persistent memory for AI agents on 0G, with ENS identities and Brain iNFTs.

Visit Repo
0MCP banner

About

AI coding agents are powerful, but they are still stateless. Every new session resets their memory, so developers have to repeat architecture decisions, debugging history, security rules, and project-specific context again and again. That wastes time, burns tokens, and makes agents inconsistent across sessions.

0MCP solves this by giving AI agents persistent memory and identity on 0G. It encrypts agent context locally, stores it on 0G Storage, anchors the latest memory root on-chain, and restores that memory in later sessions through MCP tools. It automatically ingests git commit history to bootstrap agent knowledge from day one, detects when new prompts contradict past decisions, and provides a memory health dashboard to surface staleness and conflicts before they silently degrade quality. It also assigns each agent a human-readable ENS identity and can mint its expertise as a Brain iNFT, so agent knowledge becomes persistent, portable, discoverable, and ownable.

How it's made

0MCP is built as a Model Context Protocol server in TypeScript, running over stdio so it plugs directly into Cursor, Windsurf, and VS Code style agent workflows. The main memory path is handled in src/storage.ts, where each interaction is serialized, encrypted locally with AES-256-GCM, uploaded through the 0G Storage Turbo SDK, and anchored with a registry contract that stores the latest Merkle root for each project. That gives every agent a verifiable long-term memory layer on 0G instead of relying on local disk or a centralized database.

On top of that, src/ens.ts turns each agent into a human-readable ENS identity, storing metadata such as the project ID, session count, Brain iNFT token ID, contract address, and AXL peer key in ENS text records. src/snapshot.ts exports the saved memory into a portable snapshot and mints it as a Brain iNFT on 0G, then loads it back later by resolving the ENS name and reading the tokenURI. For peer-to-peer collaboration, src/axl.ts and src/exchange.ts implement encrypted AXL messaging, peer discovery, and brain-to-brain memory transfer across separate nodes. src/ingest.ts adds a git-aware ingestion pipeline that reads commit history, classifies each commit into typed events like bug_fix, refactor, or breaking_change, and writes them into 0G memory with local deduplication so repeated runs only pick up new commits. src/analysis.ts is a pure deterministic layer that extracts decision rules from stored memory, scores new prompts for contradictions against those rules, and computes memory health metrics with no external API calls. src/index.ts exposes the full workflow as MCP tools including get_context, save_memory, mint_brain, load_brain, register_agent, merge_brains, check_drift, ingest_repo_state, and memory_health.

One particularly hacky part was keeping the MCP JSON-RPC stream intact. Because the stdio transport breaks if anything noisy reaches stdout, we redirect console.log to stderr and keep the protocol channel clean while the Web3 SDKs do their work. We also added retries, fallback indexers, dynamic AXL startup, and paymaster-backed ENS writes so the system stays usable in real hackathon conditions.

From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

DormantLast push 216 days ago

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

Friday

Wrap any agent as a payable MCP server —discoverable via ENS, memory on 0G, payments

ZeroMem

Encrypted Git-style agent memory on 0G Storage: versioned commits, recall, branching, grants.