{"id":32522948,"url":"https://github.com/mongodben/mcp-2-cli","last_synced_at":"2026-05-17T02:06:05.036Z","repository":{"id":319555575,"uuid":"1079009807","full_name":"mongodben/mcp-2-cli","owner":"mongodben","description":"Convert MCP server to CLI application","archived":false,"fork":false,"pushed_at":"2025-10-19T22:17:54.000Z","size":60,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-28T07:29:51.186Z","etag":null,"topics":["cli","mcp","mcp-server"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mcp-2-cli","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mongodben.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-18T22:25:58.000Z","updated_at":"2025-10-20T18:26:42.000Z","dependencies_parsed_at":"2025-10-19T13:31:34.069Z","dependency_job_id":"4703e31b-acb2-4a37-8880-7a38b96770a4","html_url":"https://github.com/mongodben/mcp-2-cli","commit_stats":null,"previous_names":["mongodben/mcp-2-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mongodben/mcp-2-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodben%2Fmcp-2-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodben%2Fmcp-2-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodben%2Fmcp-2-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodben%2Fmcp-2-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongodben","download_url":"https://codeload.github.com/mongodben/mcp-2-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodben%2Fmcp-2-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283962104,"owners_count":26923739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","mcp","mcp-server"],"created_at":"2025-10-28T07:29:44.151Z","updated_at":"2026-05-17T02:06:05.023Z","avatar_url":"https://github.com/mongodben.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcp-2-cli\n\n\nConvert a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro) server to a CLI application.\n\nThis is useful if you want to use an MCP server's tools, resources, and prompts outside an MCP client. The `mcp-2-cli` library acts as a MCP client with the CLI as the interface.\n\nYou may want to use an MCP server's tools inside an [Agent Skill](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview) or in a programmatic script.\n\n## Features\n\n- Automatically generates CLI commands from MCP server capabilities\n- Supports MCP **prompts**, **resources**, and **tools**\n- JSON Schema validation for tool arguments\n- Graceful error handling with JSONRPC error support\n\n## Supported Server Types\n\nCurrently, `mcp-2-cli` only supports stdio MCP servers.\n\nSupport for Streamable HTTP servers coming soon!\n\n## Configuration\n\nYou must first create a JSON configuration file with the following schema:\n\n```js\n{\n    \"command\": \"\u003croot command\u003e\", // Required\n    \"args\": [\"--additional\", \"args\"] // Optional\n    \"transport\": \"stdio\" // Required. currently only \"stdio\" supported\n    \"cliName\": \"\u003cname\u003e\" // Optional. defaults to \"mcp-cli\"\n}\n```\n\nFor example: \n```js\n{\n  \"command\": \"npx\",\n  \"args\": [\"-y\", \"@modelcontextprotocol/server-filesystem\", \".\"],\n  \"transport\": \"stdio\",\n  \"cliName\": \"fs-cli\"\n}\n```\n\n`mcp-2-cli` will first look for this file in the environment variable `MCP_2_CLI_CONFIG_PATH`.\nIf the environment variable is not provided, `mcp-2-cli` will look for a\nfile named `mcp-2-cli.config.json` in the current directory.\n\nTo run the MCP CLI, you can use `npx`: \n\n```sh\nMCP_2_CLI_CONFIG_PATH=\"path/to/config.json\" npx mcp-2-cli \u003cargs...\u003e\n```\n\n\n## CLI Commands\n\nAn `mcp-2-cli` CLI automatically get commands for all available prompts, resources, and tools.\n\nThe generated CLI follows CLI best practices, with nested actions and `--help` commands.\n\nThe CLI commands use the following pattern:\n\n```bash\nmcp-cli \u003caction\u003e \u003cname\u003e --arg1 val1 --arg2 val2 ... \n```\n\nFor example, to use the [`server-filesystem` MCP's `read_text_file` tool](https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem):\n\n```bash\nserver-filesystem tools read_text_file --path path/to/file.ext\n```\n\nIf there are not any available actions for one of the prompts, resources or tools action categories, those actions categories will not be listed. For example, if your server supports only tools but no prompts and resources, only `mcp-cli tools` would be a valid command.\n\n### Prompts\n\n```bash\n# List all available prompts\nmcp-cli prompts -help\n\n# Get a specific prompt \nmcp-cli prompts \u003cprompt-name\u003e\n# Get help with specific prompt\nmcp-cli prompts \u003cprompt-name\u003e --help\n```\n\n### Resources\n\n```bash\n# List all available resources\nmcp-cli resources -help\n\n# Get a specific resource\nmcp-cli resources \u003cresource-uri\u003e\n# Get help with a specific resource\nmcp-cli resources \u003cresource-uri\u003e --help\n```\n\n### Tools\n\n```bash\n# List all available tools\nmcp-cli tools --help\n\n# Call a tool (with optional arguments as JSON)\nmcp-cli tools \u003ctool-name\u003e \n# Get help with a specific tool\nmcp-cli tools \u003ctool-name\u003e --help\n```\n\n## Use as Library \n\n### Installation\n\n```bash\nnpm install mcp-2-cli\n```\n\n### Basic Example\n\n```typescript\nimport { createMcpCli } from 'mcp-2-cli';\n\nconst config = {\n  command: 'npx',\n  args: ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'],\n  transport: 'stdio',\n  name: \"filesystem-cli\"\n};\n\nconst cli = await createMcpCli(config);\nawait cli.parseAsync();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodben%2Fmcp-2-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongodben%2Fmcp-2-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodben%2Fmcp-2-cli/lists"}