Skip to main content

MCP support for LLM CLI

Project description

llm-tools-mcp

mcp-logo

Connect to MCP servers right from your shell. Plugin for llm (by @simonw).

PyPI Changelog Tests License

demo-long

[!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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_tools_mcp-0.4.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_tools_mcp-0.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_tools_mcp-0.4.tar.gz.

File metadata

  • Download URL: llm_tools_mcp-0.4.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llm_tools_mcp-0.4.tar.gz
Algorithm Hash digest
SHA256 a893144021c026ade06c878e3b273bcf18f67e46d172e71bf86e2ed42093561e
MD5 8dec626c41aa99cbc4f98cb8539adfd5
BLAKE2b-256 5d4aabc038b896b9ee67b65305531820f2a3b9c499a21d76f5c277c45b7dfb32

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_mcp-0.4.tar.gz:

Publisher: publish.yml on VirtusLab/llm-tools-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_tools_mcp-0.4-py3-none-any.whl.

File metadata

  • Download URL: llm_tools_mcp-0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llm_tools_mcp-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a3907ebb14fb9e7a431c360602e9bcf767b43f5bbff2f8f7cc395544195a32a2
MD5 b14ae90b66ccf7af66da80c950f408fb
BLAKE2b-256 e3c3e136286bd0589ccd9b2cff56d7f8778dcf78aa3894b82a726434bbeac1db

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_mcp-0.4-py3-none-any.whl:

Publisher: publish.yml on VirtusLab/llm-tools-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page