Ketan-OS MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Ketan-OS MCP ServerSnapshot the workspace and run the tests with rollback on failure"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Ketan-OS ๐ช (เคเฅเคคเคจ)
The Transactional Intelligence Substrate & Beacon of Ground Truth for AI Agents
๐ฑ Origin & Philosophy
"Aham ฤtmฤ guแธฤkeลa sarva-bhลซtฤลaya-sthitaแธฅ" โ Bhagavad Gita, Chapter 10, Verse 20
"I am the Self, O Gudakesha, seated in the hearts of all beings. I am the beginning, the middle, and the end of all beings."
Ketan (เคเฅเคคเคจ) literally means Banner, Beacon, or Dwelling in Sanskrit โ the fixed, unmovable point of reference from which all navigation begins. In the context of AI agents, Ketan-OS is that beacon of ground truth: the substrate that ensures an agent's environment, memory, and decisions are always anchored to verifiable, uncorrupted reality.
Modern AI agent frameworks (LangGraph, AutoGen, CrewAI) are powerful orchestration layers โ but they are blind to what is actually happening on disk and in memory. When an agent writes a malformed file, executes a destructive command, or hallucinates a state that no longer exists, these frameworks have no recovery mechanism. The environment corrupts silently and irrecoverably.
Ketan-OS solves this at the substrate level โ not by patching agents, but by wrapping every tool call in transactional guarantees, sub-second snapshot/rollback, pre-flight invariant verification, live causal tracing, and epistemic contradiction detection. It is the OS beneath the agent, not the agent itself.
Related MCP server: k8s-aiops
๐ Capability Comparison
Capability | LangGraph | AutoGen | CrewAI | Ketan-OS ๐ช | What Ketan-OS Does |
Environment Filesystem Snapshotting | โ | โ | โ | โ Sub-Second ShadowFS | Before every tool call, Ketan-OS takes an incremental, content-addressed snapshot of the entire workspace filesystem using |
Time-Travel Substrate Rollback | โ | โ | โ | โ Sub-Second Atomic | On any failure โ crash, invariant violation, syntax error, bad output โ the workspace is reverted byte-for-byte to the last clean checkpoint in < 10ms. No partial writes, no corrupted state. The agent gets a counterfactual hint explaining what went wrong. |
Pre-Flight Invariant Assertion Guards | โ | โ | โ | โ AST + Rule Engine | Before a tool executes, Ketan-OS runs pluggable assertion rules: Python AST syntax validation (blocks broken |
Live Causal Execution Trace Graph (CTG) | โ | โ | โ | โ Live DAG Lineage | Every tool call, checkpoint, failure, and rollback is recorded as a node in a directed acyclic graph (DAG). The CTG tracks causal edges โ which action led to which outcome. On failure, Ketan-OS traverses the DAG backwards to generate a root cause explanation automatically. |
Epistemic Belief Engine & Memory Pruner | โ | โ | โ | โ Contradiction-Aware | Tracks explicit factual beliefs the agent holds about the workspace (e.g., "file X is valid Python"). When a new observation contradicts a prior belief (e.g., "file X now has a syntax error"), the contradiction is detected, the stale belief is marked invalid, and the relevant prompt stack entries are auto-pruned to prevent hallucination loops. |
eBPF-Style Symbolic Invariant Kernel | โ | โ | โ | โ Micro-Patching | An in-process rule engine that evaluates temporal logic constraints on tool arguments in sub-millisecond time โ inspired by Linux eBPF probes. Instead of just blocking, it can also micro-patch tool args in-flight (e.g., clamp an out-of-range financial amount to a safe value instead of rejecting it). |
Predictive Speculative Task Kernel | โ | โ | โ | โ < 5ms Commit | Runs multiple potential tool execution branches in parallel speculatively โ like CPU branch prediction, but for AI workflows. The kernel selects and commits the best-outcome branch in < 5ms, discarding the rest. Reduces latency for long tool chains. |
Scope-Locked Policy Engine (RBAC) | โ | โ | โ | โ Declarative RBAC | Declarative role-based access control for tools. Define which agent roles can call which tools, which file paths they can write to, and what argument ranges are allowed. Policies are enforced at the substrate level โ the agent cannot bypass them. |
JIT Skill Trajectory Compilation | โ | โ | โ | โ Zero-Token Re-runs | Compiles repeated agent skill sequences into cached, zero-token executors. If an agent runs the same workflow twice (e.g., "read orders โ validate โ process refund"), the 2nd run executes from a compiled cache with 0 LLM tokens consumed. |
Persona State Freeze, Fork & Diff | โ | โ | โ | โ Portable State | Freeze the complete agent state (workspace + memory + conversation), fork it into parallel experiment branches, then diff what changed between branches. Enables A/B testing of agent strategies without any state contamination. |
Claude Code MCP Integration | โ | โ | โ | โ 15 MCP Tools | Ships a full Model Context Protocol (MCP) server. Connect Ketan-OS to Claude Code in one config line โ Claude gets all 15 Ketan-OS tools natively: safe writes, bash with rollback, CTG visualization, belief tracking, and more. |
๐๏ธ System Architecture
graph TD
subgraph AgentLayer [" ๐ค Agent Execution Layer "]
LLM["LLM Agent Loop
OpenAI โข Claude โข LangGraph โข AutoGen"]
MCP["๐ MCP Server
Claude Code Integration
15 Native Tools"]
Wrapper["๐ก๏ธ KetanAgentWrapper
Tool Call Interceptor"]
LLM -->|Tool Call| Wrapper
MCP -->|Safe Tool Execution| Wrapper
end
subgraph CoreEngine [" ๐ช Ketan-OS Core Substrate "]
Harness["๐ช KetanHarness
Thread-Safe Coordinator"]
subgraph PreFlight [" Pre-Flight Guard Layer "]
Verifier["๐ก๏ธ InvariantVerifier
AST + Rule Engine"]
Policy["๐ PolicyEngine
RBAC Scope Lock"]
Symbolic["โก SymbolicInvariantKernel
eBPF-Style Micro-Patching"]
Verifier --> Policy --> Symbolic
end
subgraph Speculative [" Speculative Execution "]
SpecKernel["๐ฎ PredictiveSpeculativeKernel
Branch Prediction < 5ms"]
end
subgraph StorageLedger [" Dual-Ledger Substrate "]
Ledger["๐ KetanLedger
Checkpoint Registry"]
ShadowFS["๐พ KetanShadowFS
Incremental Snapshot
8ms / 1000 files"]
Ledger --> ShadowFS
end
subgraph Cognition [" Epistemic & Belief Layer "]
Epistemic["๐ง EpistemicBeliefEngine
Contradiction Detection
Prompt Auto-Pruning"]
end
subgraph CTGSubsystem [" Causal Provenance Engine "]
CTG["๐งฌ KetanTraceGraph
Live Execution DAG"]
RCA["๐ Root Cause Analyzer
Failure Explanation"]
CTG --> RCA
end
subgraph TimeTravel [" Time-Travel Rollback "]
Rollback["โฑ๏ธ Rollback Controller
Sub-Second Reversion"]
Counterfactual["๐ก Counterfactual Engine
Diagnostic Hint Injector"]
Rollback --> Counterfactual
end
end
Wrapper -->|"โ Intercept"| Harness
Harness -->|"โก Pre-flight"| Verifier
Symbolic -->|"โข Pass / Micro-Patch"| Epistemic
Epistemic -->|"โฃ Checkpoint"| ShadowFS
ShadowFS -->|"โค Execute"| Execution["โ๏ธ Tool Execution"]
Symbolic -.->|Fail โ Block| Rollback
Execution -->|Crash / Error| Rollback
Execution -->|Success| Commit["๐ข Commit & Record"]
Commit --> CTG
Commit --> Ledger
Rollback -->|"โฅ Revert FS"| ShadowFS
Rollback -->|"โฆ Record Failure"| CTG
Counterfactual -->|"โง Inject Hint"| LLM
classDef agent fill:#f3e8ff,stroke:#7c3aed,stroke-width:2px,color:#1e1b4b
classDef core fill:#e0f2fe,stroke:#0284c7,stroke-width:2px,color:#0c4a6e
classDef storage fill:#d1fae5,stroke:#059669,stroke-width:2px,color:#064e3b
classDef rollback fill:#ffe4e6,stroke:#e11d48,stroke-width:2px,color:#881337
classDef ctg fill:#fef3c7,stroke:#d97706,stroke-width:2px,color:#78350f
classDef exec fill:#f0fdf4,stroke:#16a34a,stroke-width:2px,color:#14532d
class LLM,Wrapper,MCP agent
class Harness,Verifier,Policy,Symbolic,Epistemic,SpecKernel core
class Ledger,ShadowFS storage
class Rollback,Counterfactual rollback
class CTG,RCA ctg
class Execution,Commit execโก Quickstart
from ketan import KetanHarness, KetanAgentWrapper
# 1. Initialize Ketan-OS for your project workspace
harness = KetanHarness(workspace_dir="./my_project")
wrapper = KetanAgentWrapper(harness)
# 2. Wrap any tool with transactional protection
def write_code(args):
with open(args["filepath"], "w") as f:
f.write(args["content"])
return "File written"
safe_write = wrapper.wrap_tool("write_file", write_code)
# 3. Execute โ Ketan-OS handles snapshot, pre-flight, rollback automatically
result = safe_write(
tool_args={"filepath": "main.py", "content": "def run():\n return 42\n"},
prompt_stack=[{"role": "user", "content": "Create main function"}]
)
print(result)
# โ {"success": True, "result": "File written", "hint": ""}
# If content had a syntax error โ {"success": False, "hint": "Fix SyntaxError on line 1..."}
# โ workspace auto-rolled back, not a single byte changed on disk๐ Claude Code MCP Integration
Ketan-OS ships a ready-to-use MCP server that gives Claude Code 15 native tools for safe, transactional, auditable agentic coding.
1. Install
git clone https://github.com/your-username/ketan-os.git
cd ketan-os
pip install ".[mcp]"2. Configure Claude Code
Add to ~/.claude/claude.json:
{
"mcpServers": {
"ketan-os": {
"command": "ketan-mcp",
"args": ["--workspace", "/absolute/path/to/your/project"]
}
}
}That's it. After
pip install ".[mcp]", theketan-mcpcommand is on your PATH. No--directoryflags, no absolute repo paths needed.
3. Start Claude Code
claudeClaude Code will auto-discover and start the Ketan-OS MCP server. You'll see ketan-os in the available tools.
Available MCP Tools
Tool | What it does |
| Ground-truth state: steps, checkpoints, failures |
| Take atomic workspace snapshot โ get rollback point |
| Time-travel revert to any checkpoint |
| List all restore points |
| Write file with pre-flight guards + auto rollback |
| Run shell command with snapshot + auto rollback |
| Dry-run invariant check (no execution) |
| Causal Trace Graph as Mermaid diagram |
| Root cause of the last failure |
| Record a workspace fact into Epistemic Engine |
| See all tracked beliefs |
| Read file + record as belief |
| Browse workspace files |
| Full markdown session report |
| Switch to a different workspace |
๐งฉ Module Map
Module | Class | What It Does |
|
| Central thread-safe coordinator engine |
|
| Incremental workspace snapshotting & rollback |
|
| Checkpoint registry synchronizing FS + prompt state |
|
| Pre-flight AST syntax, safety, and custom rule checks |
|
| Belief tracking, contradiction detection, prompt pruning |
|
| eBPF-style sub-ms rule eval & in-flight arg micro-patching |
|
| Parallel branch speculative execution < 5ms commit |
|
| Live execution DAG + root cause failure explanation |
|
| Declarative RBAC scope-lock for tool calls |
|
| Zero-token cached skill trajectory compiler |
|
| Agent state freeze, fork & diff |
|
| LangGraph + generic LLM adapter middleware |
| MCP Server | 15 Claude Code MCP tools via stdio transport |
๐งช Running Tests
uv run python -m unittest discover tests
# โ Ran 67 tests in 0.18s OK
# โ [BENCHMARK] 50 Files Snapshot Time: ~8ms
# โ [BENCHMARK] 50 Files Rollback Time: ~4ms๐ License
MIT License. Copyright (c) 2026 umang-algo.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceRuntime safety guardrails for AI coding agents. Checks file access, validates shell commands, and scores your repo's AI safety โ all via MCP.Last updated88MIT
- AlicenseAqualityAmaintenanceGoverned Kubernetes operations for AI agents with 15 MCP tools, audit logging, policy engine, and safety features.Last updated55MIT
- Alicense-qualityBmaintenanceLocal-first code intelligence and safety layer for AI coding agents. MCP server exposes dependency graph, impact analysis, and AST-compressed repo context, backed by typed local memory, patch-scope safety gates, and git-independent transaction rollback.Last updatedMIT
- FlicenseBqualityCmaintenanceMCP server for file checkpointing and undo, enabling AI agents to safely read, write, and edit files with full snapshot history and revert capabilities.Last updated10
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/umang-algo/ketan-os'
If you have feedback or need assistance with the MCP directory API, please join our Discord server