Ophis
Transform any Cobra CLI into an MCP server
What is Ophis?
Ophis is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to transform any cobra cli into an mcp server
Transform any Cobra CLI into an MCP server
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Transform any Cobra CLI into an MCP server
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx ophisConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Ophis
Ophis is a Go library that automatically converts any Cobra CLI application into a fully functional MCP server, requiring minimal changes to existing code. It recursively walks the Cobra command tree, generates JSON schemas from command flags, and exposes each subcommand as an MCP tool that AI agents can invoke. This means any CLI tool built with Cobra — internal tooling, platform CLIs, or DevOps utilities — becomes immediately accessible to Claude, VS Code, Cursor, and other MCP-compatible clients without building a separate integration.
Prerequisites
- Go 1.21 or later
- An existing Cobra CLI application or a new Go project
- The ophis Go module added as a dependency
- An MCP client such as Claude Desktop, Claude Code, or Cursor
Add ophis as a dependency to your Go module
Run go get to add the ophis library to your existing Cobra CLI project.
go get github.com/njayp/ophisRegister the ophis MCP command with your root Cobra command
In your CLI's main.go or command setup, import ophis and call its enable function to attach the mcp subcommand to your root command.
import "github.com/njayp/ophis"
// In your root command setup:
ophisCmd := ophis.NewCommand(rootCmd, ophis.Config{
CommandName: "mcp",
})
rootCmd.AddCommand(ophisCmd)Build your CLI with the new mcp subcommand
Recompile your CLI. It now has an 'mcp' subcommand with start, stream, tools, and editor integration subcommands.
go build -o my-cli .Enable the MCP server for Claude Desktop
Use the built-in claude integration subcommand to register your CLI as an MCP server in Claude Desktop's config.
./my-cli mcp claude enable
# Then restart Claude DesktopOr configure manually in claude_desktop_config.json
Alternatively, add the server manually to your MCP client configuration file.
{
"mcpServers": {
"my-cli": {
"command": "/absolute/path/to/my-cli",
"args": ["mcp", "start"],
"env": {}
}
}
}For remote access, stream the MCP server over HTTP
Use the stream subcommand to expose your CLI's MCP tools over HTTP for remote or shared access.
./my-cli mcp stream --host localhost --port 8080Ophis Examples
Client configuration
Claude Desktop JSON config for a Cobra CLI named my-cli converted to an MCP server with ophis.
{
"mcpServers": {
"my-cli": {
"command": "/usr/local/bin/my-cli",
"args": ["mcp", "start"],
"env": {}
}
}
}Prompts to try
Example prompts once your Cobra CLI is exposed as an MCP server via ophis.
- "List all the tools available from my-cli."
- "Run the deploy subcommand with environment=staging and version=1.2.3."
- "Use my-cli to check the status of the production environment."
- "Export the available MCP tools from my-cli as a JSON schema."
- "Enable my-cli for use in VS Code via the MCP integration."Troubleshooting Ophis
The mcp subcommand does not appear after adding ophis
Ensure you called rootCmd.AddCommand(ophisCmd) in your command setup before calling rootCmd.Execute(). Rebuild the binary after making the change and run './my-cli --help' to verify the mcp subcommand appears.
Some CLI flags are not appearing as MCP tool parameters
Ophis uses Selectors to control which commands and flags are exposed. By default it exposes all commands and flags. If you customized the Config with CmdSelector, LocalFlagSelector, or InheritedFlagSelector, review those filters to ensure the desired flags are included.
Claude Desktop does not pick up the enabled MCP server after running 'mcp claude enable'
The 'mcp claude enable' command modifies Claude Desktop's config file. You must fully restart Claude Desktop (quit and reopen) for the changes to take effect. Check the config file at ~/Library/Application Support/Claude/claude_desktop_config.json to confirm the entry was added.
Frequently Asked Questions about Ophis
What is Ophis?
Ophis is a Model Context Protocol (MCP) server that transform any cobra cli into an mcp server It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Ophis?
Follow the installation instructions on the Ophis GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Ophis?
Ophis works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Ophis free to use?
Yes, Ophis is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
Ophis Alternatives — Similar Developer Tools Servers
Looking for alternatives to Ophis? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Ophis in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Ophis?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.