Flexible Key Value Extracting Mcp Server
@KunihiroS
Overview
What is Flexible Key Value Extracting Mcp Server?
A Model Context Protocol (MCP) server that extracts key-value pairs from arbitrary, noisy, or unstructured text using GPT-4.1-mini and pydantic-ai. It ensures type safety and supports multiple output formats (JSON, YAML, TOML). Perfect extraction is not guaranteed.
How to use Flexible Key Value Extracting Mcp Server?
Requires Python 3.9+ and an OpenAI API key set in settings.json. Run python server.py. The server exposes three tools: extract_json, extract_yaml, and extract_toml. When configuring the MCP host you must specify log mode via --log=off or --log=on --logfile=<absolute path>.
Key features of Flexible Key Value Extracting Mcp Server
- Extracts key-value pairs from noisy or broken input text.
- Supports Japanese, English, and Chinese (automatic language detection).
- Uses type-safe Pydantic output validation.
- Returns results in JSON, YAML, or TOML format.
- Always returns a well-formed response, even on extraction failure.
- Employs GPT-4.1-mini for extraction, type annotation, and type evaluation.
Use cases of Flexible Key Value Extracting Mcp Server
- Extracting structured data from order confirmation emails or invoices.
- Parsing messy or unstructured text to capture key information.
- Converting free-text input into machine-readable JSON, YAML, or TOML.
- Automating data entry by pulling key-value pairs from customer messages.
FAQ from Flexible Key Value Extracting Mcp Server
What languages are supported?
Japanese, English, and Chinese (Simplified/Traditional). If the detected language is not one of these, the server returns an error.
Is perfect extraction guaranteed?
No. Extraction relies on LLMs and pydantic-ai, so perfect extraction is not guaranteed, especially with highly ambiguous or broken input.
What are the output format limitations?
TOML cannot represent arrays of objects or deeply nested structures. In such cases, complex values are stored as JSON strings in TOML. JSON and YAML can represent nested structures as-is.
What are the runtime requirements?
Python 3.9+, an OpenAI API key, and an internet connection for LLM calls. On first launch, spaCy language models are downloaded automatically, which may take extra time.
How long does processing take?
Processing time varies. A sample measurement for 200 input tokens (~400 characters) took about 15 seconds with GPT-4.1-mini. Longer inputs and network conditions can increase time.