1. Conduid
  2. Security
  3. CLI
MCP server · Security

CLI

Interactive CLI client for remote Model Context Protocol (MCP) servers with OAuth 2.0 support.

Unclaimed last commit a year ago climcpmcp-client
39Low

Scored 4 days ago · breakdown

About CLI

CLI is an MCP server published by tilesprivacy in the Security category: interactive CLI client for remote Model Context Protocol (MCP) servers with OAuth 2.0 support.

The repository has 14 stars and 3 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/tilesprivacy/mcp-cli

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 CLI

Powered by Claude · Grounded in docs

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

Security checks

Static checks derived from the repository yesterday. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • !License declaredNo license file. Legally you have no right to use it in a product.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.

1 check has not been run yet.

README

MCP CLI

Interactive CLI client and library for Model Context Protocol (MCP) servers with OAuth 2.0 support.

demo.gif

Features

  • Dual Purpose: Use as CLI tool or integrate as a library
  • OAuth 2.0 Authentication: Seamless browser-based OAuth flow
  • Transport Fallback: Automatic fallback from Streamable HTTP to SSE
  • Interactive Shell: Command-line interface for tool discovery and execution
  • Real-time Notifications: Support for server-sent notifications

Installation

Clone and run:

npm install -g mcp-cli

CLI Usage

Basic Usage

# Connect to default server (http://localhost:3000/mcp)
mcp-cli

# Connect to specific server
mcp-cli http://localhost:8080/mcp
mcp-cli https://example.com/mcp

Environment Variables

# Set default server URL
export MCP_SERVER_URL=http://localhost:8080/mcp
mcp-cli

Interactive Commands

Once connected, you can use these commands:

  • list - List available tools
  • tool-details <name> - Show detailed schema for a tool
  • call <tool_name> [args] - Call a tool with JSON arguments
  • notifications [interval] [count] - Start notification stream
  • status - Show connection status
  • help - Show help message
  • quit - Exit the client

CLI Examples

# List all available tools
mcp> list

# Get details about a specific tool
mcp> tool-details file-operations

# Call a tool with arguments
mcp> call my-tool {"param": "value", "number": 42}

# Start notification stream (interval: 1000ms, count: 10)
mcp> notifications 1000 10

Library Usage

Basic Example

import { MCPClient, BrowserOAuthHandler } from 'mcp-cli';

const client = new MCPClient({
  callbackPort: 8090,
  oauthHandler: new BrowserOAuthHandler()
});

// Set up event handlers
client.on('connected', (transport) => {
  console.log(`Connected via ${transport}`);
});

client.on('error', (error) => {
  console.error('Connection error:', error);
});

// Connect to server
await client.connect('http://localhost:3000/mcp');

// List available tools
const tools = await client.listTools();
console.log('Available tools:', tools);

// Call a tool
const result = await client.callTool('my-tool', { param: 'value' });
console.log('Tool result:', result);

// Clean up
await client.close();

Configuration Options

interface MCPClientConfig {
  callbackPort?: number;                    // OAuth callback port (default: 8090)
  oauthMetadata?: OAuthClientMetadata;      // Custom OAuth metadata
  transportPriority?: TransportType[];      // Transport preference order
  connectionTimeout?: number;               // Connection timeout in ms
  oauthHandler?: OAuthHandler;              // Custom OAuth handler
}

Custom OAuth Handler

import { CustomOAuthHandler } from 'mcp-cli';

class MyOAuthHandler extends CustomOAuthHandler {
  async handleRedirect(url: string): Promise<void> {
    // Custom redirect handling (e.g., show in app UI)
    console.log('Please visit:', url);
  }

  async waitForCallback(): Promise<string> {
    // Custom callback handling (e.g., from app UI)
    return await getAuthCodeFromUI();
  }
}

const client = new MCPClient({
  oauthHandler: new MyOAuthHandler()
});

Event Handling

client.on('connected', (transport) => {
  console.log(`Connected using ${transport} transport`);
});

client.on('disconnected', () => {
  console.log('Disconnected from server');
});

client.on('oauth-redirect', (url) => {
  console.log('OAuth redirect:', url);
});

client.on('oauth-callback-received', (code) => {
  console.log('OAuth code received');
});

client.on('notification', (notification) => {
  console.log('Server notification:', notification);
});

client.on('error', (error) => {
  console.error('Client error:', error);
});

Advanced Usage

// Get connection status
const status = client.getConnectionStatus();
console.log('Connected:', status.isConnected);
console.log('Transport:', status.transportType);
console.log('Has OAuth:', status.hasOAuth);

// Get tool details
const toolDetails = await client.getToolDetails('my-tool');
if (toolDetails) {
  console.log('Tool schema:', toolDetails.inputSchema);
}

// Access underlying SDK client (for advanced usage)
const sdkClient = client.getClient();
if (sdkClient) {
  // Use SDK client directly
}

OAuth Flow

The system automatically handles OAuth 2.0 authentication:

  1. When connecting to a server that requires OAuth, the system will trigger the OAuth handler
  2. Default handler opens your browser for authorization
  3. Custom handlers can implement different flows (mobile apps, web apps, etc.)
  4. The system automatically receives the authorization code and completes the connection
  5. Tokens are managed automatically for the session duration

Transport Methods

The client tries connection methods in this order:

  1. Streamable HTTP with OAuth - Primary method with full OAuth support
  2. SSE (Server-Sent Events) - Fallback method with limited OAuth support

TypeScript Support

Full TypeScript definitions are included:

import { 
  MCPClient, 
  BrowserOAuthHandler, 
  CustomOAuthHandler,
  MCPClientConfig,
  OAuthHandler,
  TransportType,
  ToolDetails,
  Tool,
  OAuthClientMetadata 
} from 'mcp-cli';

Error Handling

The library and CLI provide comprehensive error handling:

  • Connection refused errors include server status checks
  • Timeout errors suggest network troubleshooting
  • OAuth errors provide authorization guidance
  • All errors are properly typed and include helpful messages

Development

Building from Source

git clone <repository-url>
cd mcp-cli
npm install
npm run build

Running in Development

npm run dev  # Watch mode
npm start    # Run built CLI version

License

MIT

README fetched from the repository yesterday. The original is authoritative.

Questions

About CLI

How do I install CLI?

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

Is CLI safe to use with an AI agent?

Its trust score is 39 out of 100 (low). It passes 3 of the 5 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 CLI still maintained?

The last commit was a year ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.