https://github.com/mlaugharn/cli-mcp
expose clis over model context protocol
https://github.com/mlaugharn/cli-mcp
mcp model-context-protocol
Last synced: 11 months ago
JSON representation
expose clis over model context protocol
- Host: GitHub
- URL: https://github.com/mlaugharn/cli-mcp
- Owner: mlaugharn
- Created: 2024-11-26T22:36:14.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-04T23:03:47.000Z (over 1 year ago)
- Last Synced: 2024-12-05T00:18:29.849Z (over 1 year ago)
- Topics: mcp, model-context-protocol
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cli MCP server
cli bridge

Pretty much a remix of the demo notes app.
## Components
### Resources
The server implements a simple system for working with arbitrary clis with:
- Custom cli:// URI scheme for accessing individual notes
- Each cli resource has a name, help menu subtree, and text/plain mimetype
### Tools
The server implements one tool:
- add (cmd): Recursively parses cli help menu subtrees and stores definition
- Takes "cmd"
- Updates server state and notifies clients of resource changes
- help (cmd): Return subtrees definition
- run (cmd, cmd_args | None): Run a known command
## Quickstart
### Install
#### Claude Desktop
Note: I had to use `/opt/homebrew/bin/uv` instead of just `uv` in the command field in this json:
On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
```
{"mcpServers": {
"cli": {
"command": "uv",
"args": [
"run",
"--directory",
"\",
"cli"
]}
}
}
```
By design, you have to explicitly 'add' a command before it can be run.
### Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging
experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).
You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:
```bash
npx @modelcontextprotocol/inspector uv --directory run cli
```
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.