mcp-witness

Classifier

Shared capability classifier used by harness/ (Phase 2) and the planned static analyzer (Phase 1). Spec: ../docs/capability-classifier.md.

v0.1 status

Implemented — Layer 1 (lexical / heuristic):

Not yet implemented:

Layout

File Purpose
classify.py classify_tool, classify_server, parameter classifier, scoring logic
lexicons.py Hand-curated keyword and pattern tables; versioned with the spec
types.py Dataclasses for output (ToolClassification, CapabilityFinding, ParameterRole, …)
__main__.py CLI entry
tests/ Smoke tests covering the obvious capability and role detection paths

Confidence model

Consumers pick their threshold. Today:

Usage

# Classify a single tool definition over stdin:
echo '{"name":"read_file","description":"Reads a file","inputSchema":{"type":"object","properties":{"path":{"type":"string"}}}}' \
    | python -m classifier

# Classify a server's tools/list output:
python -m classifier server_tools.json

Running the tests

pip install -e ".[dev]"      # quote for zsh; bash also accepts unquoted
pytest classifier/tests/