mcpspy 0.2.2

Zero-config stdio MCP proxy, latency profiler, and token usage auditor in Rust
Documentation
# Contributing

## Setup

Clone the repository, then build and test locally:

```bash
cargo build
cargo test --locked
```

Rust stable with the `rustfmt` and `clippy` components is expected. No network service or external API is needed for the default test suite.

## Verification

Before proposing a change, run the checks CI runs:

```bash
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --locked
cargo check --locked --no-default-features
cargo check --locked --no-default-features --features mcp
cargo publish --dry-run
```

The feature-gated checks matter: the proxy and CLI analytics must build without `tui` or `mcp`, and the self-inspecting server must build with only `mcp`.

## Architecture invariants

The five rules in [SPEC.md](SPEC.md) are hard constraints:

1. `stdout` is a pure JSON-RPC pipe in `wrap` and `mcp` modes. Route diagnostics to `stderr` or SQLite.
2. Malformed or unknown JSON-RPC lines must still be forwarded immediately.
3. `src/core/` must stay free of `clap`, `ratatui`, `crossterm`, and `rmcp`.
4. The SQLite store must use WAL mode and a busy timeout for concurrent writers.
5. Secrets must be redacted before previews or error messages are persisted.

## Testing

New behavior needs a failing test first. Pure formatting and parsing helpers belong beside their command module with `#[cfg(test)]` unit tests; protocol behavior belongs in `tests/proxy_tests.rs` with end-to-end tests that spawn the compiled binary.

When changing the proxy, add or update an end-to-end test that asserts both the exact forwarded frames and the recorded telemetry. When changing redaction, add a test that confirms the secret is absent from the stored value.

## Pull requests

- Keep changes focused and reference the relevant spec section.
- Update `CHANGELOG.md` under `Unreleased` for user-visible changes.
- Update `docs/` when command behavior or defaults change.
- Do not paste real secrets, logs, or telemetry into issues or pull requests.