1. Conduid
  2. Developer Tools
  3. Ophis
MCP server · Developer Tools

Ophis

Transform any Cobra CLI into an MCP server

71Good

Scored 7 hours ago · breakdown

About Ophis

Ophis is an MCP server published by njayp in the Developer Tools category: transform any Cobra CLI into an MCP server.

The repository has 93 stars and 18 forks, with the last commit 2 months ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/njayp/ophis

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Ophis

Powered by Claude · Grounded in docs

I know everything about Ophis. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 7 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v1.1.4Release v1.1.4 · 18 Feb 2026Changes in v1.1.4 feat: add DefaultEnv config field for enable commands (#44) fix: allow claude-code to review PRs from all users Import go get github.com/njayp/ophis@v1.1.4
v1.1.3Release v1.1.3 · 18 Feb 2026Changes in v1.1.3 feat: allow configurable command name (#40) fix: allow Bash tool in claude-code review workflow debug: enable show_full_output for claude-code review fix: harden claude-code review workflow for branch and fork PRs chore:…
v1.1.2Release v1.1.2 · 14 Feb 2026Changes in v1.1.2 chore: update deps feat(ophis) tool annotations (#38) Import go get github.com/njayp/ophis@v1.1.2
v1.1.1Release v1.1.1 · 2 Feb 2026Changes in v1.1.1 remove impractical examples feat: add ToolNamePrefix config option to shorten MCP tool names (#37) Import go get github.com/njayp/ophis@v1.1.1
v1.1.0Release v1.1.0 · 7 Dec 2025Changes in v1.1.0 refactor(selector) replace pre and postrun with middleware pattern (#34) Feat/add json schema (#32) Import go get github.com/njayp/ophis@v1.1.0

README

Project Logo

Transform any Cobra CLI into an MCP server

Ophis automatically converts your Cobra commands into MCP tools, and provides CLI commands for integration with Claude Desktop, VSCode, and Cursor.

Quick Start

Install

go get github.com/njayp/ophis

Add to your CLI

package main

import (
    "os"
    "github.com/njayp/ophis"
)

func main() {
    rootCmd := createMyRootCommand()
    rootCmd.AddCommand(ophis.Command(nil))

    if err := rootCmd.Execute(); err != nil {
        os.Exit(1)
    }
}

Enable in Claude Desktop, VSCode, or Cursor

# Claude Desktop
./my-cli mcp claude enable
# Restart Claude Desktop

# VSCode (requires Copilot in Agent Mode)
./my-cli mcp vscode enable

# Cursor
./my-cli mcp cursor enable

Your CLI commands are now available as MCP tools!

Stream over HTTP

Expose your MCP server over HTTP for remote access:

./my-cli mcp stream --host localhost --port 8080

Commands

The ophis.Command(nil) adds these subcommands to your CLI (the default command name is mcp, configurable via Config.CommandName):

mcp
├── start            # Start MCP server on stdio
├── stream           # Stream MCP server over HTTP
├── tools            # Export available MCP tools as JSON
├── claude
│   ├── enable       # Add server to Claude Desktop config
│   ├── disable      # Remove server from Claude Desktop config
│   └── list         # List Claude Desktop MCP servers
├── vscode
│   ├── enable       # Add server to VSCode config
│   ├── disable      # Remove server from VSCode config
│   └── list         # List VSCode MCP servers
└── cursor
    ├── enable       # Add server to Cursor config
    ├── disable      # Remove server from Cursor config
    └── list         # List Cursor MCP servers

Configuration

Control which commands and flags are exposed as MCP tools using selectors. By default, all commands and flags are exposed (except hidden/deprecated).

config := &ophis.Config{
    Selectors: []ophis.Selector{
        {
            CmdSelector: ophis.AllowCmdsContaining("get", "list"),
            LocalFlagSelector: ophis.ExcludeFlags("token", "secret"),
            InheritedFlagSelector: ophis.NoFlags,  // Exclude persistent flags

            // Middleware wraps command execution
            Middleware: func(ctx context.Context, req *mcp.CallToolRequest, in ophis.ToolInput, next func(context.Context, *mcp.CallToolRequest, ophis.ToolInput) (*mcp.CallToolResult, ophis.ToolOutput, error)) (*mcp.CallToolResult, ophis.ToolOutput, error) {
                ctx, cancel := context.WithTimeout(ctx, time.Minute)
                defer cancel()
                return next(ctx, req, in)
            },
        },
    },
}

rootCmd.AddCommand(ophis.Command(config))

Custom Command Name

By default the ophis command is named mcp. If your CLI already uses mcp for something else, set CommandName to avoid the collision:

config := &ophis.Config{
    CommandName: "agent",
}

rootCmd.AddCommand(ophis.Command(config))

The command tree, editor config (enable/disable), and internal filters all use the configured name automatically.

Default Environment Variables

Editors launch MCP server subprocesses with a minimal environment. On macOS this means a PATH of just /usr/bin:/bin:/usr/sbin:/sbin, so tools like helm, kubectl, or docker installed via mise/homebrew/nix won't be found. Use DefaultEnv to capture the current PATH (or any other variables) at enable time:

config := &ophis.Config{
    DefaultEnv: map[string]string{
        "PATH": os.Getenv("PATH"),
    },
}

rootCmd.AddCommand(ophis.Command(config))

These are merged into the editor config written by enable. User-provided --env values take precedence on conflict.

See docs/config.md for detailed configuration options.

How It Works

Ophis bridges Cobra commands and the Model Context Protocol:

  1. Command Discovery: Recursively walks your Cobra command tree
  2. Schema Generation: Creates JSON schemas from command flags and arguments (docs/schema.md)
  3. Tool Execution: Spawns your CLI as a subprocess and captures output (docs/execution.md)

Contributing

Contributions welcome! See CONTRIBUTING.md.

README fetched from the repository 7 hours ago. The original is authoritative.

Questions

About Ophis

How do I install Ophis?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Ophis safe to use with an AI agent?

Its trust score is 71 out of 100 (good). It passes 5 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Ophis still maintained?

Yes — the last commit was 2 months ago. The repository has 93 stars and 18 forks and 8 open issues.