Metadata-Version: 2.5
Name: mcp-ship-check
Version: 0.1.0
Summary: Pre-flight checker for MCP servers: annotations, tests, packaging, live stdio handshake, Glama build spec. CLI, MCP server and Claude Code skill.
Project-URL: Homepage, https://github.com/ali-saad-khan/mcp-ship-check
Project-URL: Source, https://github.com/ali-saad-khan/mcp-ship-check
Project-URL: Issues, https://github.com/ali-saad-khan/mcp-ship-check/issues
License: MIT
License-File: LICENSE
Keywords: checker,claude-code,glama,lint,mcp,model-context-protocol,quality,skill
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp>=1.2; extra == 'mcp'
Description-Content-Type: text/markdown

# mcp-ship-check

**Pre-flight checker for MCP servers.** One command tells you whether your repo is ready to publish and exactly what to fix: tool annotations, tests per tool, README, packaging, committed secrets, a live stdio handshake against the real server, and the Glama build spec that actually works.

Most MCP servers listed in directories are abandoned or break on first run. This is the checklist that avoids that, as a CLI, an MCP server and a Claude Code skill. No dependencies for the CLI.

```console
$ pip install mcp-ship-check
$ mcp-ship-check path/to/your-server --live

PASS  LICENSE file present
PASS  tools discovered statically
      5 tools: check_environment, fetch_poem, make_music_bed, plan_poem, render_poem
PASS  every tool is named in a test
WARN  mcp dependency declared where default installs get it
      mcp is only in the optional extra [mcp]
      fix: A plain `uv sync` or `pip install .` will not install it and the server will not start. ...
PASS  stdio initialize and tools/list succeed
      ready in 1.2s; versereel 2.x; 5 tools
PASS  all four annotation hints on every tool (live)
WARN  every parameter is described
      17/17 parameters have no description, e.g. plan_poem.title, plan_poem.stanzas, ...
INFO  recommended Glama build spec
      Build steps: ["uv pip install --python /usr/local/bin/python --break-system-packages 'versereel[mcp]==0.1.2'", ...]
      CMD arguments: ['mcp-proxy', '--', 'python', '-m', 'versereel.mcp_server']

score 95/100 (grade A)  18 pass, 3 warn, 0 fail
```

## What it checks

| Area | Checks |
|---|---|
| Repo | LICENSE, README (install + client config + every tool named), CI runs tests, tests exist and name every tool, git tag for the version |
| Packaging | pyproject metadata, console-script entry point, `python -m` start-up guard, `mcp` dependency reachable by a default install |
| Tools (static, AST) | `@x.tool(...)` found; all four annotation hints (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) explicit; TypeScript `server.tool(...)` names found |
| Security | known key patterns (placeholders ignored), tracked `.env`/keys, `eval`/`exec`/`shell=True` to review |
| Live (opt-in) | stdio `initialize` + `tools/list` within 10 s, clean stdout (no stray `print`), real tool descriptions, all four hints, parameter descriptions, snake_case names |
| Glama | prints the build steps and command to paste into Glama's Admin > Dockerfile |

Score is 0-100 with grade A-D. Exit code is 1 on any FAIL (`--strict`: warnings too), so it works in CI.

```bash
mcp-ship-check .                        # static: reads files, never runs your code
mcp-ship-check . --live                 # also starts the repo's console script and inspects the real tools
mcp-ship-check . --command "my-server"  # explicit launch command
mcp-ship-check . --markdown             # paste into a PR;  --json for CI;  --list-checks
```

### In CI
```yaml
- run: pip install mcp-ship-check
- run: mcp-ship-check . --command my-server --strict
```

## Safety
Static mode only reads files. **`--live` / `--command` start the server process**, so only use them on code you trust (ideally inside a container). The MCP server wrapper keeps these apart: `check_repo` is read-only; `check_live` is annotated as destructive because it runs a command.

## As an MCP server
```bash
pip install "mcp-ship-check[mcp]"
```
```json
{ "mcpServers": { "mcp-ship-check": { "command": "mcp-ship-check-mcp" } } }
```
Tools: `check_repo` (static, read-only), `check_live` (runs the server command), `list_checks`.

## As a Claude Code skill
Copy `skill/mcp-ship-check/` to `~/.claude/skills/mcp-ship-check/`. It runs the checker, applies fixes in the right order, and walks through PyPI, release, Glama and directory listings (`references/directories.md`).

## Why these checks
They come from shipping [versereel](https://github.com/ali-saad-khan/versereel): missing annotation hints, a Glama default build that could not start the server (extra not installed, entry point not on PATH), no release, and no test per tool each cost time. The checker dogfoods itself: CI runs it against its own MCP server.

## Limits
Static tool discovery understands Python `@x.tool(...)` decorators and simple TypeScript `server.tool("name", ...)` calls; tools registered another way are only seen in live mode. The Glama spec assumes a package published on PyPI. Checks are heuristics, not a security audit.

## Develop
```bash
git clone https://github.com/ali-saad-khan/mcp-ship-check && cd mcp-ship-check
uv venv && uv pip install -e ".[dev,mcp]" && pytest
```

## Author
Built by Saad Ali Khan, a full stack and AI engineer. Portfolio: [saadconsulting.tech](https://saadconsulting.tech). Available for freelance work on AI tooling, MCP servers and automation.

## Licence
MIT
