PatOConnor43/capeesh

★ 0Forks 0GoGitHub ↗Compare

README

Capeesh

MCP in Shell --> MCPsh --> cpsh --> capeesh

Capeesh is a CLI client for the Model Context Protocol (MCP). It lets you configure, authenticate, and interact with MCP servers directly from your terminal.

Features

  • Multi-transport: Connect to MCP servers over stdio (local subprocess) or Streamable HTTP (remote servers)
  • Tool interaction: List, inspect, and call tools with schema-driven argument handling
  • Resource & prompt access: List resources and read their contents by URI
  • Interactive setup: capeesh servers add walks you through configuration with a TUI
  • OAuth 2.0 / DCR: Dynamic Client Registration with browser consent flow for authenticated HTTP servers, tokens persisted to the OS keyring
  • Tab completion: Dynamic shell completion for server names, tool names, and argument fields

Installation

From source

make build

This compiles the binary to bin/capeesh and copies it to ~/.local/bin/capeesh.

Or run directly without building:

make run args="servers list"

Quick Start

1. Add an MCP server

capeesh servers add

This launches an interactive form where you configure the server name, transport type (stdio or http), and connection details.

stdio example (local MCP server via npx):

{
  "my-server": {
    "transport": "stdio",
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
    "env": { "API_KEY": "$MY_API_KEY" }
  }
}

http example (remote server with auth):

{
  "my-server": {
    "transport": "http",
    "url": "https://api.example.com/mcp",
    "auth": { "type": "dcr" }
  }
}

2. List your servers

capeesh servers list

3. Explore a server's tools

# List all available tools
capeesh server my-server inspect tools

# Show the JSON Schema for a specific tool
capeesh server my-server inspect tools read_file

4. Call a tool

# Simple tool with no arguments
capeesh server my-server tools list_files

# Tool with parameters (use -f for flags, repeatable)
capeesh server my-server tools read_file -f path=/etc/hosts

# Tool with multiple parameters (dot notation for nested fields)
capeesh server my-server tools deploy -f config.region=us-east-1 -f app.name=myapp

Flags support automatic type coercion based on the tool's JSON Schema:

  • string — default, passed as-is
  • integer / number — parsed from the string value
  • boolean — parsed via strconv.ParseBool
  • array — parsed as JSON, or comma-separated if not valid JSON
  • object — parsed as JSON

5. Read a resource

# List available resources
capeesh server my-server inspect resources

# Read a resource by URI
capeesh server my-server resources file:///etc/hostname

Configuration

Server configurations are stored in ~/.capeesh/config.json. The config file supports environment variable expansion:

{
  "servers": {
    "my-server": {
      "transport": "http",
      "url": "https://api.example.com/mcp",
      "token": "$MY_API_TOKEN"
    }
  }
}

Variables referenced with $VAR or ${VAR} are expanded from the environment at connection time.

Authentication (HTTP servers)

For HTTP-based MCP servers, Capeesh supports Dynamic Client Registration (DCR) via the MCP spec's OAuth 2.0 flow:

  1. Capeesh discovers the server's DCR endpoint
  2. Registers as a client → receives client_id and client_secret
  3. Opens your browser for user consent (with PKCE)
  4. Exchanges the authorization code for an access token
  5. Persists the token to the OS keyring for future use

Managing stored tokens

# View auth status for all servers
capeesh servers auth list

Shell Completion

Capeesh supports dynamic tab completion. After generating a completion script:

# Generate for your shell
source <(capeesh completion bash)   # or zsh, fish, powershell

The completion system connects to each server to fetch live data:

  • capeesh server <TAB> → configured server names
  • capeesh server my-srv <TAB> → inspect, tools, resources
  • capeesh server my-srv tools <TAB> → available tool names with descriptions
  • capeesh server my-srv tools my-tool -f <TAB> → argument field names from the tool's JSON Schema

License

MIT

Contributors

PatOConnor43

Issues