Skip to content

Commit 7414437

Browse files
committed
checkpoint
1 parent 64ba41c commit 7414437

257 files changed

Lines changed: 6875 additions & 2149 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint-typecheck:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
cache: pnpm
28+
29+
- name: Install dependencies
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Build
33+
run: pnpm build
34+
35+
- name: Lint
36+
run: pnpm lint
37+
38+
- name: Typecheck
39+
run: pnpm typecheck
40+
41+
test-typescript:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
47+
- name: Setup pnpm
48+
uses: pnpm/action-setup@v4
49+
50+
- name: Setup Node
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: 22
54+
cache: pnpm
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: Build
60+
run: pnpm build
61+
62+
- name: Test
63+
run: pnpm test
64+
65+
test-scanner:
66+
runs-on: ubuntu-latest
67+
defaults:
68+
run:
69+
working-directory: apps/scanner
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
74+
- name: Setup Python
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version: '3.13'
78+
79+
- name: Install uv
80+
uses: astral-sh/setup-uv@v4
81+
82+
- name: Install dependencies
83+
run: uv sync --dev
84+
85+
- name: Run tests
86+
run: uv run pytest

ASSESSMENT.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# mpak Technical Assessment
2+
3+
**Date:** 2026-02-10
4+
**Assessor:** Cold-start codebase analysis
5+
**Scope:** Full project (schemas, SDK, CLI, registry, web, scanner, docs, deploy)
6+
7+
## Reconciliation
8+
9+
**Reconciled:** 2026-02-10, code review against codebase.
10+
11+
Findings:
12+
- 5 items already fixed in code (#3, #4, #7, #9, #10) that the original assessment missed
13+
- CI pipeline (#2) exists with lint/typecheck/test jobs
14+
- TOCTOU (#6) mitigated with pre-check + transaction wrapping
15+
16+
Work completed in this session:
17+
- #1: Registry test suite added (62 tests across 5 files: errors, oidc, bundles, scanner, health)
18+
- #5: Filename sanitization added to announce endpoint (path traversal, extension, length checks)
19+
- #8: ZIP bomb protection added to CLI bundle extraction (500MB uncompressed size limit)
20+
- #12: CODE_OF_CONDUCT.md created (SECURITY.md already existed)
21+
- #15: Shell completions added for bash, zsh, fish
22+
- #16: Rate limiting added (global 100/min, scoped 10/min for /v1/bundles and /v1/skills)
23+
- 6 items remain open (#11, #13, #14, #17, #18, #19, #20, #21)
24+
25+
## Executive Summary
26+
27+
mpak is a purpose-built package registry for MCP servers with security scanning as a first-class feature. The architecture is thoughtful (layered monorepo, OIDC-only publishing, 25-control trust framework), but the project is pre-launch (14 commits, single contributor, v0.0.0). Core gaps are: no registry tests, no CI pipeline, and several security hardening items that should be resolved before production traffic.
28+
29+
## Strengths
30+
31+
- Clean layered architecture (schemas -> SDK -> CLI, registry standalone)
32+
- OIDC-only publishing eliminates long-lived API keys
33+
- Sophisticated scanner with MCP-specific controls (prompt injection detection, undeclared permission scoping)
34+
- Production deployment story (Helm chart with HPA, security contexts, rate limiting)
35+
- Comprehensive documentation (36 Starlight pages)
36+
- Skills concept (knowledge distribution alongside tool distribution)
37+
38+
## Gaps by Priority
39+
40+
### P0: Ship-Blocking
41+
42+
| # | Issue | Location | Effort | Status |
43+
|---|-------|----------|--------|--------|
44+
| 1 | Registry server has ~0 test coverage | `apps/registry/tests/` | Large | DONE |
45+
| 2 | No CI pipeline beyond docs deploy | `.github/workflows/` | Small | DONE |
46+
| 3 | Scanner callback uses non-constant-time string comparison | `apps/registry/src/routes/scanner.ts` | Trivial | FIXED |
47+
48+
### P1: Pre-Production Quality
49+
50+
| # | Issue | Location | Effort | Status |
51+
|---|-------|----------|--------|--------|
52+
| 4 | JWKS not cached in OIDC verification | `apps/registry/src/lib/oidc.ts` | Trivial | FIXED |
53+
| 5 | Announce endpoint accepts unvalidated os/arch/filename | `apps/registry/src/routes/v1/bundles.ts` | Small | DONE |
54+
| 6 | TOCTOU race in web publish flow | `apps/registry/src/routes/packages.ts` | Small | MITIGATED |
55+
| 7 | Search endpoints accept negative limit/offset | `apps/registry/src/routes/v1/bundles.ts` | Trivial | FIXED |
56+
57+
### P2: Security Hardening
58+
59+
| # | Issue | Location | Effort | Status |
60+
|---|-------|----------|--------|--------|
61+
| 8 | ZIP extraction has no decompression bomb protection | `packages/cli/src/commands/packages/run.ts` | Small | DONE |
62+
| 9 | Scanner callback has no idempotency check | `apps/registry/src/routes/scanner.ts` | Trivial | FIXED |
63+
| 10 | README rendering should explicitly disable HTML | `apps/web/src/pages/PackageDetailPage.tsx` | Trivial | FIXED |
64+
| 11 | 10 of 25 scanner controls are stubs | `apps/scanner/` | Large | OPEN |
65+
66+
### P3: DX & OSS Readiness
67+
68+
| # | Issue | Location | Effort | Status |
69+
|---|-------|----------|--------|--------|
70+
| 12 | Missing SECURITY.md and CODE_OF_CONDUCT.md | repo root | Small | DONE |
71+
| 13 | Web app has zero tests | `apps/web/` | Medium | OPEN |
72+
| 14 | CSR-only web app hurts discoverability | `apps/web/` | Large | OPEN |
73+
| 15 | No shell completions for CLI | `packages/cli/` | Small | DONE |
74+
| 16 | No API rate limiting at application level | `apps/registry/` | Small | DONE |
75+
| 17 | No release cut (v0.1.0) | repo root | Trivial | OPEN |
76+
77+
### P4: Polish
78+
79+
| # | Issue | Location | Effort | Status |
80+
|---|-------|----------|--------|--------|
81+
| 18 | CLI error messages lack suggestions | `packages/cli/` | Small | OPEN |
82+
| 19 | Download count tracking not transactional | `apps/registry/src/routes/` | Trivial | OPEN |
83+
| 20 | Missing package.json metadata on schemas | `packages/schemas/package.json` | Trivial | OPEN |
84+
| 21 | No architecture decision records | repo root | Medium | OPEN |
85+
86+
## Quick Wins (< 1 hour each)
87+
88+
Items 17, 19, 20 remain as quick wins. Items 2, 3, 4, 7, 9, 10 were already resolved before this session. Items 1, 5, 8, 12, 15, 16 were resolved in this session.
89+
90+
## Architecture Notes
91+
92+
- **Monorepo:** pnpm workspaces + Turborepo
93+
- **Dep graph:** schemas -> SDK -> CLI; schemas -> registry; web standalone; scanner standalone Python
94+
- **Auth:** Clerk (web), GitHub OIDC (publish)
95+
- **Storage:** Local (dev) / S3+CloudFront (prod)
96+
- **Scanner:** Python 3.13+, runs as K8s Job, 25 MTF controls across 5 domains
97+
- **Web:** React SPA (Vite + Tailwind 4 + TanStack Query + Clerk)
98+
- **Docs:** Astro Starlight on GitHub Pages

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2026-02-10
9+
10+
Initial public release of mpak, the open-source MCP bundle registry.
11+
12+
### Added
13+
14+
- **Registry API** (Hono/Bun): package publishing, versioning, scoped namespaces, signed download URLs (S3/CloudFront)
15+
- **CLI** (`mpak`): `run`, `publish`, `search`, `config`, and `skills install` commands for managing MCP bundles
16+
- **Web UI** (React Router): search, package detail pages, publish flow, user dashboard
17+
- **TypeScript SDK** (`@nimblebrain/mpak-sdk`): typed client for the registry API
18+
- **Security scanner**: automated bundle scanning via Kubernetes jobs with callback-based results
19+
- **Skill bundles**: `.skill` format for distributing Claude Code skills through the registry
20+
- **MCPB v0.3 support**: `manifest.json` with `user_config` field definitions and `${user_config.*}` substitution
21+
- **Zip bomb protection**: uncompressed size check before extraction (500MB limit)
22+
- **Platform-aware bundles**: per-platform (os/arch) bundle resolution and download
23+
24+
### Known Limitations
25+
26+
- Web UI has no end-to-end test coverage
27+
- Scanner requires Kubernetes cluster access (not usable in local dev without mocking)

CODE_OF_CONDUCT.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a welcoming experience for everyone, regardless of background or
7+
identity.
8+
9+
We pledge to act and interact in ways that contribute to an open, welcoming,
10+
diverse, inclusive, and healthy community.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to a positive environment:
15+
16+
* Using welcoming and inclusive language
17+
* Being respectful of differing viewpoints and experiences
18+
* Gracefully accepting constructive criticism
19+
* Focusing on what is best for the community
20+
* Showing empathy towards other community members
21+
22+
Examples of unacceptable behavior:
23+
24+
* Trolling, insulting or derogatory comments, and personal or political attacks
25+
* Public or private harassment
26+
* Publishing others' private information without explicit permission
27+
* Other conduct which could reasonably be considered inappropriate in a
28+
professional setting
29+
30+
## Enforcement Responsibilities
31+
32+
Community leaders are responsible for clarifying and enforcing our standards of
33+
acceptable behavior and will take appropriate and fair corrective action in
34+
response to any behavior that they deem inappropriate, threatening, offensive,
35+
or harmful.
36+
37+
## Scope
38+
39+
This Code of Conduct applies within all community spaces, and also applies when
40+
an individual is officially representing the community in public spaces.
41+
42+
## Enforcement
43+
44+
Instances of unacceptable behavior may be reported to the community leaders
45+
responsible for enforcement at **security@mpak.dev**.
46+
47+
All complaints will be reviewed and investigated promptly and fairly. All
48+
community leaders are obligated to respect the privacy and security of the
49+
reporter of any incident.
50+
51+
## Attribution
52+
53+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
54+
version 2.1, available at
55+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
56+
57+
[homepage]: https://www.contributor-covenant.org
58+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

CONTRIBUTING.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,6 @@ chore(ci): update Node.js version in workflows
115115

116116
**Scopes:** `schemas`, `sdk`, `cli`, `registry`, `web`, `scanner`, `docs`, `deploy`, `ci`, `root`
117117

118-
### License Headers
119-
120-
All source files must include an SPDX license header:
121-
122-
```typescript
123-
// SPDX-License-Identifier: Apache-2.0
124-
// Copyright 2024 NimbleBrain Inc.
125-
```
126-
127-
```python
128-
# SPDX-License-Identifier: Apache-2.0
129-
# Copyright 2024 NimbleBrain Inc.
130-
```
131-
132118
## Reporting Issues
133119

134120
- Use [GitHub Issues](https://github.com/NimbleBrainInc/mpak/issues)

0 commit comments

Comments
 (0)