mcp-agent

v0.2.0
@byliner/mcp-agent Checked 8 hours ago Published 4 months ago

MCP server letting an AI agent submit actions for multi-party human approval via Byliner.

MCP server that lets an agent submit actions for multi-party human approval. A thin adapter over the Byliner Engine API — it contains no business logic. See docs/mcp-servers.md for the design rationale shared by both servers. request_approval returns immediately with a pending id — it does not block waiting for a decision. Poll get_approval_status.

Summary extracted from the README.

@byliner/mcp-agent

MCP server that lets an agent submit actions for multi-party human approval.

A thin adapter over the Byliner Engine API — it contains no business logic. See docs/mcp-servers.md for the design rationale shared by both servers.

Tools

Tool Engine call
request_approval POST /v1/approval-requests (Idempotency-Key required)
get_approval_status GET /v1/approval-requests/{id}
cancel_approval POST /v1/approval-requests/{id}/cancel (Idempotency-Key required)

request_approval returns immediately with a pending id — it does not block waiting for a decision. Poll get_approval_status.

There is no approve, reject, or delegate tool, by design. An agent cannot decide its own request, and no agent can execute a human's decision. See docs/mcp-servers.md §1.

cancel_approval is not a decision — it withdraws a request this server's own credential initiated. The engine refuses it for anyone else's request (403 cancellation_not_permitted).

Environment variables

Var Required Default Purpose
BYLINER_API_KEY yes — Engine API key. Determines org, environment, and the principal this server acts as.
BYLINER_API_URL no http://localhost:4000 Engine API base URL.
BYLINER_ACTOR_ASSERTION no* — Actor-identity assertion (the driving human's IdP JWT) layered on the API-key call, naming which human this agent acts for. Sent as X-Byliner-Actor-Assertion. *Required when the API key is an MCP key.
BYLINER_DASHBOARD_URL no same as BYLINER_API_URL Where review_url points. The deployed demo serves the dashboard and API from one origin, so the default is right there; local development needs http://localhost:5173.
BYLINER_TIMEOUT_MS no 10000 Per-request timeout.

The seeded demo key is byl_demo_codegen_agent_key (printed by pnpm seed).

Identity comes from the credential, never from a tool call

The API key is this server's identity. The engine looks it up by hash and derives org, environment, and the acting principal from the match. Nothing here names an actor, and no tool argument can influence one — a per-call identity parameter would let the calling model assert who is requesting, which is the self-asserted-initiator hole the design explicitly forbids.

BYLINER_ACTOR_ASSERTION follows the same rule: read from the environment at startup, never accepted per call. With none configured, an agent-key call proceeds on API-key-only attribution — a legitimate machine-initiated case (a CI/CD gate, a scheduled job). An MCP-key call, by contrast, requires it: the engine verifies the assertion and records that human as a co-requester who cannot approve the request. This is not enforced client-side; the engine decides what it accepts.

This replaced a BYLINER_DEMO_ACTOR_ID variable that existed only because the engine used to read the actor from an unverified header.

Running

# From the repo root, with the engine running on :4000
pnpm --filter @byliner/api dev

# Then, in another shell:
BYLINER_API_KEY=byl_demo_codegen_agent_key pnpm --filter @byliner/mcp-agent start

Exercise the tools with the MCP Inspector:

cd apps/mcp-agent
BYLINER_API_KEY=byl_demo_codegen_agent_key pnpm inspect

Claude Desktop config

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "byliner-agent": {
      "command": "npx",
      "args": ["-y", "@byliner/mcp-agent"],
      "env": {
        "BYLINER_API_KEY": "byl_demo_codegen_agent_key",
        "BYLINER_API_URL": "http://localhost:4000"
      }
    }
  }
}

No checkout required — npx fetches the published package. To run against a local checkout instead, use ["tsx", "/absolute/path/to/apps/mcp-agent/src/server.ts"].

The transport is stdio, so the server logs to stderr only; anything written to stdout would corrupt the protocol stream.