Skip to main content

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/dex4er/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.1.0

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

Source distribution (sdist)

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

Built distribution (wheel)

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

Total release size: 159.4 kB

Release files / pyjo_mcp-0.1.0.tar.gz

Download URL pyjo_mcp-0.1.0.tar.gz
Size 108.6 kB
Tags Source
SHA-256 checksum
How to use checksums
75abb26a3710fb91638cad991aae83e25cc9ca4c751c05026cb617f88b6047f8
BLAKE2b-256 checksum
How to use checksums
4efb70d0381ab1f8822ca93a684d623aae7d1d9c1e5e448678cc7e865e0b0a6d
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 1, 2026.

Transparency log

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

Download URL pyjo_mcp-0.1.0-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a4e8d042d239a9c16c66445534abd0e928018b83e37df69dc374fa88b421942
BLAKE2b-256 checksum
How to use checksums
98192d6fe3d140997e13ac838285b0efe685a0f16e5c20dd777ef936877143c3
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 1, 2026.

Transparency log

Security for Pyjo-MCP 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyjo_mcp-0.1.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 1, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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