Skip to content

Commit 36d5b6a

Browse files
false200cursoragent
andcommitted
Rebrand to LeanMCP (leanmcp package, CLI, config, metrics, Docker)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a7307d7 commit 36d5b6a

50 files changed

Lines changed: 689 additions & 280 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Build context hygiene — keep the image small and reproducible.
2+
3+
# VCS / IDE
4+
.git
5+
.gitattributes
6+
.github
7+
.gitignore
8+
.cursor
9+
.vscode
10+
.idea
11+
12+
# Node / build outputs (we rebuild inside the image)
13+
node_modules
14+
dist
15+
coverage
16+
*.tsbuildinfo
17+
18+
# Local runtime artifacts
19+
.leanmcp
20+
bench/sandbox
21+
bench/results/*.json
22+
bench/REPORT.md
23+
24+
# Logs and editor cruft
25+
*.log
26+
.DS_Store
27+
28+
# Local secrets — never bake these into a layer
29+
.env
30+
.env.local
31+
.env.*.local
32+
33+
# Docker meta (avoid recursive copy)
34+
Dockerfile
35+
.dockerignore
36+
docker-compose.yml
37+
compose.yaml
38+
39+
# Misc dev files we don't need at runtime
40+
docs
41+
CONTRIBUTING.md

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ jobs:
4444
- name: Smoke-test the CLI
4545
shell: bash
4646
run: |
47-
node bin/mcp-diet --version
48-
node bin/mcp-diet measure --config examples/demo.config.json
47+
node bin/leanmcp --version
48+
node bin/leanmcp measure --config examples/demo.config.json

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
node_modules/
22
dist/
33
coverage/
4-
.mcp-diet/
4+
.leanmcp/
55
*.log
66
.DS_Store
77
.env

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ vitest.config.ts
99
.eslintrc*
1010
.prettierrc*
1111
coverage/
12-
.mcp-diet/
12+
.leanmcp/

CONTRIBUTING.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to mcp-diet
1+
# Contributing to LeanMCP
22

3-
Thanks for your interest! `mcp-diet` is a small project; a quick PR is usually faster than a long discussion.
3+
Thanks for your interest! LeanMCP is a small project; a quick PR is usually faster than a long discussion.
44

55
## Local setup
66

@@ -13,6 +13,14 @@ pnpm build
1313

1414
`pnpm test` runs unit + integration suites. The integration tests spawn a local fixture MCP server over stdio, so they need Node 20+ but no network.
1515

16+
## Enterprise benchmark (optional)
17+
18+
The numbers in [`bench/REPORT.md`](bench/REPORT.md) / the README hero come from
19+
**`pnpm bench` run inside the Docker image** (`Dockerfile``leanmcp:dev`) so
20+
the baseline is **linux-x64** with a pinned Node, not whatever laptop ran it
21+
last. See [`docs/DOCKER.md`](docs/DOCKER.md) for `docker build` / `docker run`
22+
and how to mount `bench/` so `REPORT.md` updates on the host.
23+
1624
## Running the CLI in dev
1725

1826
```bash
@@ -40,8 +48,8 @@ Conventional commits are nice but not enforced. A short imperative summary is fi
4048

4149
Please include:
4250

43-
- the version of `mcp-diet` (`mcp-diet --version`),
44-
- the **redacted** config (use `mcp-diet validate-config` — it strips token-like fields),
45-
- a few lines of `.mcp-diet/trace.ndjson` if relevant.
51+
- the version of LeanMCP (`leanmcp --version`),
52+
- the **redacted** config (use `leanmcp validate-config` — it strips token-like fields),
53+
- a few lines of `.leanmcp/trace.ndjson` if relevant.
4654

4755
By contributing, you agree your work is licensed under the same [MIT license](LICENSE) as the project.

Dockerfile

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# LeanMCP — Linux container image
2+
#
3+
# Default behavior: starts the LeanMCP proxy on 0.0.0.0:8799 (MCP Streamable HTTP)
4+
# and 0.0.0.0:9464 (Prometheus). It fans out to five upstream MCP servers via
5+
# `npx`, so we warm the npm cache for those packages during build to make the
6+
# first call fast and self-contained.
7+
#
8+
# Override CMD to run the bench harness instead, e.g.:
9+
# docker run --rm leanmcp:dev pnpm bench --skip-agent
10+
#
11+
# Multi-stage layout:
12+
# 1. deps — install ALL dependencies (incl. dev) for build + bench
13+
# 2. build — compile TypeScript -> dist
14+
# 3. runtime — slim final image with deps + dist + bench harness
15+
16+
ARG NODE_VERSION=20.18.0
17+
ARG PNPM_VERSION=10.26.0
18+
19+
# -----------------------------------------------------------------------------
20+
# Stage 1: deps — pnpm install with frozen lockfile
21+
# -----------------------------------------------------------------------------
22+
FROM node:${NODE_VERSION}-bookworm-slim AS deps
23+
ARG PNPM_VERSION
24+
25+
ENV PNPM_HOME=/pnpm \
26+
PATH="/pnpm:$PATH" \
27+
CI=true
28+
29+
# Install a pinned pnpm without corepack (corepack hits npmjs.org for "latest"
30+
# even when packageManager isn't pinned, which fails on flaky networks).
31+
RUN npm install -g pnpm@${PNPM_VERSION} \
32+
|| (sleep 5 && npm install -g pnpm@${PNPM_VERSION})
33+
34+
WORKDIR /app
35+
36+
COPY package.json pnpm-lock.yaml ./
37+
38+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
39+
pnpm install --frozen-lockfile
40+
41+
# -----------------------------------------------------------------------------
42+
# Stage 2: build — produce dist/
43+
# -----------------------------------------------------------------------------
44+
FROM node:${NODE_VERSION}-bookworm-slim AS build
45+
ARG PNPM_VERSION
46+
47+
ENV PNPM_HOME=/pnpm \
48+
PATH="/pnpm:$PATH"
49+
50+
RUN npm install -g pnpm@${PNPM_VERSION} \
51+
|| (sleep 5 && npm install -g pnpm@${PNPM_VERSION})
52+
53+
WORKDIR /app
54+
55+
COPY --from=deps /app/node_modules ./node_modules
56+
COPY . .
57+
58+
RUN pnpm build
59+
60+
# -----------------------------------------------------------------------------
61+
# Stage 3: runtime — slim image we actually ship/run
62+
# -----------------------------------------------------------------------------
63+
FROM node:${NODE_VERSION}-bookworm-slim AS runtime
64+
ARG PNPM_VERSION
65+
66+
ENV PNPM_HOME=/pnpm \
67+
PATH="/pnpm:$PATH" \
68+
NODE_ENV=production \
69+
NPM_CONFIG_UPDATE_NOTIFIER=false \
70+
NPM_CONFIG_FUND=false
71+
72+
# Native deps that some npx-resolved MCP servers may pull in (sqlite3, sharp,
73+
# etc.). Cheap and rare, but keeps `npx -y <server>` from breaking on first call.
74+
RUN apt-get update \
75+
&& apt-get install -y --no-install-recommends \
76+
ca-certificates \
77+
curl \
78+
dumb-init \
79+
git \
80+
&& rm -rf /var/lib/apt/lists/*
81+
82+
RUN npm install -g pnpm@${PNPM_VERSION} \
83+
|| (sleep 5 && npm install -g pnpm@${PNPM_VERSION})
84+
85+
WORKDIR /app
86+
87+
# Copy built artifacts and the dependency tree from earlier stages.
88+
COPY --from=deps /app/node_modules ./node_modules
89+
COPY --from=build /app/dist ./dist
90+
91+
# Source files the bench harness still needs at runtime (it imports from src/
92+
# via tsx and uses bench/*.ts directly).
93+
COPY package.json pnpm-lock.yaml tsconfig.json ./
94+
COPY bin ./bin
95+
COPY src ./src
96+
COPY bench ./bench
97+
COPY examples ./examples
98+
COPY README.md LICENSE ./
99+
100+
# Warm the npm cache so the five upstream MCP servers don't pay a fresh
101+
# download on the first proxy/bench run inside a container.
102+
RUN set -eux; \
103+
for pkg in \
104+
@modelcontextprotocol/server-everything \
105+
@modelcontextprotocol/server-filesystem \
106+
@modelcontextprotocol/server-memory \
107+
@modelcontextprotocol/server-sequential-thinking \
108+
@modelcontextprotocol/server-github ; do \
109+
npm pack --silent "$pkg" --pack-destination=/tmp >/dev/null 2>&1 || true; \
110+
done; \
111+
rm -f /tmp/*.tgz
112+
113+
# Filesystem upstream needs a sandbox dir; the bench config defaults to
114+
# /app/bench/sandbox via BENCH_FS_ROOT.
115+
RUN mkdir -p /app/bench/sandbox /app/bench/results /app/.leanmcp
116+
117+
EXPOSE 8799 9464
118+
119+
# dumb-init reaps zombie children spawned by the upstream stdio servers.
120+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
121+
122+
# Default: start the proxy. Override with `pnpm bench [...]` etc.
123+
CMD ["node", "bin/leanmcp", "start", "--config", "examples/benchmark.docker.config.yaml"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2026 mcp-diet contributors
3+
Copyright (c) 2026 LeanMCP contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)