stringbox-mcp
1.2.0
dotnet tool install --global stringbox-mcp --version 1.2.0
dotnet new tool-manifest
dotnet tool install --local stringbox-mcp --version 1.2.0
#tool dotnet:?package=stringbox-mcp&version=1.2.0
nuke :add-package stringbox-mcp --version 1.2.0
StringBox
A high-performance .NET 10 MCP server that gives AI coding agents 88 text, JSON, encoding, hashing, and crypto utility functions. Designed to eliminate the token waste agents create with ad-hoc Python scripts and inline transformations.
Why
Agents waste tokens on trivial operations. They either burn context explaining Python one-liners or hallucinate base64 output. StringBox solves this by exposing deterministic functions through MCP.
Only two MCP tools are registered -- run and help. This keeps per-message token overhead under 100 tokens regardless of how many functions exist. Most function names are self-explanatory (base64_enc, snake_case, md5) so agents call them without consulting help first.
Install
.NET Global Tool
dotnet tool install -g stringbox-mcp
Native Binary
Download from GitHub Releases -- no .NET runtime required.
MCP Configuration
Claude Code
claude mcp add stringbox-mcp -- stringbox-mcp
Claude Desktop / Cursor / VS Code
Add to your MCP config file:
{
"mcpServers": {
"stringbox": {
"command": "stringbox-mcp"
}
}
}
How It Works
Tool 1: run(fn, input, opts?)
Executes a named function. The tool description contains a compact list of all 88 function names (~160 tokens). An agent sees snake_case in the list, knows what it does, and calls run("snake_case", "myVariableName") directly.
inputis always a string (the primary data to operate on)optsis an optional JSON object with named parameters- output is always a string (the result)
- errors return
{"error": "message", "usage": "expected usage"}
Tool 2: help(topic?)
On-demand documentation. Only called when the agent needs parameter details for complex functions.
help()-- category overviewhelp("json")-- all functions in that categoryhelp("regex_replace")-- detailed docs with parameters and examples
Help is also available via run: run("help", "json") or run("help:json", "").
Examples
run("snake_case", "myVariableName") -> "my_variable_name"
run("base64_enc", "hello world") -> "aGVsbG8gd29ybGQ="
run("sha256", "hello") -> "2cf24dba5fb0a30..."
run("json_query", '{"users":[{"name":"Alice"}]}',
{"path": "$.users[0].name"}) -> "\"Alice\""
run("regex_replace", "foo123bar",
{"pattern": "\\d+", "replacement": "NUM"}) -> "fooNUMbar"
run("hmac", "message",
{"algorithm": "sha256", "key": "secret"}) -> "8b5f48702995c159..."
run("uuid", "") -> "550e8400-e29b-41d4-..."
run("json_flatten", '{"a":{"b":1,"c":{"d":2}}}') -> '{"a.b":1,"a.c.d":2}'
run("aes_encrypt", "secret data",
{"key": "<64-char hex>"}) -> '{"ciphertext":"...","nonce":"...","tag":"..."}'
Function Reference
Case (8)
All case functions auto-detect the source convention (camel, snake, kebab, spaces, mixed, consecutive uppercase like XMLParser) and convert correctly.
| Function | Description | Example |
|---|---|---|
camel_case |
Convert to camelCase | "XMLParser" → "xmlParser" |
pascal_case |
Convert to PascalCase | "my_variable_name" → "MyVariableName" |
snake_case |
Convert to snake_case | "myVariableName" → "my_variable_name" |
kebab_case |
Convert to kebab-case | "myVariableName" → "my-variable-name" |
screaming_snake |
Convert to SCREAMING_SNAKE_CASE | "myVariableName" → "MY_VARIABLE_NAME" |
dot_case |
Convert to dot.case | "MyVariableName" → "my.variable.name" |
title_case |
Convert to Title Case | "hello world" → "Hello World" |
sentence_case |
Convert to Sentence case | "HELLO WORLD." → "Hello world." |
String (19)
| Function | Description | Opts |
|---|---|---|
trim |
Remove whitespace or specified chars from both ends | chars? |
trim_start |
Remove from start only | chars? |
trim_end |
Remove from end only | chars? |
pad_left |
Pad to width on the left | width, char? (default " ") |
pad_right |
Pad to width on the right | width, char? (default " ") |
truncate |
Truncate to length with suffix | length, suffix? (default "...") |
reverse |
Reverse the string (grapheme-aware) | |
repeat |
Repeat count times | count |
replace |
Replace all occurrences | old, new, ignore_case? |
remove |
Remove all occurrences | value, ignore_case? |
substring |
Extract substring | start, length? |
split |
Split into JSON array | separator, limit? |
join |
Join JSON array into string | separator |
slugify |
URL-friendly slug | |
indent |
Indent all lines | spaces? (default 2), char? |
dedent |
Remove common leading whitespace | |
collapse_whitespace |
Collapse runs of whitespace to single space | |
lines |
Split into JSON array of lines | |
wrap |
Word-wrap at width | width |
Regex (6)
All regex functions use a 5-second timeout to prevent catastrophic backtracking.
| Function | Description | Opts |
|---|---|---|
regex_match |
First match as JSON {match, index, groups} |
pattern, ignore_case? |
regex_match_all |
All matches as JSON array | pattern, ignore_case? |
regex_replace |
Replace with group refs ($1, $2) |
pattern, replacement, ignore_case? |
regex_test |
Returns "true" or "false" |
pattern, ignore_case? |
regex_extract |
Capture groups as JSON array. No groups? Returns all full matches | pattern, ignore_case? |
regex_split |
Split by regex | pattern, limit? |
Encoding (13)
| Function | Description |
|---|---|
base64_enc |
Encode to base64 |
base64_dec |
Decode from base64 |
base64url_enc |
URL-safe base64 (no padding, -_ instead of +/) |
base64url_dec |
Decode URL-safe base64 |
url_enc |
Percent-encode (RFC 3986) |
url_dec |
Percent-decode |
html_enc |
Encode HTML entities (&, <, >, ", ') |
html_dec |
Decode HTML entities |
hex_enc |
Encode bytes as lowercase hex |
hex_dec |
Decode hex to UTF-8 |
unicode_escape |
Convert to \uXXXX notation |
unicode_unescape |
Convert \uXXXX back to chars |
jwt_decode |
Decode JWT payload (no signature verification) |
Hash (11)
| Function | Description | Opts |
|---|---|---|
md5 |
MD5 hex digest | |
sha1 |
SHA-1 hex digest | |
sha256 |
SHA-256 hex digest | |
sha384 |
SHA-384 hex digest | |
sha512 |
SHA-512 hex digest | |
hmac |
HMAC hex digest | algorithm (md5/sha1/sha256/sha384/sha512), key |
uuid |
Generate UUID v4 (input ignored) | |
uuid7 |
Generate UUID v7 timestamp-sortable (input ignored) | |
random_bytes |
Random bytes as hex (input ignored) | length |
random_string |
Random string (input ignored) | length, charset? (alphanumeric/alpha/numeric/hex/base64 or custom) |
crc32 |
CRC32 checksum as hex |
JSON (13)
Uses JsonPath.Net for JSONPath queries per RFC 9535.
| Function | Description | Opts |
|---|---|---|
json_query |
JSONPath query | path |
json_flatten |
Flatten nested object to dot-notation | separator? (default ".") |
json_unflatten |
Reverse of flatten | separator? (default ".") |
json_pick |
Keep only specified top-level fields | fields (JSON array) |
json_omit |
Remove specified top-level fields | fields (JSON array) |
json_sort_keys |
Sort object keys alphabetically | recursive? (default true) |
json_minify |
Remove all whitespace | |
json_prettify |
Pretty-print | indent? (default 2) |
json_merge |
Deep merge (RFC 7386, patch wins) | patch (JSON object) |
json_diff |
Compare and return differences (RFC 6902-style) | other (JSON) |
json_to_csv |
JSON array of objects to CSV | delimiter?, headers? |
csv_to_json |
CSV to JSON array of objects | delimiter?, headers? |
json_schema |
Infer JSON Schema from data |
Text (7)
| Function | Description | Opts |
|---|---|---|
count |
{char_count, word_count, line_count, byte_count} |
|
diff |
Line diff (unified or inline) via LCS | other, format? (unified/inline) |
char_frequency |
Character frequency map sorted descending | |
unique_lines |
Remove duplicate lines, preserve order | ignore_case? |
sort_lines |
Sort lines | descending?, numeric?, ignore_case? |
filter_lines |
Keep lines matching pattern | pattern, regex?, invert? |
number_lines |
Prepend line numbers | start? (default 1), separator? (default ": ") |
Crypto (11)
| Function | Description | Opts |
|---|---|---|
aes_encrypt |
AES-256-GCM encrypt | key (64-char hex or base64 32 bytes; tip: use sha256 of a passphrase), nonce? (auto-generated if omitted) |
aes_decrypt |
AES-256-GCM decrypt (input is base64 ciphertext) | key, nonce, tag? (if omitted, last 16 bytes of input) |
cert_info |
Parse PEM/DER cert → JSON (subject, issuer, SANs, fingerprints) | |
cert_chain |
Parse PEM bundle → JSON array of cert summaries | |
cert_expiry |
Expiry date and days remaining | |
pem_to_der |
PEM to base64-encoded DER | type? (cert/key) |
der_to_pem |
Base64 DER to PEM | type? (cert/key) |
pfx_to_pem |
Base64 PKCS#12 to PEM bundle | password? |
csr_info |
Parse PEM CSR → JSON (subject, key algorithm) | |
key_info |
Parse PEM key → JSON (algorithm, size, curve) | |
generate_keypair |
Generate RSA or EC keypair (input ignored) | algorithm (rsa/ec), size? (RSA: 2048, EC: 256/384/521) |
CLI
StringBox also ships as a standalone CLI tool:
dotnet tool install -g sbox
Building from Source
git clone https://github.com/Jabe/StringBox.git
cd StringBox
dotnet build
dotnet test
Native AOT
dotnet publish src/StringBox.Cli -c Release -r osx-arm64 --self-contained -p:PublishAot=true
dotnet publish src/StringBox.Mcp -c Release -r osx-arm64 --self-contained -p:PublishAot=true
Supported RIDs: osx-arm64, linux-x64, win-x64.
Architecture
StringBox.sln
├── src/
│ ├── StringBox/ # Core library (88 pure functions, zero dependencies on MCP)
│ │ └── Functions/ # One file per category
│ ├── StringBox.Cli/ # CLI tool (assembly: sbox)
│ └── StringBox.Mcp/ # MCP server (assembly: stringbox-mcp)
│ └── Tools/ # run + help MCP tool definitions
└── tests/
└── StringBox.Tests/ # 226 tests, one file per category
The core library is separate from the MCP server so the functions can be used as a NuGet package independently:
dotnet add package StringBox
var registry = new FunctionRegistry();
var result = registry.Execute("snake_case", "myVariableName", null);
// "my_variable_name"
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.