Skip to main content

Automatation for the Model Context Protocol (MCP).

Project description

Jotsu MCP

General-purpose library for implementing the Model Context Protocol (MCP) and creating workflows that use MCP tools, resources and prompts.

Quickstart

Install the package, including the CLI.

pip install jotsu-mcp[cli]

Create an empty workflow.

jotsu-mcp workflow init

The initialization command creates a workflow file 'workflow.json' in the current directory.

Run it:

jotsu-mcp workflow run ./workflow.json

The output is only the start and end messages since the workflow doesn't have any nodes.

Hello MCP

The workflow can call a tool from an MCP server. This allows you to use MCP with models that don't yet support it (really any model other than Claude).

Add the following server entry:

{
    "id": "hello",
    "name": "Hello World",
    "url": "https://hello.mcp.jotsu.com/mcp/"
}

NOTE: don't forget the path /mcp/ on the URL.

This server is a publicly available MCP server (with no authentication) that has a couple of resources and a tool. (The code is available here).

Next add a node for a server tool.

[
    {"id":  "greet", "type":  "tool", "name": "greet", "server_id":  "hello"}
]

Add some initial data that the 'greet' tool needs:

{"name": "World"}

and tell the workflow where to start:

"start_node_id": "greet"

Finally, add a 'generic' node at the end. Generic nodes are application-specific - meaning the workflow only handles them by yielding the data - and are generally used for output and/or debugging.
The type can be any string not already used by the workflow. In this case, 'output'.

Full Workflow
{
    "id": "quickstart",
    "name": "quickstart",
    "description": "Simple workflow to interact with the 'hello' MCP server",
    "event": {
        "name": "Manual",
        "type": "manual",
        "metadata": null
    },
    "start_node_id": "greet",
    "nodes": [
        {"id":  "greet", "type":  "tool", "name": "greet", "server_id":  "hello", "edges":  ["output"]},
        {"id":  "output", "type":  "output", "name": "The result"}
    ],
    "servers": [
        {
            "id": "hello",
            "name": "Hello World",
            "url": "https://hello.mcp.jotsu.com/mcp/"
        }
    ],
    "data": {"name":  "World"},
    "metadata": null
}

Running this workflow again generates a lot more data, but specifically there is a line similar to:

{
  "action": "default",
  "timestamp": 132462.392532502,
  "id": "01k3h80zcaz050eg7080r3fnv7",
  "run_id": "01k3h80t6psmg0s5swsg4yke95",
  "node": {
    "id": "output",
    "name": "The result",
    "type": "output"
  },
  "data": {
    "name": "World",
    "greet": "Hello, World!"
  }
}

The data from this node acts as the 'result' of the workflow. Since workflows can have many branches there is one 'result', instead there could be many such lines depending upon the actions the workflow took.

Development

uv venv
uv pip install '.[dev,cli,anthropic,openai,cloudflare,cryptography]'

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

jotsu_mcp-0.16.0.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

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

jotsu_mcp-0.16.0-py3-none-any.whl (51.6 kB view details)

Uploaded Python 3

File details

Details for the file jotsu_mcp-0.16.0.tar.gz.

File metadata

  • Download URL: jotsu_mcp-0.16.0.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for jotsu_mcp-0.16.0.tar.gz
Algorithm Hash digest
SHA256 d727d65a03eccbaa39054acdd91c57376ad3879bdba6a1e235c816ae6b6a0d2d
MD5 fdb0b73c9d6fcf4fdc53109cbbc288e9
BLAKE2b-256 b568d44ae73e72f271bc0b2ddf3842a19fb33dfb1b8ce917b67c6f3d320fdf64

See more details on using hashes here.

File details

Details for the file jotsu_mcp-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: jotsu_mcp-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 51.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for jotsu_mcp-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d33ac7fc82806aa2323bb0a3af69a0be411eae90f3fe3eee22d7678f763dd2f
MD5 a5f76a8cd0f1a16c02126af5f950d48e
BLAKE2b-256 1b23465fdb72b4d308b7118416b330bfc40924f3e233513db5bfcd4431045b5d

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