Skip to main content

MCP support for LLM CLI

Project description

llm-tools-mcp

PyPI Changelog Tests License

MCP support for the LLM CLI tool.

Demo

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.

    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

Before

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-tools-mcp
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

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.1.tar.gz (10.8 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.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for llm_tools_mcp-0.1.tar.gz
Algorithm Hash digest
SHA256 eb2de79259fabff7090041167dc29c12297577fc2f89b8708a37b357f30c1845
MD5 db61de143aa1fa03996dea7da150495a
BLAKE2b-256 5a443afeaafeb4ecab8e36d2be864e784ba66da6210c1eec36f289866d518342

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_mcp-0.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for llm_tools_mcp-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ed9f105fddafa65fe38db32ecf48d0f44ad3347a1b0671fc5fa94bd0afabf0c
MD5 60915b81bc5ae1dd2ea91aed5d5804ce
BLAKE2b-256 6b2f51a793c0978573106d3f159f343a30f445e95b069340d6577abc3b4d1c3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_mcp-0.1-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