Skip to main content

A Python client for mcp.run

Project description

mcp-run

PyPI

A Python client for https://www.mcp.run

Dependencies

  • uv
  • npm

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 mcp-run.

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 mcp-run

Or pip:

pip install mcp-run

Example code

from mcp_run import Client  # Import the mcp.run client

client = Client()  # Create the client, this will check the
# default location for the mcp.run config or
# the `MCP_RUN_SESSION_ID` env var can be used
# to specify a valid mcp.run session id

# Call a tool with the given input
results = client.call_tool("eval-js", params={"code": "'Hello, world!'"})

# Iterate over the results
for content in results.content:
    print(content.text)

More examples can be found in the examples/ directory

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

mcp_run-0.1.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

mcp_run-0.1.2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_run-0.1.2.tar.gz.

File metadata

  • Download URL: mcp_run-0.1.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.31

File hashes

Hashes for mcp_run-0.1.2.tar.gz
Algorithm Hash digest
SHA256 01a73572d658ca90e752241741c88bf135fbf702f76e1e5a551b1058b6e5cbe2
MD5 0cbde5ff50d112deb8be1b4e6c18c2c8
BLAKE2b-256 a830937839c75d1e31f4eded0da2e5d9892e4351aec20228c7ff91ab70e48443

See more details on using hashes here.

File details

Details for the file mcp_run-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mcp_run-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.31

File hashes

Hashes for mcp_run-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 505cc06e242f43e36b9bb14e3a8a4af15e9e48533eeeae328b273a9825208c72
MD5 b812652be278d4e9d14b454b5a0cfbce
BLAKE2b-256 e918c41bafb8e564c59608c00a57241c11c4e082f3b1b78279a8ed8c08aba5e8

See more details on using hashes here.

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