VL

virtuslab/llm-tools-mcp

Deployment & DevOps
38 stars 7 forks Quality 58 Trend 27Apache-2.0

Connect to MCP servers right from your shell. Plugin for simonw/llm.

Overview

Install this plugin in the same environment as LLM: It's recommended to use the --ta flag and approve each tool execution. 1. Create mcp.json file in ~/.llm-tools-mcp. 2. List available tools. llm tools is not implemented for dynamic toolboxes (see this), so tools loaded as part of MCP won't be visible. - Sync dependencies: uv sync --all-extras - Run linters / type checker: ./check.sh - Run tests: ./test.sh - Run end to end tests: ./e2e/e2e-docker.sh - [x] Release alpha version - [x] support all transports - [x] streamable http - [x] sse - [x] stdio - [ ] Build a solid test suite - [x] test config file validation - [x] test sse with dummy server - [x] test stdio with dummy server - [x] test http streamable with dummy server (see #1) - [x] manual test for sse with real server - [x] manual test for stdio with real server - [x] manual test for http streamable with real server - [x] Redirect stdout/stderr from the MCP SDK to a file or designated location - [ ] Reuse stdio connections...

README

[!Note] Current focus: Authorization #4

Installation

Install this plugin in the same environment as LLM:

llm install llm-tools-mcp

Usage

[!WARNING] It’s recommended to use the --ta flag and approve each tool execution.

  1. Create mcp.json file in ~/.llm-tools-mcp.

    Example file:

    {
      "mcpServers": {
        "filesystem": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-filesystem",
            "~/demo"
          ]
        }
      }
    }
    
  2. List available tools.

    [!WARNING] llm tools is not implemented for dynamic toolboxes (see this), so tools loaded as part of MCP won’t be visible.

    llm tools list
    
  3. Run llm with tools.

    llm --ta -T MCP "what files are in the demo directory? show me contents of one of the files (any)"
    

Other examples

Dynamically change your MCP config:

llm --ta -T 'MCP("/path/to/custom/mcp.json")' "your prompt here"

Development

Now (to be verified)

  • Sync dependencies: uv sync --all-extras
  • Run linters / type checker: ./check.sh
  • Run tests: ./test.sh
  • Run end to end tests: ./e2e/e2e-docker.sh

To Do

  • [x] Release alpha version
  • [x] support all transports
    • [x] streamable http
    • [x] sse
    • [x] stdio
  • [ ] Build a solid test suite
    • [x] test config file validation
    • [x] test sse with dummy server
    • [x] test stdio with dummy server
    • [x] test http streamable with dummy server (see #1)
    • [x] manual test for sse with real server
    • [x] manual test for stdio with real server
    • [x] manual test for http streamable with real server
  • [x] Redirect stdout/stderr from the MCP SDK to a file or designated location
  • [ ] Reuse stdio connections
  • [x] Support non-stdio MCP servers
  • [ ] Handle tool name conflicts (prefix with mcp server name?)
  • [ ] Gather feedback on the ~/.llm-tools-mcp directory naming
  • [x] Improve failure handling:
    • [x] When connecting to an MCP server fails
    • [x] When mcp.json is malformed
  • [ ] Improve this README:
    • [ ] Add more detail in the Development section (mention uv?)
View this README on GitHub

Install

npx -y @modelcontextprotocol/server-filesystem ~/demo

Configuration

{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "~/demo" ] } } }