mcp-ml-tools
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_ML_TOOLS_CONFIG | No | Path to the JSON configuration file. Settings are applied in this order, later ones winning: defaults, JSON configuration file, environment variables, command line flags. | |
| MCP_ML_TOOLS_HTTP_HOST | No | HTTP host to bind to when running in Streamable HTTP mode. | 127.0.0.1 |
| MCP_ML_TOOLS_HTTP_PORT | No | HTTP port to bind to when running in Streamable HTTP mode. | 3333 |
| MCP_ML_TOOLS_MAX_FILES | No | Maximum number of files per call. | 1000 |
| MCP_ML_TOOLS_HTTP_TOKEN | No | Bearer token required for HTTP mode. When set, requests must include Authorization: Bearer <token>. | |
| MCP_ML_TOOLS_DOCUMENT_ROOT | No | Allowlisted document root for filesystem access. No disk access is enabled unless this is configured. A relative documentRoot in a configuration file is resolved against the file's directory. | |
| MCP_ML_TOOLS_MAX_FILE_BYTES | No | Maximum bytes per file. | 1000000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Machine learning engineering tools: token counting and cost estimates, BM25 search, paired significance testing for evaluation scores, JSON Schema validation, and prompt-injection and PII scanning. All tools are deterministic and read-only.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| tokenizeA | Tokenizes text with the bundled byte-level BPE (exact counts and token ids for that vocabulary), and estimates token counts and United States dollar cost for common model families from the configured price table. Per-model counts are character-based approximations, not the providers' tokenizers. |
| bm25_searchA | Builds an Okapi BM25 index over documents passed inline and/or loaded from a directory inside the configured documentRoot, then returns the top-k documents with scores, matched terms, and snippets. Disk access is disabled unless documentRoot is configured. |
| eval_compareA | Paired comparison of model A and model B on the same examples: mean difference (B minus A), seeded paired bootstrap confidence interval and two-sided p-value, win/tie counts, and McNemar's test (exact and chi-square) when every score is 0 or 1. |
| json_schema_validateA | Validates a JSON document (or raw model output text, optionally wrapped in a Markdown code fence) against a JSON Schema using Ajv with formats. Returns every error with a JSON Pointer and JSONPath to the offending value, or the line and column of a parse error. Supports draft-07, 2019-09, and 2020-12 (detected from $schema). |
| prompt_injection_scanA | Rule-based scan of untrusted text (retrieved documents, tool output, user input) for prompt-injection phrasing, exfiltration patterns, hidden characters, secrets, and personal information. Returns findings with character spans, a 0 to 1 risk score, and optionally a redacted copy of the text. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| prices | Price table used by the tokenize tool (United States dollars per million tokens) |
| tool-documentation | Usage notes, parameters, and examples for every tool |
| configuration | The active configuration (filesystem allowlist, limits, price models); secrets omitted |
| metrics | Per-tool call counts, error counts, and total latency for this server process |
TDQS
Scored across 5 tools
Each tool targets a clearly distinct operation: token counting/costing, BM25 retrieval, paired evaluation statistics, JSON Schema validation, and prompt-injection scanning. There is no meaningful overlap in input type or output, so an agent can select the right tool unambiguously from the name alone.
All names use snake_case, which is consistent, but the grammatical pattern varies: 'tokenize' is a bare verb while the others are noun_verb or noun_noun_verb compounds ('bm25_search', 'json_schema_validate'). This is a minor deviation that stays readable and predictable.
Five tools is a compact, well-scoped set with no padding or redundant entries. For a broad 'ml-tools' label it is slightly thin, but each tool clearly earns its place as a distinct utility.
The surface covers a coherent slice of LLM-app utilities (tokenize, retrieve, evaluate, validate, screen), and each tool is self-contained. However, obvious gaps remain for an ML toolkit: no embedding/vector retrieval (BM25 only), no model invocation, and no general metrics beyond paired comparison.