Mare Liberum

900 mTwilight zone

Guides · The engine room

Lean MCP door: a smaller tool list

An MCP client may put every tool definition of a server into the model's context on every turn. The open door of the sea, https://mareliberum.dev/mcp, lists every tool of the sea (55 when the bench of 2026-11-25 counted them). The lean door, https://mareliberum.dev/mcp/lean, lists four: read_page, think, find_tools, call_tool. find_tools finds any other tool by what it is for, and call_tool calls it with the same answer, limits and counting as the open door.

What it spares

The tool list of each door, as one JSON answer of tools/list, counted with three tokenizers (bench of 2026-11-25, the run as data, shown on /engine):

DoorToolsByteso200k_basecl100k_baseclaude-legacy
/mcp5540,2899,6959,6459,814
/mcp/lean42,580631627643

In a client that loads every definition, that is 9,064 tokens fewer on every model call (o200k_base, 93.5 % fewer).

When it helps, and when it does not

Only in clients that load every tool definition (Gemini CLI, Cline, Roo, Zed, agents of your own). Claude Code, Copilot CLI and OpenAI's Agents API already defer tools; there it spares almost nothing.

On prompt caching: the prices of the ledger are list prices for uncached input tokens; a client that had the same text in its prompt cache pays 0.025 to 0.1 times that (Claude, OpenAI and Google pricing), so a saving on a cached prefix such as a tool list is worth far less than this. So the lean door is worth most where nothing is cached and every definition is loaded: an agent loop of your own, Gemini CLI, Cline, Roo, Zed.

Answers are the same as on the open door. A tool result goes out as text only, once (TOON where it is at least 20 % fewer tokens than compact JSON, else the JSON), so a client that reads both text and structured content does not read an answer twice. The tool list itself is never tolled.

Add it to your client

Every line follows the client's own documentation, read on 2026-11-25. More clients, each with an install button where it has one: /connect.

Claude Code

The lean door, in a terminal (this project; --scope user after the name: every project)

claude mcp add --transport http mare-lean https://mareliberum.dev/mcp/lean

Or the plugin: the lean door and a skill for since=, fields= and budget=, typed in Claude Code

/plugin marketplace add daoudandiaye98-alt/mare-liberum
/plugin install mare-lean@mare-liberum

Claude Code defers MCP tool definitions by default (tool search), so its tool list gains almost nothing here; the skill tells the agent when to read again with since= and when to ask for fewer fields.

Checked against Claude Code: MCP · Claude Code: marketplace reference

Cursor

~/.cursor/mcp.json (every project) or .cursor/mcp.json (this project); the install button stands on /connect

{
  "mcpServers": {
    "mare-lean": {
      "url": "https://mareliberum.dev/mcp/lean"
    }
  }
}

Checked against Cursor: MCP · Cursor: MCP install links

VS Code

In a terminal

code --add-mcp '{"name":"mare-lean","type":"http","url":"https://mareliberum.dev/mcp/lean"}'

Or .mcp.json at the root of a workspace, or ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "mare-lean": {
      "type": "http",
      "url": "https://mareliberum.dev/mcp/lean"
    }
  }
}

Checked against VS Code: MCP configuration reference

OpenAI Codex

In a terminal

codex mcp add mare-lean --url https://mareliberum.dev/mcp/lean

Or ~/.codex/config.toml

[mcp_servers.mare-lean]
url = "https://mareliberum.dev/mcp/lean"

Checked against OpenAI Codex: Model Context Protocol

Gemini CLI

In a terminal

gemini mcp add --transport http --scope user mare-lean https://mareliberum.dev/mcp/lean

Or ~/.gemini/settings.json (httpUrl: Streamable HTTP)

{
  "mcpServers": {
    "mare-lean": {
      "httpUrl": "https://mareliberum.dev/mcp/lean"
    }
  }
}

Checked against Gemini CLI: MCP servers

OpenAI Agents SDK

Python: pip install openai-agents

import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

async def main():
    async with MCPServerStreamableHttp(name="Mare Liberum Lean", params={"url": "https://mareliberum.dev/mcp/lean"}) as sea:
        agent = Agent(name="Assistant", mcp_servers=[sea])
        print((await Runner.run(agent, "Read https://example.com and give me the three main points.")).final_output)

asyncio.run(main())

Checked against OpenAI Agents SDK: MCP

Vercel AI SDK

TypeScript: npm i ai @ai-sdk/mcp

import { streamText } from 'ai';
import { createMCPClient } from '@ai-sdk/mcp';

const sea = await createMCPClient({ transport: { type: 'http', url: 'https://mareliberum.dev/mcp/lean' } });
const result = streamText({
  model: 'anthropic/claude-sonnet-5.5',
  tools: await sea.tools(),
  prompt: 'Read https://example.com and give me the three main points.',
  onEnd: async () => { await sea.close(); },
});
for await (const text of result.textStream) process.stdout.write(text);

Checked against AI SDK: MCP tools

LiteLLM proxy

config.yaml: the lean door behind the proxy's MCP gateway (clients reach it at /mcp, or /mare_lean/mcp for this server alone)

mcp_servers:
  mare_lean:
    url: "https://mareliberum.dev/mcp/lean"
    transport: "http"
    auth_type: "none"

config.yaml: tool results through /compress before they reach the model (litellm_mare_compress.py beside config.yaml)

litellm_settings:
  callbacks: litellm_mare_compress.proxy_handler_instance

The callback sends a tool result only when it is longer than 2,000 characters, takes the answer only when it is smaller, and keeps the original text on any error or timeout.

Checked against LiteLLM: MCP configuration reference · LiteLLM: call hooks (async_pre_call_hook)

Check it yourself

curl -s https://mareliberum.dev/mcp/lean -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | wc -c

Where the claims about deferred tools come from: Claude Code: MCP tool definitions are deferred by default (tool search) · OpenAI: tool search and defer_loading; in the Agents API MCP tools are deferred · Atlassian mcp-compressor (29 March 2026): the same pattern of a few meta-tools in front of many, before the lean door.

More guides

Sources of every number on this page: /engine (the bench run) · /proof (the run) · the toll · the code: github.com/daoudandiaye98-alt/mare-liberum