agentfront
Agent First Interface — an importable runtime for tools whose primary consumer is an AI agent, not a human.
Formerly
teken(andafi-clibefore that). The project was renamed to agentfront — the agent-facing front a tool presents. Thetekenpackage and thetekencommand still work as deprecated aliases — see Install.
You import agentfront, build one App, and declare your docs and tools once. From that single registry, agentfront derives three interface surfaces, each shaped by a different agent-ergonomic principle:
- CLI — with a
learnaffordance so an agent can introspect the tool and author its own usage skill (not just read--help). - MCP server — a deliberately minimal menu, tuned for low surface area over maximal API coverage.
- HTTP site — markdown pages plus a sitemap, navigable by any agent with a fetch tool.
Because all three surfaces read from the same registry, they cannot drift apart. agentfront is a library you embed in your tool, not a code generator that scaffolds files. (Earlier alpha releases shipped a cli cite scaffolder and a manifest→three-surfaces generator; that approach has been retired in favour of the importable runtime.)
Part of the AgentCulture OSS org — see docs/agentculture.md for the org, its paradigm, and how agentfront is foundational to it. The design brief is in docs/agent-first.md; the concrete rubric that agentfront cli doctor enforces is in docs/rubric.md.
Install
uv tool install agentfront
Then agentfront --version should work on your PATH. uv tool install is the supported path — not pip install.
The CLI and HTTP surfaces are pure standard library and have no third-party dependency. The MCP surface is the one surface that needs the official mcp SDK, so it ships behind an optional extra — install it only when you want app.mcp_server():
uv tool install 'agentfront[mcp]' # CLI + HTTP + MCP
Calling app.mcp_server() without the extra installed raises a ModuleNotFoundError that names the extra to add.
uv tool install teken # still works: a thin wrapper that installs agentfront
The teken command is retained as a deprecated alias for agentfront (it prints a one-line notice to stderr and forwards). New usage should prefer agentfront.
Usage
agentfront is a library. In your tool, build an App, register docs and tools, then ask for whichever surface(s) you want to serve:
from agentfront import App
app = App(name="mytool", version="1.0")
app.add_docs_dir("docs/") # every *.md becomes a page on the HTTP site
@app.tool
def search(query: str) -> str:
"""Search the corpus.""" # docstring + signature feed the MCP tool schema
...
http_app = app.http_app() # WSGI app: markdown pages + /sitemap.xml
mcp = app.mcp_server() # MCP server exposing the registered tools
cli = app.cli() # argparse CLI with learn / doctor verbs
Docs and tools are declared once into a single registry; the three surfaces only read from it, so a tool you add is automatically present on every surface and they cannot disagree.
Audit a CLI against the rubric
agentfront also ships a CLI of its own (uv tool install agentfront) that introspects itself and audits other agent-first CLIs. Every command supports --json where it produces a listing or report, and respects the exit-code policy (0 success / 1 user error / 2 env error).
agentfront learn # structured self-teaching prompt for an agent
agentfront learn --json # same, as a JSON payload
agentfront explain cli doctor # markdown docs for any noun/verb path
agentfront explain agentfront # top-level map
agentfront cli doctor [path] # audit a CLI at <path> against the seven-bundle rubric
agentfront cli doctor . --json # full structured report
agentfront cli doctor . --strict # treat warnings as failures
agentfront cli overview [path] # read-only descriptive snapshot of a CLI
agentfront cli doctor is a hybrid auditor: static checks for repo structure (pyproject.toml, tests/) and black-box subprocess probes for behavior (learn, --json, error discipline, explain). Every failure includes a concrete remediation pointer. (agentfront cli verify remains as a deprecated alias for cli doctor.)
Testing your front
Every surface agentfront derives from your App is built from the same
registry, so they cannot disagree — and that claim isn't just asserted, it's
checked by a function you can call from your own test suite:
from agentfront.testing import assert_surfaces_agree
def test_surfaces_agree():
assert_surfaces_agree(app) # raises AssertionError naming the drift
agentfront.testing also ships run_cli (in-process CLI invocation),
call_mcp (the MCP run payload without a server), and TAUI helpers
(drive, assert_agent_human_parity, snapshot/resume) for testing the
agent- and human-driven cockpit. See docs/testing.md
for the full guide, with runnable examples for each.
To serve the MCP surface to remote agents, agentfront.mcp_http exposes it
over streamable HTTP — as an ASGI app, mounted into an aiohttp app, or
standalone — with an optional authenticator whose caller principal reaches
your handlers via agentfront.current_caller(). See
docs/remote-mcp.md.
Develop
uv sync # install + dev deps
uv run pytest -n auto -v # tests (includes the self-doctor acceptance gate)
uv run agentfront cli doctor . # same gate, interactive
uv run pre-commit install # enable lint hooks
The tests/test_self_doctor.py acceptance gate runs the rubric and self-doctor in-process against the repo root; any regression that breaks a bundle blocks the commit.
See CLAUDE.md for design intent and full command reference.
License
Apache License 2.0. © 2026 Ori Nachum / AgentCulture. See LICENSE.
Metadata
Release files for agentfront 0.21.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentfront-0.21.1.tar.gz | 567.4 kB | Without provenance | Details for agentfront-0.21.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentfront-0.21.1-py3-none-any.whl | Python 3 | none | any | Details for agentfront-0.21.1-py3-none-any.whl |
Total release size: 720.4 kB
Release files / agentfront-0.21.1.tar.gz
| Download URL | agentfront-0.21.1.tar.gz |
|---|---|
| Size | 567.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b2d40c41a02823b43d43764061d8a51fa6cf1adb984631ebb8f00ed8017cbf6
|
|
BLAKE2b-256 checksum How to use checksums |
f661b29738dd7add68338d31b8f3e73bc204dd340a8f45fdace0a64561f32731
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / agentfront-0.21.1-py3-none-any.whl
| Download URL | agentfront-0.21.1-py3-none-any.whl |
|---|---|
| Size | 153.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12b20281dc27c3c85e485ffd6dbfc5dfc82960946ec7cf59911678f7a9b51e4d
|
|
BLAKE2b-256 checksum How to use checksums |
eebdba2016d1c766044eae00a04a809da252dd41ecc6d4ac3ee9bdac5c91f4bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for agentfront 0.21.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.