Skip to main content

liminal

liminal is an MCP gateway: one MCP connection per agent, many tool handlers behind it.

CI Release License Status

liminal lists its handlers, serves them on one endpoint, and answers a tool call

Overview

From Latin limen, "threshold." liminal is the boundary an agent crosses to reach its tools: memory, web fetch, file I/O, notifications, and persona-specific backends. Instead of every agent running N MCP server processes, agents connect to one liminal and liminal dispatches.

  • One MCP connection per agent, not N.
  • Credentials per persona. liminal fetches the credential set for (persona, handler) when a call is dispatched. No .env files on disk.
  • The operator's config is the ceiling. A caller's token can narrow allowed paths, hosts and webhooks; it cannot widen them.
  • One handler interface. In-process Python handlers and upstream MCP servers (liminal serve --targets) sit behind the same endpoint.
  • Every call is audited. Each tools/call that reaches a handler logs one line.

liminal is the tool gateway in the tenish family of open-source platform and agent projects, and runs without any of the others: with auth off it needs no issuer, and any issuer can stand in for cabal if it signs RS256 tokens carrying iss, aud, exp, iat, sub, a persona (or cabal_persona) claim and, in single-cabal mode, a scope array containing dispatch. techne backs the memory handler, cabal mints the tokens liminal verifies and serves per-persona secrets, daedalus agents use liminal as their tool provider, kobo writes agents' grants and reads the call audit, and gojira deploys it.

New here, or asking an agent what this is? Run liminal guide welcome: it ships in the package and covers every mode, handler and extra with why you'd pick it.

Quickstart

You need git and Python 3.12 or newer (on Debian and Ubuntu, python3-venv too).

git clone https://github.com/tenishai/liminal.git && cd liminal
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
liminal list-handlers

Serve the handlers on one endpoint, auth off, for a single operator on localhost:

LIMINAL_AUTH_DISABLED=1 liminal serve --host 127.0.0.1 --port 9100

Then point a client at it, for example Claude Code:

claude mcp add --transport http liminal http://127.0.0.1:9100/mcp

scratchpad and web work straight away. notify needs LIMINAL_NOTIFY_WEBHOOK_URL, files refuses every call until you grant it paths, and memory needs techne and LIMINAL_MEMORY_DB; curl http://127.0.0.1:9100/healthz flags all three as unconfigured until they have it. docs/running.md covers those grants, JWT auth for production and deploying through gojira; docs/install.md covers the memory extra and the image.

How it works

The endpoint speaks JSON-RPC at POST /mcp (initialize, tools/list, tools/call). Handlers are discovered from installed packages through the liminal.handlers entry point, and each tool is named <handler>.<tool>. In production liminal verifies the caller's RS256 JWT: against one cabal's keys (--jwks-url), or, in sovereign mode (--trust-registry with --policy-db), against several issuers with access coming from a server-side grant per (issuer, persona).

src/liminal/
  protocol/        Handler Protocol, Context, ToolSpec, ToolResult, CapabilityCard
  registry/        Entry-point discovery + handler registration
  dispatch/        Multiplexer (handlers + federated targets), in-process dispatcher
  server/          MCP HTTP server (POST /mcp), JWT verifiers, credential resolver,
                   policy store, admin surface, secret guard
  target/          Federated targets — the machinery behind `--targets`
  handlers/        scratchpad, files, web, memory, notify, aws, cabal
  client/          LiminalClient protocol, LibraryLiminalClient (in-process),
                   ProxyLiminalClient (HTTP, wraps AsyncMCPClient), from_config,
                   MCPClient (sync) + AsyncMCPClient (async)
  docs/            The guides `liminal guide` prints (welcome.md), shipped in the wheel
  wire.py          Wire-format helpers shared by the server and the library client
scripts/           check-techne-sibling.sh (sibling techne matches the pinned tag),
                   check_arch_cards.py (cards match the files they anchor)
tests/             pytest suite
docs/
  design.md        The ORIGINAL proposal. The implementation has diverged —
                   read what-works.md for what shipped.
  writing-a-handler.md  What a handler author needs beyond the sketch below
  arch/            Architecture cards, one per seam (indexed in ARCHITECTURE.md)
  proposals/       Design notes, not documentation of current behaviour

Wiring a handler

from liminal.protocol import Context, Handler, ToolResult, ToolSpec

# No base class: `Handler` is a typing.Protocol, so conforming is structural.
# None of the shipped handlers subclass it; the import is for the return type.
class GreetHandler:
    def tools(self) -> list[ToolSpec]: ...
    def capability_card(self) -> dict: ...
    async def dispatch(self, name: str, payload: dict, ctx: Context) -> ToolResult:
        return ToolResult.text(f"Hello, {payload['name']}!")

def get_handler() -> Handler:
    return GreetHandler()

Register via pyproject.toml:

[project.entry-points."liminal.handlers"]
greet = "mypackage.greet:get_handler"

That's the mechanism. Before you write a real handler, read docs/writing-a-handler.md — the things (ctx.extra's security contract, the optional startup/shutdown/status hooks, silent discovery failure, a scope-gating footgun, the testing convention) that this sketch doesn't cover and that you'd otherwise have to find in source.

Using the MCP client

from liminal.client import AsyncMCPClient

async with AsyncMCPClient(
    base_url="http://127.0.0.1:9100",   # wherever `liminal serve` is listening
    token_provider=lambda: my_token(),
) as client:
    tools = await client.list_tools()
    result = await client.call_tool("scratchpad.set", {"key": "color", "value": "blue"})

Status

Pre-alpha. Seven built-in handlers ship (scratchpad, files, web, memory, notify, aws, cabal; docs/design.md plans more, such as slack and github, and none exist). The call audit, JWT auth in single-cabal and sovereign modes, revocation, the credential flow, federated targets and the sync and async client library all work. Network, DNS, file and SQLite work is awaited or run in a worker thread, and the gateway is SSRF-hardened. docs/what-works.md has each of these in detail. Run pytest -q for the current suite (1053 passed, 2 skipped on 2026-11-23 at 3e3ac92, Python 3.12, pip install -e ".[dev]", techne not installed: the memory-handler module skips).

Not yet: the distribution (tenish-liminal) is not on PyPI, so installs come from a clone or a git tag; notify has a generic webhook transport (it POSTs a fixed JSON body) and a stdout one behind LIMINAL_NOTIFY_STDOUT=1; there are no Slack, Discord or email transports.

Documentation

Contributing

Issues and pull requests are welcome. CONTRIBUTING.md has the setup, the checks CI runs and the sign-off every commit needs; the Code of Conduct applies to everyone taking part.

How this was built

tenishai is a small team of engineers who build with AI coding agents. Most of this code was written in pairing sessions with Claude models in Claude Code: a person set the design, directed the work and reviewed what landed, and the agent wrote much of the code and docs. Many commits name the agent in a Co-Authored-By: trailer, either a Claude model or the name of the agent one of us pairs with. A commit without a trailer may still have had AI help.

License

Copyright (c) 2026 tenish and the liminal contributors

MIT. See LICENSE.

Metadata

Release files for tenish-liminal 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tenish-liminal 0.12.0
File Size Uploaded Provenance Actions
tenish_liminal-0.12.0.tar.gz 309.9 kB Without provenance Details for tenish_liminal-0.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tenish-liminal 0.12.0
File Interpreter ABI Platform Actions
tenish_liminal-0.12.0-py3-none-any.whl Python 3 none any Details for tenish_liminal-0.12.0-py3-none-any.whl

Total release size: 492.1 kB

Release files / tenish_liminal-0.12.0.tar.gz

Download URL tenish_liminal-0.12.0.tar.gz
Size 309.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5085a791e7bd87349d743688642ecc07dca946ae01d77dca3aaf4ee9950be665
BLAKE2b-256 checksum
How to use checksums
f220a26ea9a07cc2cb80f897ed9609fdd402bfe709f8c3facf6e3fdc1c097069
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / tenish_liminal-0.12.0-py3-none-any.whl

Download URL tenish_liminal-0.12.0-py3-none-any.whl
Size 182.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
537dee06b3d1384b05a1b3e8111c341028cb1d4247f5aaf8f4c140f2c296fdbc
BLAKE2b-256 checksum
How to use checksums
ecdf434c4b9c5a3b3ae530bc238aeec277ac8ff9a0674de23619e19c2ca41069
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for tenish-liminal 0.12.0

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.

Release history Release notifications | RSS feed

This release

0.12.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page