Metadata-Version: 2.4
Name: jotsu-mcp
Version: 0.7.0
Summary: Automatation for the Model Context Protocol (MCP).
License-Expression: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jsonata-python>=0.5.3
Requires-Dist: jsonschema>=4.25.0
Requires-Dist: mcp>=1.9.1
Requires-Dist: pkce>=1.0.3
Requires-Dist: pydantic>=2.6.1
Requires-Dist: pyjwt>=2.10.1
Requires-Dist: asteval>=1.0.6
Provides-Extra: cli
Requires-Dist: click>=8.2.1; extra == "cli"
Requires-Dist: aiofiles==24.1.0; extra == "cli"
Requires-Dist: pkce>=1.0.3; extra == "cli"
Requires-Dist: python-ulid>=3.0.0; extra == "cli"
Requires-Dist: python-dotenv>=1.1.0; extra == "cli"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.57.1; extra == "anthropic"
Requires-Dist: pybars3>=0.9.7; extra == "anthropic"
Provides-Extra: dev
Requires-Dist: flake8>=7.2.0; extra == "dev"
Requires-Dist: flake8-quotes>=3.4.0; extra == "dev"
Requires-Dist: pytest>=8.3.5; extra == "dev"
Requires-Dist: pytest-asyncio>=1.0.0; extra == "dev"
Requires-Dist: pytest-cov>=6.1.1; extra == "dev"
Requires-Dist: pytest-mock>=3.14.1; extra == "dev"
Requires-Dist: setuptools>=80.9.0; extra == "dev"
Requires-Dist: pydantic-to-typescript>=2.0.0; extra == "dev"
Dynamic: license-file

# 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.
```shell
pip install jotsu-mcp[cli]
```

Create an empty workflow.
```shell
jotsu-mcp workflow init
```

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

Run it:
```shell
jotsu-mcp workflow run ./workflow.json
```

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

Add the following server entry:
```json
{
    "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](https://github.com/getjotsu/mcp-servers/tree/main/hello)).

Next add nodes for the server resources.

```json
[
    {"id":  "get_greeting", "type": "resource", "name": "resource://greeting", "server_id":  "hello", "edges": ["get_config"]},
    {"id":  "get_config", "type": "resource", "name": "data://config", "server_id":  "hello", "edges": ["greet"]},
    {"id":  "greet", "type":  "tool", "name": "greet", "server_id":  "hello"}
]
```

Finally, add some initial data that the 'greet' tool needs.
```json
{"name": "World"}
```

<details>
<summary>Full Workflow</summary>

```json
{
    "id": "quickstart",
    "name": "quickstart",
    "description": "Simple workflow to interact with the 'hello' MCP server",
    "event": {
        "name": "Manual",
        "type": "manual",
        "metadata": null
    },
    "nodes": [
        {"id":  "get_greeting", "type": "resource", "name": "resource://greeting", "server_id":  "hello", "edges": ["get_config"]},
        {"id":  "get_config", "type": "resource", "name": "data://config", "server_id":  "hello", "edges": ["greet"]},
        {"id":  "greet", "type":  "tool", "name": "greet", "server_id":  "hello"}
    ],
    "servers": [
        {
            "id": "hello",
            "name": "Hello World",
            "url": "https://hello.mcp.jotsu.com/mcp/"
        }
    ],
    "data": {"name":  "World"},
    "metadata": null
}
```

</details>

Running it again generates:


## Development

```shell
uv venv
uv pip install .[dev,cli,anthropic]
```
