1. Conduid
  2. Developer Tools
  3. Mcpx Py
MCP server · Developer Tools

Mcpx Py

Python client library for https://mcp.run - call portable & secure tools for your AI Agents and Apps

Unclaimed BSD-3-Clause last commit a year ago mcpllmmcp-serveragentsmcp-runmcp-clientaidevtoolspython
62Good

Scored 2 days ago · breakdown

About Mcpx Py

Mcpx Py is an MCP server published by dylibso in the Developer Tools category: python client library for https://mcp.run - call portable & secure tools for your AI Agents and Apps.

The repository has 25 stars and 2 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/dylibso/mcpx-py

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Mcpx Py

Powered by Claude · Grounded in docs

I know everything about Mcpx Py. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 4 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • !No dynamic code executionSource scan found eval or shell execution. Review how tool inputs reach it before granting credentials.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v0.7.0v0.7.0 · 8 May 2025What's Changed refactor: use MCP protocol to access mcp.run via SSE/stdio by @zshipko in https://github.com/dylibso/mcpx-py/pull/27 Full Changelog: https://github.com/dylibso/mcpx-py/compare/v0.6.0...v0.7.0
v0.6.0v0.6.0 · 6 May 2025What's Changed cleanup: remove builtin search tool by @zshipko in https://github.com/dylibso/mcpx-py/pull/26 Full Changelog: https://github.com/dylibso/mcpx-py/compare/v0.5.3...v0.6.0
v0.5.3v0.5.3 · 2 May 2025What's Changed fix: chat result type by @zshipko in https://github.com/dylibso/mcpx-py/pull/25 Full Changelog: https://github.com/dylibso/mcpx-py/compare/v0.5.2...v0.5.3
v0.5.2v0.5.2 · 29 Apr 2025What's Changed fix: chat response handling by @zshipko in https://github.com/dylibso/mcpx-py/pull/24 Full Changelog: https://github.com/dylibso/mcpx-py/compare/v0.5.1...v0.5.2
v0.5.1v0.5.1 · 29 Mar 2025Full Changelog: https://github.com/dylibso/mcpx-py/compare/v0.5.0...v0.5.1

README

mcpx-py

PyPI

A Python library for interacting with LLMs using mcp.run tools

Features

AI Provider Support

mcpx-py supports all models supported by PydanticAI

Dependencies

  • uv
  • npm
  • ollama (optional)

mcp.run Setup

You will need to get an mcp.run session ID by running:

npx --yes -p @dylibso/mcpx gen-session --write

This will generate a new session and write the session ID to a configuration file that can be used by mcpx-py.

If you need to store the session ID in an environment variable you can run gen-session without the --write flag:

npx --yes -p @dylibso/mcpx gen-session

which should output something like:

Login successful!
Session: kabA7w6qH58H7kKOQ5su4v3bX_CeFn4k.Y4l/s/9dQwkjv9r8t/xZFjsn2fkLzf+tkve89P1vKhQ

Then set the MPC_RUN_SESSION_ID environment variable:

$ export MCP_RUN_SESSION_ID=kabA7w6qH58H7kKOQ5su4v3bX_CeFn4k.Y4l/s/9dQwkjv9r8t/xZFjsn2fkLzf+tkve89P1vKhQ

Python Usage

Installation

Using uv:

uv add mcpx-py

Or pip:

pip install mcpx-py

Example code

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)

It's also possible to get structured output by setting result_type

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)

More examples can be found in the examples/ directory

Command Line Usage

Installation

uv tool install mcpx-py

From git:

uv tool install git+https://github.com/dylibso/mcpx-py

Or from the root of the repo:

uv tool install .

uvx

mcpx-client can also be executed without being installed using uvx:

uvx --from mcpx-py mcpx-client

Or from git:

uvx --from git+https://github.com/dylibso/mcpx-py mcpx-client

Running

Get usage/help

mcpx-client --help

Chat with an LLM

mcpx-client chat

List tools

mcpx-client list

Call a tool

mcpx-client tool eval-js '{"code": "2+2"}'

LLM Configuration

Provider Setup

Claude
  1. Sign up for an Anthropic API account at https://console.anthropic.com
  2. Get your API key from the console
  3. Set the environment variable: ANTHROPIC_API_KEY=your_key_here
OpenAI
  1. Create an OpenAI account at https://platform.openai.com
  2. Generate an API key in your account settings
  3. Set the environment variable: OPENAI_API_KEY=your_key_here
Gemini
  1. Create an Gemini account at https://aistudio.google.com
  2. Generate an API key in your account settings
  3. Set the environment variable: GEMINI_API_KEY=your_key_here
Ollama
  1. Install Ollama from https://ollama.ai
  2. Pull your desired model: ollama pull llama3.2
  3. No API key needed - runs locally
Llamafile
  1. Download a Llamafile model from https://github.com/Mozilla-Ocho/llamafile/releases
  2. Make the file executable: chmod +x your-model.llamafile
  3. Run in JSON API mode: ./your-model.llamafile --json-api --host 127.0.0.1 --port 8080
  4. Use with the OpenAI provider pointing to http://localhost:8080

README fetched from the repository 4 days ago. The original is authoritative.

Questions

About Mcpx Py

How do I install Mcpx Py?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Mcpx Py safe to use with an AI agent?

Its trust score is 62 out of 100 (good). It passes 4 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Mcpx Py still maintained?

The last commit was a year ago and 2 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.