Osmcp

io.github.KrushnaVardhanReddyPublished by GitHub account KrushnaVardhanReddyv1.0.5Updated Oct 24, 2026

A typed, policy-controlled OS capability layer for AI agents.

VerifiedSTDIODesktop onlyFiles & StorageDeveloper Tools

Overview

AI-generated overview

A local MCP server that gives AI assistants policy-bounded filesystem, git and text-processing tools on the user's machine, with an audit log.

What you can do
Search and inspect files: grep, find, ls, cat, stat, wc, head, tail, tree and du within an allowed root directory. Read git state: status, diff and log. Transform text and data: jq, sed and diff. When mutation is enabled, write, append, create directories, remove, move, copy and patch files. When mutation is enabled, stage, commit, checkout, branch, pull and push in git. Every call returns a typed envelope and is recorded in an append-only audit log.
When to use it
Useful when you want an assistant to read and edit code or files in a specific project directory on your machine, or to inspect and commit git changes, while keeping it inside a defined path boundary and tool allowlist.
Requirements
Runs as a local process over stdio, installed via Homebrew or built from source, or pulled as a container image. Needs a TOML policy file passed with the --policy argument that sets allowed_root, allowed_tools, mutation and limits. No accounts, API keys or environment variables are declared.
Before you install
Mutating tools (write, delete, move, copy, patch, git commit, push) change files and repositories; keep allow_mutation false unless needed and restrict allowed_tools. git_push and git_pull reach remote repositories. The audit log records every invocation, so choose its destination and path deliberately.

Installation

In SourceWeft

  1. Open Osmcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

osmcp — OS Capabilities for AI Agents

A typed, policy-controlled OS capability layer for AI agents via the Model Context Protocol (MCP).

osmcp exposes a curated set of safe filesystem, git, and text-processing tools to AI agents — all governed by a strict Policy Engine that enforces path boundaries, tool allowlists, output limits, mutation controls, and an immutable audit trail.

📖 Read the comprehensive Architecture & Design Document for a deep dive into the philosophy, safety boundaries, and design decisions behind osmcp.

[LiteLLM Compatible] [Smithery Verified]

Features

CategoryToolsPhase
🔍 Searchgrep, find1
📁 File Inspectionls, cat, stat, wc, head, tail1
🌳 Filesystemtree, du1
🔀 Git Intelligencegit_status, git_diff, git_log1
🔧 Transformjq, sed, diff1
✍️ File Mutationwrite_file, append_file, mkdir, rm, mv, cp, patch2
🚀 Git Mutationgit_add, git_commit, git_checkout, git_branch, git_pull, git_push2

Architecture

AI Agent (Claude, GPT, etc.)    │  MCP JSON-RPC (stdio)    ▼osmcp binary    ├── Policy Engine      ← enforces allowed_root, allowed_tools, limits    ├── Audit Logger       ← append-only NDJSON log of every invocation    ├── Tool Registry      ← self-registering tools via RegisterMCP()    └── Envelope Builder   ← typed {ok, data, error, meta} responses

Demo

[osmcp Demo Action] A demonstration of Claude Desktop securely editing code via osmcp, safely bounded by a TOML policy engine.

Quick Start

1. Install via Homebrew

bash
brew tap KrushnaVardhanReddy/tapbrew install osmcp

Alternatively, build from source:

bash
make build# Binary: bin/osmcp

2. Configure a Policy

toml
# policy.toml[policy]allowed_root   = "/home/user/myproject"allowed_tools  = ["grep", "ls", "cat", "git_status", "git_log"]allow_mutation = false
[limits]timeout_ms       = 5000max_output_bytes = 1048576max_matches      = 100
[audit]destination = "stderr"   # or "file"path        = "/var/log/osmcp-audit.ndjson"

3. Run

bash
bin/osmcp --policy policy.toml

The binary communicates over stdio using MCP JSON-RPC. Connect any MCP-compatible client.

Client Integrations

Claude Desktop

Add the following to your claude_desktop_config.json:

json
{  "mcpServers": {    "osmcp": {      "command": "osmcp",      "args": ["--policy", "/absolute/path/to/policy.toml"]    }  }}

Smithery (npx)

To install osmcp for Claude Desktop automatically via Smithery:

bash
npx @smithery/cli install osmcp

LiteLLM

Integrate osmcp into your enterprise LLM proxy using the LiteLLM MCP Gateway.

5. Test

bash
make test     # unit testsmake e2e      # end-to-end tests against real binarymake lint     # golangci-lint

Policy Security Model

  • allowed_root — All filesystem paths are validated to be inside this root. Traversal outside is blocked with POLICY_DENIED.
  • allowed_tools — Only tools in this list are visible to the MCP client. Unlisted tools do not appear in tools/list.
  • allow_mutation — When false, mutating tools (write, delete, git commit) are globally blocked.
  • Limits — Per-invocation timeout, output byte cap, and match count cap prevent runaway operations.

Envelope Response Format

All tool responses follow a consistent typed envelope:

json
{  "ok": true,  "tool": "grep",  "data": { ... },  "error": null,  "meta": {    "execution_time_ms": 12,    "truncated": false  }}

License

MIT

Acknowledgements

osmcp would not be possible without the incredible open-source libraries it is built upon:

  • mcp-go for the core Model Context Protocol SDK.
  • go-git for pure Go git manipulation.
  • gojq for pure Go JSON processing.
  • go-gitdiff for parsing and applying patches.
  • grep-go for regular expression searching.
  • toml for configuration parsing.

Source: README.md at commit 3e5c928

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.0.5LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts