Metadata-Version: 2.4
Name: djcrud-client
Version: 0.3.3
Summary: Stdio MCP bridge for djcrud JSON APIs (no Django required)
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp<2,>=1.0
Requires-Dist: httpx>=0.27

# djcrud-client

Stdio MCP bridge + reusable library for [djcrud](https://github.com/yourlabs/djcrud) JSON APIs.
No Django required — FastMCP and the HTTP client run in the agent / tool process.

Full documentation: the djcrud Sphinx docs (reference → djcrud_client).

## Install

```bash
pip install djcrud-client
# dev / prereleases:
pip install --pre djcrud-client
```

## CLI

```bash
export DJCRUD_BASE_URL=http://127.0.0.1:8000
export DJCRUD_TOKEN=...

djcrud-client -mcp
djcrud-client --call article_list --json '{}'
djcrud-client --call article_publish --json '{"pk": 1}'
```

See the full CLI + env var reference in the djcrud docs.

## Library usage (import djcrud_client)

```python
from djcrud_client import CrudApi, McpProfile
from djcrud_client.server import create_mcp_server
from djcrud_client.schema import build_tools_from_schema

# High level
mcp = create_mcp_server(base_url=..., token=...)
mcp.run(transport="stdio")

# Low level + direct API
api = CrudApi(base_url=..., token=...)
```

## Host setup (Django side only)

Declare `McpProfile` subclasses in your app's `djcrud.py` and register on `djcrud_mcp.site`
(see `djcrud_example/mcp_example/djcrud.py`).

Add `djcrud_mcp` + `djcrud_drf` to `INSTALLED_APPS` and include the DRF URLs.
Provide a bearer token when running the client.
