# Demarche

> Vendor-neutral identity verification for AI agents

- **Type:** MCP server
- **Install:** `agentstack add mcp-deeplethe-demarche`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [deeplethe](https://agentstack.voostack.com/s/deeplethe)
- **Installs:** 0
- **Category:** [Security](https://agentstack.voostack.com/c/security)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [deeplethe](https://github.com/deeplethe)
- **Source:** https://github.com/deeplethe/demarche
- **Website:** https://demarche.ai

## Install

```sh
agentstack add mcp-deeplethe-demarche
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Demarche

[](https://github.com/deeplethe/demarche/actions/workflows/ci.yml)
[](https://pypi.org/project/demarche/)
[](https://www.npmjs.com/package/@deeplethe/demarche)
[](LICENSE)

**Vendor-neutral identity verification for AI agents.**

Demarche sits between your application and the growing ecosystem of
agent-identity issuers — Microsoft Entra Agent ID, Auth0 for AI Agents,
WorkOS, OpenAgents, any OAuth On-Behalf-Of issuer. Integrate once,
verify agents from any issuer, with no vendor lock-in.

> An agent acts in your *démarche*: a formal action taken on your behalf,
> with verifiable authority. Demarche makes that verification a one-line
> integration.

```python
from typing import Annotated
from fastapi import Depends, FastAPI

from demarche import Verifier, VerificationResult, entra_agent_id
from demarche.fastapi import DemarcheAuth

verifier = Verifier(adapters=[
    entra_agent_id(tenant_id="", audience="api://your-app"),
])
auth = DemarcheAuth(verifier)
app = FastAPI()

@app.get("/whoami")
async def whoami(
    agent: Annotated[VerificationResult, Depends(auth.require_agent)],
):
    return {
        "user":   agent.principal_id,   # who delegated authority
        "agent":  agent.agent_id,        # which agent is acting
        "scopes": list(agent.scopes),
    }
```

## Status

**Pre-alpha — v0.0.0 published on PyPI and npm as of 2026-05-18.**
Public API will likely change before the v0.1.0 cut; pin exact
versions if you adopt early. **83 tests passing, ruff clean, mypy
strict clean.** Architecture contract in
[`spec/v0.1-architecture.md`](spec/v0.1-architecture.md).

## Why Demarche

In 2026 the agent-identity ecosystem has fragmented — Microsoft, Auth0,
WorkOS, Google A2A, OpenAgents, IETF OAuth OBO drafts, W3C VC — and a
scan of ~2,000 public MCP servers found **all of them lacked
authentication**. The protocols exist; integrating N issuers requires
N SDKs with N shapes. **Demarche pays that cost once on behalf of
integrators.**

We are to agent identity what Plaid is to bank connections: a neutral
normalisation layer over a fragmented ecosystem.

## Supported issuers (v0.1)

| Issuer | Module / factory |
|---|---|
| **OAuth OBO** (any standards-conformant issuer) | `OAuthOBOAdapter` |
| **Microsoft Entra ID / Entra Agent ID** | `entra_agent_id(tenant_id=..., audience=...)` |
| **Auth0 / Auth0 for AI Agents** | `auth0_ai_agents(domain=..., audience=...)` |

Planned for v0.2+: Google A2A (post-v0.9 signed-Agent-Card freeze),
WorkOS, OpenAgents, W3C VC. Track in [issues](https://github.com/deeplethe/demarche/issues).

## Install

```bash
pip install demarche                       # core + OAuth OBO + Entra/Auth0
pip install 'demarche[fastapi]'            # + FastAPI integration

npm install @deeplethe/demarche            # TypeScript (placeholder; parity in v0.2)
```

The npm package is scoped as `@deeplethe/demarche` because npm's
typosquat-similarity policy rejected the unscoped `demarche` name (too
close to an existing `decache` package). The Python package on PyPI is
the unscoped `demarche`.

## Quickstart — generic OAuth OBO

```python
from demarche import Verifier, OAuthOBOAdapter, JWKSKeyProvider

verifier = Verifier(adapters=[
    OAuthOBOAdapter(
        issuer="https://your-issuer.example/",
        audience="https://your-api.example",
        key_provider=JWKSKeyProvider(
            "https://your-issuer.example/.well-known/jwks.json"
        ),
    ),
])

result = await verifier.verify(token)
result.principal_id  # the user who delegated authority
result.agent_id      # the agent acting on the user's behalf
result.scopes        # what the agent is authorized to do
result.audit_id      # opaque ID for log correlation
```

## FastAPI integration

A complete worked example lives in
[`examples/fastapi-app/`](examples/fastapi-app/) — runnable smoke test
included.

```python
from demarche.fastapi import DemarcheAuth

auth = DemarcheAuth(verifier)

@app.post("/book-meeting")
async def book_meeting(
    agent: Annotated[
        VerificationResult,
        Depends(auth.require_scope("calendar.write")),
    ],
):
    return {"booked_by": agent.principal_id, "via_agent": agent.agent_id}
```

Built-in HTTP error mapping:

| Failure | Status |
|---|---|
| Missing / malformed `Authorization` header | **401** |
| Token issuer not recognised | **401** |
| Bad signature / expired / malformed token | **403** |
| Missing required scope | **403** |

Authentication is checked before scope — unauthenticated requests never
leak whether a given scope exists.

## What Demarche is *not*

- **Not an issuer.** Demarche does not mint credentials. It validates
  credentials issued by Entra, Auth0, OpenAgents, etc.
- **Not an agent framework.** Bring your own runtime.
- **Not a governance platform.** Audit-log persistence and compliance
  evidence bundles are out of scope for v0.x (planned for v0.5+).

## Roadmap

| Version | Scope |
|---|---|
| **v0.1** | Core verifier + OAuth OBO + Entra/Auth0 profiles + FastAPI integration |
| v0.2 | TypeScript SDK at parity; WorkOS profile |
| v0.3 | A2A Agent Card adapter (post-spec freeze); Express middleware |
| v0.5 | Optional hosted audit-log service; W3C VC adapter |
| v1.0 | Third-party security audit |

## Threat model

See [`spec/v0.1-architecture.md` §5](spec/v0.1-architecture.md#5-threat-model-v01).
Highlights: confused-deputy mitigation via separated `principal_id` and
`agent_id`; downgrade-attack mitigation via strict first-match adapter
resolution; key-rotation handling via `JWKSKeyProvider` with refresh
rate-limiting.

## Packages

| Package | Language | Registry | Status |
|---|---|---|---|
| `demarche` | Python ≥3.10 | PyPI | Pre-alpha |
| `@deeplethe/demarche` | TypeScript ≥20 | npm | Placeholder (parity in v0.2) |

## License

Apache 2.0. See [LICENSE](LICENSE).

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [deeplethe](https://github.com/deeplethe)
- **Source:** [deeplethe/demarche](https://github.com/deeplethe/demarche)
- **License:** Apache-2.0
- **Homepage:** https://demarche.ai

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-deeplethe-demarche
- Seller: https://agentstack.voostack.com/s/deeplethe
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
