mcp

v0.4.1
@ptext/mcp Checked 1 day ago Published 26 days ago

MCP server with deterministic text tools for Claude, Cursor, Codex and other AI assistants: remove duplicate lines, CSV to JSON, extract emails, JSON format…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

ptext_suggest

Profile a text sample locally and suggest tools compatible with its shape. This does not infer the user's goal; required options may still need to be supplied. Raw text never leaves this process.

ParameterTypeDescription
input *stringText (or a representative sample) to analyse.
limitinteger

ptext_catalog

Every PText tool with its input card (when to use it, the profile signals that point to it, look-alikes, examples, options) and the meaning of each profile field that ptext_suggest returns. Static; call it once.

ptext_extract_emails Extract emails

Find all email addresses in any text (logs, HTML, CSV, chat). Supports + tags and Unicode. Use when: Any text with email addresses in it: chat, logs, HTML, mail headers, CSV rows, or a list that needs deduping and lowercasing. Not for: Only the domains are wanted → extract-domains. The emails are one column of a delimited table and the other columns matter → select-columns.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_extract_urls Extract URLs

Find http(s):// and www. links in text, trimming trailing punctuation and unbalanced brackets. Use when: Text with http(s):// or www. links in it: logs, HTML, Markdown, chat, or a list of links that needs deduping. Not for: Only the hostnames are wanted → extract-domains. Bare names like example.com with no scheme or www. are not links → extract-domains.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_extract_domains Extract domains

Extract hostnames from URLs, emails and plain text. Returns full hostnames (subdomains kept); does not compute registrable domains. Use when: Text with URLs, email addresses or bare hostnames (shop.example.com) when only the hostnames are wanted, lowercased with www. stripped and subdomains kept. Not for: The full links are wanted → extract-urls. Whole addresses → extract-emails. Registrable domains (a.b.example.co.uk is not reduced to example.co.uk).

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_extract_ip Extract IP addresses

Find valid IPv4 and IPv6 addresses (incl. compressed IPv6, IPv4-mapped IPv6 and ip:port) in text. Use when: Text with IPv4 or IPv6 addresses in it: server and access logs, firewall output, proxy lists (ip:port), config files. Only valid addresses are returned. Not for: Version strings such as 1.2.3.4 (valid IPv4, so they would be extracted). Keeping ip and port as two columns → split-columns.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_clean_lines Clean lines

Trim lines, remove empty lines, collapse repeated spaces and strip invisible characters (zero-width, BOM). Use when: Messy pasted text: stray blank lines, spaces at line ends, zero-width characters or a BOM copied from a web page, PDF or spreadsheet. Not for: Repeated lines → remove-duplicates. Keeping only some lines → filter-lines.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_remove_duplicates Remove duplicate lines

Remove duplicate lines while keeping the first occurrence and original order. Use when: A list or log where some lines repeat (emails, keywords, IDs, account rows); keeps the first copy of each line in the original order. Not for: Repeated emails or URLs inside running text, not whole lines → extract-emails / extract-urls (they dedupe too).

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_filter_lines Filter lines

Keep (or drop) lines that contain, start with, end with, equal, or match a regex pattern. Use when: Any multi-line text (logs, lists, exports) when the user wants to keep or drop lines by a word, prefix, suffix, exact value or regex. The pattern comes from the user, so it is never auto-suggested. Not for: Pulling emails, URLs or IPs out of lines → the extract-* tools.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_split_columns Split into columns

Split delimited lines (e.g. user|pass|mail, tab-separated, quoted CSV) into columns and output CSV. Use when: Delimited lines to turn into clean CSV columns: user|pass|mail dumps, user:pass or ip:port lists, tab-separated pastes from a spreadsheet, quoted CSV, key: value lines. Not for: Only some columns are wanted, or in another order → select-columns. JSON objects are wanted → csv-to-json.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_select_columns Select / reorder columns

Pick and reorder columns by 1-based index ("3,1", "2-4", "-1" = last cell of each row) from delimited text. Use when: Delimited lines (pipe, tab, comma, semicolon, colon) when only some columns are wanted or their order must change, e.g. the 3rd column of user|pass|mail. The user gives the columns. Not for: Every column, just split → split-columns. Emails scattered in free text, not in a column → extract-emails.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_list_to_csv List → CSV

Turn a plain list (one item per line) into a single-column CSV, quoting values safely. Use when: A plain list, one item per line with no field separator (keywords, names, IDs), to put in a single-column CSV with safe quoting. Not for: Lines that already hold several fields → split-columns. Text an extract or clean tool can handle (list-to-csv is a weak 0.35 fallback).

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_csv_to_json CSV → JSON

Convert CSV/TSV (quoted fields supported) into a JSON array of objects (with header) or arrays. Use when: A CSV, TSV or semicolon table, usually with a header row, to turn into JSON (objects keyed by the header, or arrays). Not for: Pipe or colon lists such as user|pass → split-columns. Converting JSON back to CSV (not supported).

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_base64 Base64 encode / decode

Encode text to Base64 or decode Base64 (standard or URL-safe) to UTF-8 text. Decoded content is only returned as text, never executed. Use when: A Base64 or Base64url string, one blob or wrapped over many lines (MIME, PEM body), that decodes to readable UTF-8 text. Also any text the user wants encoded (direction=encode). Not for: Hex hashes, UUIDs and binary payloads such as images (they do not decode to text). A whole JWT: it is three Base64url parts joined by dots, decode one part at a time.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_url_encode URL encode / decode

Percent-encode or decode text (component or full-URI mode). Decoding "+" as space is supported in form mode. Use when: Percent-encoded text to decode, such as query strings, encoded URLs or form bodies (%20, %C3%A0, + as space in form mode). Also any text to encode (direction=encode). Not for: Base64 strings → base64. HTML entities such as & are not percent-encoding.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject

ptext_json_format JSON validate / beautify / minify

Validate JSON and pretty-print or minify it. Reports line and column of syntax errors. Use when: One JSON document (object or array) to validate, pretty-print or minify, or broken JSON whose syntax error needs locating (line and column). Not for: JSON Lines / NDJSON (one object per line, so not one document). CSV to JSON → csv-to-json.

ParameterTypeDescription
input *stringThe raw text to process.
optionsobject