# Lumen as an MCP server

> Let an AI app such as Claude or ChatGPT list your flows, start them and read their runs, as you, through Lumen's MCP endpoint.

Source: https://docs.go-lumen.ai/he/api/mcp-server

**In one sentence**: Lumen is an MCP server: an AI app you already use can list the flows you chose to share, start them and read their runs, acting as you inside one workspace.

MCP, the Model Context Protocol, is how AI apps use tools in other systems. This page is about the other direction from [Tools and MCP](https://docs.go-lumen.ai/he/ai/tools-and-mcp.md), where a Lumen agent uses someone else's MCP server. Here an AI app uses Lumen.

> **Availability:**
> 
> The endpoint is built into Lumen's API and is off until it is turned on for an installation. If the connection below is refused with a message that AI apps are off, ask whoever runs your Lumen installation.

## What an AI app can do

Three tools are available. Nothing else is: no editing of flows, no connections, no billing, no secrets.

| Tool | What it does | Needs |
| --- | --- | --- |
| `list_flows` | Lists the flows you shared with AI apps: name, title, description, whether a run takes files, and whether you may run it. Takes an optional `query` to filter by words. | Read |
| `run_flow` | Starts a run of a shared flow and waits up to `wait_seconds` (0 to 20, default 10) for it to finish. Otherwise it returns the run id. | Run, workspace admin |
| `get_run` | Reads a run of a shared flow: phase, times, credits, why it is held or failed, its result fields and output files. With `include_text_outputs` it also returns text outputs. | Read |

`run_flow` may carry up to 5 text inputs (`text/plain`, `text/csv`, `application/json` or `text/markdown`, each up to 256 KiB) for a flow that takes documents, and an `idempotency_key`: the same key within 10 minutes returns the same run instead of starting another. Binary files such as PDFs cannot be sent this way.

A few rules keep this safe:

-   **Only shared flows.** A flow is visible to AI apps only after an admin marks it, as described [below](#share-a-flow). Any other flow answers "not found".
-   **As you, and no more.** An AI app has your role in the workspace. Members can list flows and read runs. Only admins can start them.
-   **Same limits as any run.** Budgets, credits, holds and the one-run-at-a-time rule apply unchanged.
-   **Data, not instructions.** Everything Lumen returns is marked as workspace data that the model must not treat as instructions.
-   **Rate limits.** 60 calls a minute per person, 300 per workspace, and 10 run starts a minute.
-   **Audited.** Every call is recorded as an AI app call with the tool, the flow and the result, and never the arguments or what came back. The audit log shows the source as **Through an AI app**. See [Audit log](https://docs.go-lumen.ai/he/operate/audit-log.md).

## Share a flow

Nothing is exposed until an admin sets the label `lumen.ai/mcp: "true"` on the flow. An optional annotation, `lumen.ai/description`, is the description the AI app sees. The console has no switch for this yet, so set the label in the flow's file and apply it (see [Flows as YAML](https://docs.go-lumen.ai/he/api/flows-as-yaml.md)).

```yaml title="flows/mcp-merge-invoices.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: mcp-merge-invoices
  namespace: tenant-acme
  labels:
    lumen.ai/owner: git
    lumen.ai/mcp: "true"
  annotations:
    lumen.ai/description: Merges the invoice PDFs of a month into one file.
spec:
  displayName: Merge a month of invoices
  triggers:
    - id: manual
      ref: {name: manual-run}
      next: [pdfs]
  nodes:
    - id: pdfs
      stepRef: {name: keep-pdfs}
      next: [merge]
    - id: merge
      stepRef: {name: merge-pdfs}
      next: [keep]
    - id: keep
      stepRef: {name: keep-in-lumen}
```

To stop sharing a flow, remove the label. The AI app stops seeing it, and its runs, at once.

> **Share only what an AI app should start:**
> 
> `run_flow` can send email, write data and spend credits, as the flow is built to. Share flows that are safe to start on request, and keep the ones that need a person's approval first behind an approval step.

## Connect an AI app

The endpoint is your workspace's region API address followed by `/mcp`:

```text
https://api.go-lumen.ai/mcp
```

Workspaces in another region use that region's address. The consent page shows it when you pick such a workspace.

1.  In the AI app, add a custom connector, also called a remote MCP server, and paste the endpoint.
2.  The app sends you to Lumen. Sign in the way you always do, including your company's single sign-on.
3.  Lumen shows who is asking, the address you will be sent back to, and what the app will be able to do. Under **Choose one workspace to connect**, pick a workspace. A crown icon means you are an admin there, a person icon that you are a member.
4.  Click **Allow**, or **Cancel** to refuse.

![Lumen's consent page, titled Connect Claude, claude.ai to Lumen. It says After you decide, you are sent back to claude.ai, and lists what the app will be able to do: See the flows and runs the workspace exposed to AI apps, and Start those flows, only workspace admins can do this. Below, Choose one workspace to connect lists two workspaces as radio options, one with a crown icon and one with a person icon.](https://docs.go-lumen.ai/he/img/api/mcp-server-01-consent.png)

*The consent page. You choose one workspace, and the app is connected to that workspace only.*

One connection is one workspace. To use a second workspace, add a second connector.

The AI app gets a token that lasts 15 minutes and renews itself for up to 30 days. After that you approve again. Lumen issues this token itself, and it works only for the MCP endpoint of its region.

### Which apps

Today, Lumen accepts connections from **Claude** (claude.ai and the Claude apps) and **ChatGPT**. Other clients are refused when they try to register.

Apps that run on your computer and receive the sign-in on a local address, such as a Claude Code or Claude Desktop configuration file entry, or Cursor, are not supported, so there is no configuration snippet to paste.

## For developers

The endpoint speaks MCP over Streamable HTTP. It takes `POST` only (a `GET` or `DELETE` is answered `405`), keeps no session, and answers with JSON. It understands the 2026-07-28, 2025-11-25 and 2025-06-18 protocol revisions, and does not accept batches.

Without a token, it answers `401` with the address of its sign-in metadata, which a client follows to register, send you to the consent page, and get a token:

```bash
curl -i -X POST https://api.go-lumen.ai/mcp
```

```text
HTTP 401
www-authenticate: Bearer resource_metadata="https://api.go-lumen.ai/.well-known/oauth-protected-resource/mcp"
```

The authorization server is Lumen's API, with the standard well-known documents, dynamic client registration for the supported apps only, and PKCE with `S256` required. An [API key](https://docs.go-lumen.ai/he/api/api-keys.md) does not work on this endpoint. To call Lumen from your own code with a key, use the [Runtime API](https://docs.go-lumen.ai/he/api/runtime-api.md).

## Next steps

[Flows as YAMLLabel a flow in its file to share it with AI apps.](https://docs.go-lumen.ai/he/api/flows-as-yaml.md)[Tools and MCPThe other direction: let a Lumen agent use an MCP server.](https://docs.go-lumen.ai/he/ai/tools-and-mcp.md)[Runtime APIStart runs from your own code with an API key.](https://docs.go-lumen.ai/he/api/runtime-api.md)[Workspaces and accessRoles decide what an AI app may do as you.](https://docs.go-lumen.ai/he/concepts/workspaces-and-access.md)
