mcp-cli  by apify

Universal CLI for Model Context Protocol interactions

Created 2 months ago
323 stars

Top 84.5% on SourcePulse

GitHubView on GitHub
Project Summary

Provides a universal command-line interface (CLI) for the Model Context Protocol (MCP), enabling seamless interaction with MCP servers from interactive shells, scripts, and AI coding agents. It simplifies complex MCP operations, offering features like persistent sessions, secure OAuth 2.1 authentication, and a proxy for AI sandboxing, thereby enhancing developer productivity and AI integration capabilities.

How It Works

The mcpc CLI acts as a Swiss Army knife for MCP, mapping protocol operations to intuitive commands. It supports communication via Streamable HTTP or stdio, managing persistent sessions through a lightweight background bridge process. Core features include robust OAuth 2.1 support with OS keychain integration for secure credential storage and an MCP proxy server designed for safely authenticating AI-generated code within sandboxed environments. This approach offers a lightweight, cross-platform solution with minimal dependencies.

Quick Start & Requirements

  • Primary install: npm install -g @apify/mcpc
  • Non-default prerequisites: Linux users require the libsecret library (e.g., sudo apt-get install libsecret-1-0 on Debian/Ubuntu). Node.js and npm are implicitly required for installation.
  • Links: Installation and usage examples are detailed within the README.

Highlighted Details

  • Supports persistent sessions, keeping multiple server connections alive simultaneously.
  • Full OAuth 2.1 implementation with PKCE, automatic token refresh, and secure OS keychain storage for credentials.
  • MCP proxy server for AI sandboxing, preventing exposure of original authentication tokens to AI-generated code.
  • "Code mode" via --json output enables integration with scripting tools like jq and automated workflows.
  • Lightweight design with minimal dependencies, functional across macOS, Windows, and Linux.

Maintenance & Community

The initial version was developed by Jan Curn of Apify with assistance from Claude Code. No specific community channels (like Discord/Slack) or ongoing sponsorship details are provided in the README.

Licensing & Compatibility

  • License: Apache-2.0.
  • Compatibility: The Apache-2.0 license is permissive, generally allowing for commercial use and integration into closed-source projects.

Limitations & Caveats

The project explicitly notes that the MCP proxy does not inherently secure an insecure MCP server; local stdio servers retain system access, and HTTP servers can still expose credentials. Users are advised to only trust and limit access to MCP servers. Features like Async tasks, Roots, Elicitation, and Completion are listed as planned but not yet implemented. The tool does not have direct LLM access for sampling.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
1
Star History
106 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.