Docstats — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Docstats (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Docstats is a versatile Python application that calculates a comprehensive set of readability metrics for textual content. It can be run as a standard HTTP API (using FastAPI) or as an MCP (Model Context Protocol) server in two modes: STDIO or Streamable HTTP.
The application can process text from three types of sources:
pypdf. python -m venv .venv # Or your preferred venv creation method
source .venv/bin/activate # On Windows: .venv\Scripts\activateIf you have requirements.txt:
uv pip install -r requirements.txtIf you only have pyproject.toml or want to ensure all dependencies from it are installed (recommended):
uv pip install -e . # Installs the project in editable mode with its dependencies
# or for just dependencies if not installing the project itself:
# uv pip install . Ensure your pyproject.toml lists all necessary dependencies like fastapi, uvicorn[standard], textstat, py-readability-metrics, google-cloud-storage, pypdf2, beautifulsoup4, mcp>=1.9.3, starlette, anyio.
Ensure you have Application Default Credentials (ADC) configured in your environment. This typically involves running:
gcloud auth application-default loginRefer to Google Cloud ADC documentation for more details.
The main.py script uses command-line flags to determine how it starts.
This mode provides a traditional RESTful API. For development with auto-reload, it's best to run Uvicorn directly pointing to the fastapi_app module.
Recommended Development Startup (with auto-reload):
uv run uvicorn fastapi_app:fastapi_app --host 127.0.0.1 --port 8000 --reload--host and --port as needed.http://127.0.0.1:8000/docs.Alternative Startup (using the `main.py` entry point):
uv run python main.py --server-type fastapi --host 127.0.0.1 --port 8000--reload feature works best when Uvicorn imports the app string (main:fastapi_app) directly.Example API Call (using cURL for a web URL):
curl -X POST "http://127.0.0.1:8000/scores/" -H "Content-Type: application/json" -d '{ "web_url": "https://www.example.com" }'Example API Call (using cURL for direct text):
curl -X POST "http://127.0.0.1:8000/scores/" -H "Content-Type: application/json" -d '{ "text": "This is a sample text for readability analysis." }'This mode runs the MCP server communicating over standard input/output. This is useful for direct integration with other processes or MCP clients that use STDIO (e.g., an AI Agent CLI).
Command using `python main.py`:
uv run python main.py --server-type mcpmcp_generic_app instance defined in main.py using the STDIO transport.Using with an MCP Client (e.g., AI Application / Gemini CLI / Claude): If you have an MCP client configured (like Gemini CLI or Claude Code), you can define this server in its settings.
For example, in a ~/.claude/settings.json or ~/.gemini/settings.json (or similar client configuration file for your agent):
{
"mcpServers": {
"readability_docstats": {
"command": "uv",
"args": ["run", "python", "/PATH/TO/DOCSTATS/main.py", "--server-type", "mcp"],
"cwd": "/PATH/TO/DOCSTATS"
}
}
}Replace /PATH/TO/docstats with the correct absolute path to this project directory if your MCP client runs from a different context. Once configured, you could invoke the tool via the client, e.g.: @readability_docstats get_readability_scores text="Some sample text."
This mode runs the MCP server over HTTP.
Command using `python main.py`:
uv run python main.py --server-type mcp-http --host 127.0.0.1 --port 8001--host and --port as needed. A different port (e.g., 8001) is recommended to avoid conflict with the FastAPI server.http://127.0.0.1:8001/mcp. uv run python main.py --server-type mcp-http --mcp-http-json-response --port 8001The project includes a comprehensive test suite using pytest.
#### Test Types
httpx, google-cloud-storage, and pypdf. These are fast and do not require internet or cloud credentials. They cover core extraction logic and MCP tool execution.TestClient to verify end-to-end flow. Some tests are marked as slow because they require network access to fetch live web pages and GCS PDFs.#### Test Coverage
#### Running Tests Run all tests:
uv run pytestRun only unit tests (fast, no network):
uv run pytest test_unit.pyRun tests excluding slow integration tests:
uv run pytest -m "not slow"The project includes a Readability Golden Set in the samples/ directory, containing texts of varying complexity (Primary, Middle, Academic, Legal).
#### Baseline Analysis You can run a baseline analysis to see how the engine scores these different levels:
uv run python baseline_analysis.pyThis script:
samples/.samples/baseline_results.json.Note: The samples are used to verify that code or logic changes (e.g., extraction or normalization) don't unintentionally shift the readability scores of known content.
Manage Python dependencies using uv and pyproject.toml.
uv add <package>uv syncThe API returns the following scores (where applicable):
null if text doesn't meet specific criteria, e.g., word count)Apache 2.0
This is not an officially supported Google product.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.