Metadata-Version: 2.5
Name: weftai-mcp
Version: 0.5.2
Summary: Serve a weftai runtime over the Model Context Protocol.
Project-URL: Homepage, https://github.com/tochi-mba/weftai
Project-URL: Documentation, https://github.com/tochi-mba/weftai/tree/main/docs
Author: Rex Technologies
License-Expression: MIT
License-File: LICENSE
Keywords: ai,llm,mcp,model-context-protocol,tools,weftai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: mcp<3,>=2.2
Requires-Dist: weftai==0.5.2
Description-Content-Type: text/markdown

# weftai-mcp

Serve a [weftai](https://pypi.org/project/weftai/) runtime over the Model Context Protocol, so
any MCP client can plan against your operations.

```sh
pip install weftai-mcp
```

```python
from weftai.mcp import create_mcp_server

mcp = create_mcp_server(runtime, {"name": "tickets", "ctx": ctx})
await mcp.connect_stdio()
```

The server offers three tools:

| Tool | Does |
| --- | --- |
| `run_plan` | Executes a plan, returns the model-facing text, and keeps the results in the session |
| `describe_operations` | Describes every operation the model may use, and the `$ref` syntax |
| `get_result` | Reads a stored result by reference: `$open`, or `$open[2]` for one item |

## Options

| Option | Meaning |
| --- | --- |
| `name` | The server name a client sees |
| `ctx` | The context handlers receive: a value, or a function of no arguments that returns one (sync or async) |
| `include` | Which operations to offer, as a predicate over each operation |
| `allowWrites` | `False` refuses operations with `write` effects; they may run otherwise |
| `session` | The session results are stored under, `{"id": ...}`; `default` when omitted |
| `version` | The server version a client sees |

`connect_stdio()` serves over standard input and output until the client goes away. The
[`weftai-cli`](https://pypi.org/project/weftai-cli/) package wraps this as
`weftai mcp --domain domain.py`.

## License

MIT
