Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

Home GitHub Documentation License Tests

Pyjo-MCP

Pyjoyment

Model Context Protocol server and client for Pyjoyment, of the revision 2026-07-28 of the specification.

Installation

From PyPI, with Pyjoyment, which it depends on:

pip install Pyjo-MCP

or, in a project managed with uv:

uv add Pyjo-MCP

The development version is installed from the Git repository:

pip install git+https://github.com/pyjoyment/Pyjo-MCP

Usage

A server of MCP is a route of an application of Pyjoyment, whose tools are functions, with the schemas of their type hints and the descriptions of their docstrings:

from Pyjo.MCP.Server import Server
from Pyjo.MCP.Tool import Error
from Pyjoyment.Lite import *

server = Server(name='calculator', version='1.0.0')


@server.tool
def divide(a: float, b: float) -> float:
    """Divide the first number by the second one."""
    if b == 0:
        raise Error.new('Division by zero')
    return a / b


# Host and Origin of localhost only, against DNS rebinding
plugin('AllowedHosts')

any('/mcp', server.to_action())

app.start()
uv run python calculator.py daemon -l http://127.0.0.1:3000

Its endpoint is http://127.0.0.1:3000/mcp, of the transport Streamable HTTP. The whole calculator is examples/calculator.py.

Prompts, the templates of messages that a user picks, and resources, the data that a client reads by its URI, are functions too:

@server.prompt
def explain(expression: str) -> str:
    """Explain an arithmetic expression step by step."""
    return f'Explain step by step how to compute {expression}.'


@server.resource('calculator://precision', mime_type='application/json')
def precision() -> dict:
    """The precision of the numbers of the calculator."""
    return {'digits': 15}

The same application serves the transport stdio too, with a hook:

hook('before_server_start', server.to_stdio())

A client of MCP, as Claude Code, then starts it with the command stdio:

claude mcp add calculator -- uv run python examples/calculator.py stdio

examples/weather.py is a gateway to the weather of Open-Meteo, which needs no key, with the tools find_places, current_weather, forecast and hourly_forecast, which request the API with the non-blocking user agent of the application. A client of MCP, as Claude Code, connects to it over HTTP:

uv run python examples/weather.py daemon -l http://127.0.0.1:3000
claude mcp add --transport http weather http://127.0.0.1:3000/mcp

examples/mcp_cli.py is a client of the command line for the tools of any server of MCP: a tool is a command, in kebab-case, and its arguments are options, with the descriptions and the constraints of its inputSchema in the help of the command. The result is text, with tables of the lists of objects, or JSON:

uv run python examples/mcp_cli.py --help
uv run python examples/mcp_cli.py forecast --place Kraków --language pl --days 2
uv run python examples/mcp_cli.py hourly-forecast -p Warsaw -H 6 -f json

It is made with Pyjo.MCP.Client, a client of MCP over Streamable HTTP, which sends the _meta and the headers that every request carries:

from Pyjo.MCP.Client import Client

client = Client('http://127.0.0.1:3000/mcp')
print(client.call_tool('divide', {'a': 7, 'b': 2})['structuredContent'])

Pyjo.MCP.Test tests a server with the requests of the client, without starting it:

import Pyjo.MCP.Test

from Pyjo.File import curfile
from Pyjo.Test import *

t = Pyjo.MCP.Test.new(curfile().sibling('calculator.py'))
t.call_ok('divide', a=7, b=2).status_is(200).structured_content_is(3.5)
t.call_ok('divide', a=1, b=0).is_error_is(True).text_content_is('Division by zero')

done_testing()

Documentation

The tutorial, which makes servers of MCP step by step, and the API of the package are on Read the Docs.

Status

A server of the tools, the prompts and the resources of MCP over Streamable HTTP and stdio, with server/discover, tools/list, tools/call, prompts/list, prompts/get, resources/list, resources/templates/list, resources/read, subscriptions/listen and completion/complete, a client of them over Streamable HTTP, and assertions of tests with its requests. A tool sends its progress and its log messages before its result, and a subscription gets the changes of the lists and of the resources. A resource template is a URI Template of RFC 6570, whose URIs a client reads. A tool, a prompt and a resource ask the user, the language model or the roots of the client for input, in the rounds of a multi round-trip request, and the arguments of the prompts and the variables of the templates complete their values.

License

The Artistic License 2.0, as Pyjoyment.

Metadata

Release files for Pyjo-MCP 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for Pyjo-MCP 0.2.0
File Size Uploaded Provenance Actions
pyjo_mcp-0.2.0.tar.gz 108.7 kB With provenance Details for pyjo_mcp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Pyjo-MCP 0.2.0
File Interpreter ABI Platform Actions
pyjo_mcp-0.2.0-py3-none-any.whl Python 3 none any Details for pyjo_mcp-0.2.0-py3-none-any.whl

Total release size: 159.3 kB

Release files / pyjo_mcp-0.2.0.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL pyjo_mcp-0.2.0.tar.gz
Size 108.7 kB
Tags Source
SHA-256 checksum
How to use checksums
82625a82844a3639a733d418f214422fc243ec24f921a60e7b3352274cc884b3
BLAKE2b-256 checksum
How to use checksums
dd65613462367bc29322009882b0c0a833a9adff566d2c3f0ca77fff8d5649fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / pyjo_mcp-0.2.0-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL pyjo_mcp-0.2.0-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f8979e8eb7ec6703fea4c892ea6aa42c02ad35a18164957c9ae24fc61370dc4
BLAKE2b-256 checksum
How to use checksums
6f733257add3612eca7885bfdd4e907ad7f2589c8241f1dcb1ad2e429791f690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for Pyjo-MCP 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Change of provenance

The repository and configuration that created this release differ from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for pyjo_mcp-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page