Metadata-Version: 2.4
Name: afs-server
Version: 1.0.0
Summary: agentic-fs server: stores, services, REST + MCP. Implements the afs-core contracts.
Project-URL: Homepage, https://github.com/vivekkhimani/agentic-fs
Project-URL: Repository, https://github.com/vivekkhimani/agentic-fs
Project-URL: Issues, https://github.com/vivekkhimani/agentic-fs/issues
Author-email: Vivek Khimani <vivekkhimani07@gmail.com>
License-Expression: Apache-2.0
Keywords: agentic-fs,agents,dynamodb,fastapi,filesystem,mcp,s3
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: afs-core>=1.0.0
Requires-Dist: boto3>=1.34
Requires-Dist: click>=8
Requires-Dist: fastapi>=0.115
Requires-Dist: fastmcp>=2
Requires-Dist: pydantic-settings>=2.2
Requires-Dist: pyjwt>=2
Requires-Dist: pypdfium2>=4
Requires-Dist: python-docx>=1
Requires-Dist: structlog>=24
Requires-Dist: uvicorn[standard]>=0.30
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40; extra == 'anthropic'
Requires-Dist: pillow>=10; extra == 'anthropic'
Provides-Extra: docling
Requires-Dist: docling>=2; extra == 'docling'
Requires-Dist: torch; extra == 'docling'
Requires-Dist: torchvision; extra == 'docling'
Provides-Extra: fsspec
Requires-Dist: fsspec>=2024.6; extra == 'fsspec'
Provides-Extra: haystack
Requires-Dist: haystack-ai>=2.10; extra == 'haystack'
Provides-Extra: openai
Requires-Dist: openai>=1.50; extra == 'openai'
Requires-Dist: pillow>=10; extra == 'openai'
Provides-Extra: pdftables
Requires-Dist: pdfplumber>=0.11; extra == 'pdftables'
Provides-Extra: postgres
Provides-Extra: rapidocr
Requires-Dist: pillow>=10; extra == 'rapidocr'
Requires-Dist: rapidocr-onnxruntime>=1.3; extra == 'rapidocr'
Provides-Extra: search
Provides-Extra: tesseract
Requires-Dist: pillow>=10; extra == 'tesseract'
Requires-Dist: pytesseract>=0.3; extra == 'tesseract'
Provides-Extra: textract
Requires-Dist: pillow>=10; extra == 'textract'
Description-Content-Type: text/markdown

# afs-server

The agentic-fs service: the concrete backends (stores, search, extraction), the
services, and the REST + MCP surface. Implements the `afs-core` contracts.

## Status

Store layer (in progress):

- `afs_server.settings` — `AFS_*` env config; every swappable layer is selected
  by a backend *name* and every AWS-shaped backend takes an `endpoint_url`
  override.
- `afs_server.stores` — the **store registry**: `get_object_store(settings)`
  selects a builtin or an installed plugin (`afs.object_stores` entry-point group).
- `afs_server.stores.objects_s3.S3ObjectStore` — the S3 `ObjectStore`. Because it
  speaks plain S3, it *is* your store for any S3-compatible endpoint (MinIO,
  Cloudflare R2, Wasabi, Backblaze B2) via `AFS_S3_ENDPOINT_URL` — no code change.
- `afs_server.stores.catalog_dynamodb.DynamoDBCatalogStore` — the DynamoDB
  `CatalogStore` over the single-table schema (`AFS_DYNAMODB_ENDPOINT_URL` points
  at DynamoDB Local for dev).

Both stores are certified by the afs-core conformance kits via `moto`.

- `afs_server.services.FsService` — the read path (`list` / `stat` / ranged
  `read`) over the stores, with scope + namespace enforcement and 404-not-403
  misses.
- `afs_server.app` — the FastAPI app: `/v1/healthz`, `/readyz`, `/me`, and
  `fs/{ns}/{entries,stat,doc}`; dev auth (static principal, never prod); every
  `AfsError` rendered as RFC 9457 `problem+json`.
- `afs_server.mcp` — the MCP surface mounted at `/mcp` (FastMCP): `whoami`,
  `fs_list`, `fs_stat`, `fs_read` over the *same* `FsService` (in-process, no HTTP
  self-calls). The full middleware chain + remaining tools land with their slices.

The image (`../../Dockerfile`) runs this app on Lambda / Fargate / locally;
`make dev` from the repo root runs it against MinIO + DynamoDB Local. Coming
next: the MCP mount (shares `FsService` in-process).

## Swapping a backend (plug-and-play)

See [`docs/swap-guides/`](../../docs/swap-guides/). In short: S3-compatible
storage needs only an env var; anything else implements the `ObjectStore`
Protocol, registers an entry point, and certifies against
`afs_core.testing.ObjectStoreConformance`.

## Develop

```bash
uv sync
uv run pytest packages/afs-server     # conformance kits run against moto
```
