home / mcp / kv extractor mcp server
Provides automatic key-value extraction from unstructured text with autonomous key discovery and type-safe, multi-format outputs.
Configuration
View docs{
"mcpServers": {
"kunihiros-kv-extractor-mcp-server": {
"command": "python",
"args": [
"server.py"
],
"env": {
"OPENAI_API_KEY": "YOUR_API_KEY"
}
}
}
}This MCP server automatically extracts key-value pairs from noisy or unstructured text using LLMs and enforces type-safe output in JSON, YAML, or TOML formats. It is robust to imperfect inputs and discovers keys automatically, making it suitable for diverse real-world data.
You interact with the kv-extractor-mcp-server through an MCP client to process any text you provide. The server will autonomously identify relevant keys, infer their values, and return a well-structured result in your chosen format (JSON, YAML, or TOML). You can rely on it for robust extraction from messy inputs, with language support for Japanese, English, and Chinese.
Typical usage patterns include sending a block of text to the MCP endpoint and requesting one of the supported output formats. The server prioritizes producing a complete, well-formed response even if some data cannot be extracted fully.
Prerequisites: Python 3.9+ and an OpenAI API key. The OpenAI key should be available to the server as an environment variable.
Start the server using Python:
python server.pyIf you prefer configuring the MCP host for logging, you can start the server process via the MCP command wrapper as shown below. This enables logging with an explicit log file path when needed.
"kv-extractor-mcp-server": {
"command": "pipx",
"args": ["run", "kv-extractor-mcp-server", "--log=off"],
"env": {
"OPENAI_API_KEY": "{apikey}"
}
}To enable logging with a specific log file path, use the following configuration example:
"kv-extractor-mcp-server": {
"command": "pipx",
"args": ["run", "kv-extractor-mcp-server", "--log=on", "--logfile=/workspace/logs/kv-extractor-mcp-server.log"],
"env": {
"OPENAI_API_KEY": "{apikey}"
}
}Key environment and runtime notes you should know when using this MCP server:
Provide your input text to the server and request a JSON, YAML, or TOML formatted output. The results include keys discovered from the input and their corresponding values, structured according to the chosen format.
Extracts key-value pairs from arbitrary noisy text and returns them as type-safe JSON (Python dict).
Extracts key-value pairs from arbitrary noisy text and returns them as type-safe YAML (string).
Extracts key-value pairs from arbitrary noisy text and returns them as type-safe TOML (string).