---
title: Lampson as an MCP server
description: Use Lampson's agents as tools from Claude, Cursor, ChatGPT or another Lampson — over stdio on your machine or over HTTP with an API key, agent ↔ agent included.
---
# Lampson as an MCP server

Lampson also **is** an MCP server: Claude Desktop, Claude Code, Cursor, ChatGPT or another agent can use your Lampson agents as one more tool.

Why, if those AIs already answer on their own? Because your Lampson agent has things they don't: your business's knowledge (catalog, rules, promos), its own tools with limited permissions, its history, and sometimes it runs on another machine — the one with the data. The other AI **asks** it, with no access to any of that.

## The tools

| tool | |
|---|---|
| `ask(message, agent?, thread?)` | a message to an agent. Without `thread`, it creates one and returns it: pass it in the next call to continue the conversation |
| `agents()` | the available agents and what each one is for |
| `history(thread, agent?, limit?)` | the latest messages of a conversation, to pick it up again |

## On your machine (stdio)

```sh
lampson mcp serve                       # all the project's agents
lampson mcp serve --agent tienda        # only these (comma-separated)
lampson mcp serve --workspace C:\ruta   # another project
```

In Claude Desktop (`claude_desktop_config.json`):

```json
{"mcpServers": {"tienda": {"command": "lampson", "args": ["mcp", "serve", "--agent", "tienda", "--workspace", "C:\\proyectos\\e-commerce"]}}}
```

On Windows, if your client can't find `lampson`, use `"command": "lampson.cmd"`. With nobody present, the agent runs in `strict` unless its file says otherwise.

## From anywhere (HTTP)

```
https://your-lampson/w/<workspace>/v1/mcp        Authorization: Bearer lk_…
```

MCP's standard HTTP transport, with the same [API key](/en/docs/api#api-keys) as the API: each key sees only its agents. That's how a business's employees use it from their Claude or ChatGPT, or an agent from another company. `lampson key add` shows you the URL.

`/v1/mcp/stream` is the same, answering over SSE: if the request carries a `progressToken`, each agent step ("reading the catalog…") arrives as a progress notification before the answer.

Messages go through the [mailbox](/en/docs/api#the-mailbox): two outside agents writing to the same conversation at once don't step on each other.

## Agent ↔ agent

One Lampson can use **another** Lampson's agent. A restaurant's purchasing agent asks the supplier's agent for price and stock:

1. The supplier creates a key for their agent: `lampson key add --agent ventas`, and gives you the URL and the key.
2. You put it in `~/lampson/.lampson/mcp.json` (or the project's), with the key in `.env`:

```json
{"mcpServers": {"proveedor": {"url": "https://proveedor.com/w/ventas/v1/mcp",
                              "headers": {"Authorization": "Bearer ${LAMPSON_PROVEEDOR_KEY}"}}}}
```

```sh
# ~/lampson/.env
LAMPSON_PROVEEDOR_KEY=lk_…
```

3. Your agent gains the `mcp_proveedor_ask` tool. Give permission to that tool and only that one:

```json
{"id": "compras", "system": "…", "permission": "strict",
 "tools": [{"name": "mcp_proveedor_*", "approve": "auto"}]}
```

`${LAMPSON_…}` is replaced with the value from `.env`: the key isn't written in `mcp.json`. Each side keeps its rules: the supplier decides which agents it exposes and with what limit; you decide which of your agents may ask it.
