---
title: "The Gateway"
description: "One action over REST and MCP. Where each action answers, how to download the OpenAPI document, how to connect an AI tool, and what each call costs and records."
url: "https://harnesty.com/en/docs/gateway"
language: "en"
kind: "docs"
updated: "2026-12-05"
summary:
  - "REST and MCP reach the same actions, with the same checks, the same cost and the same audit entry."
  - "The MCP endpoint is `/api/mcp` on your Workspace host."
  - "The OpenAPI document is `/openapi.json` on your Workspace host."
  - "A new client holds no write Mandate until a human approves an action. An approval is always Free."
sources:
  - title: "Governance"
    url: "https://harnesty.com/en/docs/governance-core"
  - title: "Workspace REST and MCP reference"
    url: "https://harnesty.com/en/docs/workspace-reference"
  - title: "Model Context Protocol specification 2025-06-18: Authorization"
    url: "https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization"
    read: "2026-11-25"
  - title: "RFC 9728: OAuth 2.0 Protected Resource Metadata"
    url: "https://www.rfc-editor.org/rfc/rfc9728"
    read: "2026-11-25"
---

# The Gateway

Everything you can do in your Workspace is an action. Your own code calls an action over REST, and an AI tool calls the same action over MCP. Both reach one dispatcher, so each call is checked against the same Mandates, metered the same way and written to the same workspace audit log.

## In short

- REST and MCP reach the same actions, with the same checks, the same cost and the same audit entry.
- The MCP endpoint is `/api/mcp` on your Workspace host.
- The OpenAPI document is `/openapi.json` on your Workspace host.
- A new client holds no write Mandate until a human approves an action. An approval is always Free.

## One action, two surfaces

An action you find on one surface is on the other, with the same area and verb, the same input and the same output.

| Surface | Use it from | Path on your Workspace host |
|---|---|---|
| REST | Your own code and scripts | `/api/v<N>/<area>/<verb>` |
| MCP | An AI tool that speaks MCP | `/api/mcp` |

A connected integration’s operation usually has two addresses: its typed path and MCP tool, and the generic invoke call that names the operation. Both reach one action, with the same check, cost and audit entry.

## Where each action answers

Each action declares where it answers, its Exposure. Most actions answer on your Workspace host. A few, such as sign-in, also answer on the platform’s own domain.

| Exposure | Host | Its reference |
|---|---|---|
| Workspace | Your Workspace host or your custom domain | [Workspace REST and MCP reference](https://harnesty.com/en/docs/workspace-reference) |
| Platform | The platform’s own domain and its sign-in host | [General REST and MCP reference](https://harnesty.com/en/docs/api-reference) |

An Exposure says where an action answers and grants nothing. A call on any host is authorized the same way.

## Download the reference files

Your Workspace serves its OpenAPI document. Download it to generate a typed client, or to load the API into a tool that reads OpenAPI:

```bash
curl -o openapi.json https://<workspace-host>/openapi.json \
  -H "Authorization: Bearer $HARNESTY_TOKEN"
```

The document lists only the operations your credential may call.

An MCP client needs no file. It reads the tool list from the endpoint when it connects, and the list holds only the tools that client may call.

## Find your endpoint

Open `Gateway` in the app and copy the URL:

```text
https://<workspace-host>/api/mcp
```

Every Workspace host serves it.

## Connect a client

Add the endpoint to any MCP-compatible client. The client reads the endpoint’s protected-resource metadata, obtains its own access token from Harnesty’s issuer and signs in as itself. No token is pasted into the client.

```json
{
  "mcpServers": {
    "harnesty": {
      "url": "https://meridian-studio.harnesty.com/api/mcp"
    }
  }
}
```

> **A new client holds no write Mandate**
>
> Each write waits for a human approval, which issues a Mandate. An action approved repeatedly can graduate to audited auto-approval, and one rejection demotes it.

## Every call is metered and logged

Every call writes to the workspace audit log, with the calling actor and the Mandate it acted under. A call through a Connection also records that Connection.

| Integration kind | Per call | What it is |
|---|---|---|
| Catalog | 2 cr | Served through our catalog bridge, the default |
| Native (Preview) | 1 cr | A first-party connector we run ourselves |
| Custom | 1 cr | Your own MCP server or endpoint |

A search, scraping, enrichment or compute-backed tool may publish a price above its kind; the gallery shows every integration’s price before you connect it.

Human approvals of gateway calls are always Free. Issuing or revoking a Mandate costs nothing either.

## Sources

1. [Governance](https://harnesty.com/en/docs/governance-core)
1. [Workspace REST and MCP reference](https://harnesty.com/en/docs/workspace-reference)
1. [Model Context Protocol specification 2025-06-18: Authorization](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization), read 2026-11-25
1. [RFC 9728: OAuth 2.0 Protected Resource Metadata](https://www.rfc-editor.org/rfc/rfc9728), read 2026-11-25
