### Install mcpx-py as uv tool (Local) - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command installs the mcpx-py package as a command-line tool using uv's tool installation feature, installing from the current local directory. ```Bash uv tool install . ``` -------------------------------- ### Install mcpx-py as uv tool (PyPI) - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command installs the mcpx-py package as a command-line tool using uv's tool installation feature, pulling from PyPI. ```Bash uv tool install mcpx-py ``` -------------------------------- ### Start mcpx-client Chat - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command starts an interactive chat session with an LLM using the mcpx-client command-line tool. ```Bash mcpx-client chat ``` -------------------------------- ### Install mcpx-py as uv tool (Git) - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command installs the mcpx-py package as a command-line tool using uv's tool installation feature, pulling directly from the Git repository. ```Bash uv tool install git+https://github.com/dylibso/mcpx-py ``` -------------------------------- ### Install mcpx-py with uv - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command installs the mcpx-py Python library using the uv package manager. uv is a fast Python package installer and resolver. ```Bash uv add mcpx-py ``` -------------------------------- ### Get mcpx-client Help - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command displays the usage information and available options for the mcpx-client command-line tool. ```Bash mcpx-client --help ``` -------------------------------- ### Execute mcpx-client with uvx (PyPI) - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command executes the mcpx-client command-line tool directly from the mcpx-py package installed via PyPI using uvx, without requiring a global installation of the tool. ```Bash uvx --from mcpx-py mcpx-client ``` -------------------------------- ### Install mcpx-py with pip - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command installs the mcpx-py Python library using the standard pip package manager. ```Bash pip install mcpx-py ``` -------------------------------- ### Execute mcpx-client with uvx (Git) - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command executes the mcpx-client command-line tool directly from the mcpx-py package pulled from Git using uvx, without requiring a global installation of the tool. ```Bash uvx --from git+https://github.com/dylibso/mcpx-py mcpx-client ``` -------------------------------- ### Run Llamafile in JSON API Mode - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command executes a Llamafile model, starting it as a local server with a JSON API endpoint on a specified host and port. ```Bash ./your-model.llamafile --json-api --host 127.0.0.1 --port 8080 ``` -------------------------------- ### Use mcpx-py Chat with Sync Message (Structured Output) - Python Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This Python code shows how to use the Chat class to get structured output by defining a Pydantic BaseModel and passing it to the `result_type` parameter. The response data will conform to the specified model. ```Python from mcpx_py import Chat, BaseModel, Field from typing import List class Summary(BaseModel): """ A summary of some longer text """ source: str = Field("The source of the original_text") original_text: str = Field("The original text to be summarized") items: List[str] = Field("A list of summary points") llm = Chat("claude-3-5-sonnet-latest", result_type=Summary) response = llm.send_message_sync( "summarize the contents of example.com" ) print(response.data) ``` -------------------------------- ### List mcpx-client Tools - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command lists the available tools that can be called using the mcpx-client command-line tool. ```Bash mcpx-client list ``` -------------------------------- ### Use mcpx-py Chat with Sync Message (Basic) - Python Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This Python code demonstrates how to initialize the Chat class with a specific LLM model and send a synchronous message. It prints the data received in the response. ```Python from mcpx_py import Chat llm = Chat("claude-3-5-sonnet-latest") # Or OpenAI # llm = Chat("gpt-4o") # Or Ollama # llm = Chat("ollama:qwen2.5") # Or Gemini # llm = Chat("gemini-2.0-flash") response = llm.send_message_sync( "summarize the contents of example.com" ) print(response.data) ``` -------------------------------- ### Call mcpx-client Tool (eval-js) - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command demonstrates how to call a specific tool, `eval-js`, using the mcpx-client command-line tool, providing input as a JSON string. ```Bash mcpx-client tool eval-js '{"code": "2+2"}' ``` -------------------------------- ### Pull Ollama Model - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command uses the Ollama CLI to download a specific LLM model, such as `llama3.2`, for local use. ```Bash ollama pull llama3.2 ``` -------------------------------- ### Make Llamafile Executable - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command changes the permissions of a downloaded Llamafile model to make it executable. ```Bash chmod +x your-model.llamafile ``` -------------------------------- ### Generate mcp.run Session ID (Write to file) - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command generates a new mcp.run session ID and automatically writes it to a configuration file that mcpx-py can use. It requires npm and the @dylibso/mcpx package. ```Bash npx --yes -p @dylibso/mcpx gen-session --write ``` -------------------------------- ### Generate mcp.run Session ID (Output to console) - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command generates a new mcp.run session ID and prints it to the console. This is useful if you need to store the session ID in an environment variable instead of a configuration file. It requires npm and the @dylibso/mcpx package. ```Bash npx --yes -p @dylibso/mcpx gen-session ``` -------------------------------- ### Set MCP_RUN_SESSION_ID Environment Variable - Bash/Shell Source: https://github.com/dylibso/mcpx-py/blob/main/README.md This command sets the MCP_RUN_SESSION_ID environment variable with the session ID obtained from the `gen-session` command run without the `--write` flag. This allows mcpx-py to authenticate with mcp.run. ```Bash export MCP_RUN_SESSION_ID=kabA7w6qH58H7kKOQ5su4v3bX_CeFn4k.Y4l/s/9dQwkjv9r8t/xZFjsn2fkLzf+tkve89P1vKhQ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.