Custom Context MCP Server
The Custom Context MCP Server transforms unstructured text into structured JSON formats based on predefined templates. It offers:
Text-to-JSON Transformation: Convert AI-generated text into structured JSON objects using templates with placeholders
Information Extraction: Intelligently extract key-value pairs from unstructured text
Complex Template Support: Handle arbitrary JSON structures with nested placeholders at any level
Workflow Automation: Process AI outputs into structured data for downstream applications
Development Tools: Features like hot reloading and MCP Inspector for debugging
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Custom Context MCP Server group this product review into JSON with template: {"product": {"name": "<name>", "rating": "<rating>", "comment": "<comment>"}}"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Custom Context MCP Server
This Model Context Protocol (MCP) server provides tools for structuring and extracting data from text according to JSON templates.
Features
Text-to-JSON Transformation
Group and structure text based on JSON templates with placeholders
Extract information from AI-generated text into structured JSON formats
Support for any arbitrary JSON structure with nested placeholders
Intelligent extraction of key-value pairs from text
Process AI outputs into structured data for downstream applications
Related MCP server: Unstructured Document Processor MCP
Getting Started
Installation
npm installRunning the server
npm startFor development with hot reloading:
npm run dev:watchUsage
This MCP server provides two main tools:
1. Group Text by JSON (group-text-by-json)
This tool takes a JSON template with placeholders and generates a prompt for an AI to group text according to the template's structure.
{
"template": "{ \"type\": \"<type>\", \"text\": \"<text>\" }"
}The tool analyzes the template, extracts placeholder keys, and returns a prompt that guides the AI to extract information in a key-value format.
2. Text to JSON (text-to-json)
This tool takes the grouped text output from the previous step and converts it into a structured JSON object based on the original template.
{
"template": "{ \"type\": \"<type>\", \"text\": \"<text>\" }",
"text": "type: pen\ntext: This is a blue pen"
}It extracts key-value pairs from the text and structures them according to the template.
Example Workflow
Define a JSON template with placeholders:
{ "item": { "name": "<name>", "price": "<price>", "description": "<description>" } }Use
group-text-by-jsonto create a prompt for AI:The tool identifies placeholder keys: name, price, description
Generates a prompt instructing the AI to group information by these keys
Send the prompt to an AI model and receive grouped text:
name: Blue Pen price: $2.99 description: A smooth-writing ballpoint pen with blue inkUse
text-to-jsonto convert the grouped text to JSON:Result:
{ "item": { "name": "Blue Pen", "price": "$2.99", "description": "A smooth-writing ballpoint pen with blue ink" } }
Template Format
Templates can include placeholders anywhere within a valid JSON structure:
Use angle brackets to define placeholders:
<name>,<type>,<price>, etc.The template must be a valid JSON string
Placeholders can be at any level of nesting
Supports complex nested structures
Example template with nested placeholders:
{
"product": {
"details": {
"name": "<name>",
"category": "<category>"
},
"pricing": {
"amount": "<price>",
"currency": "USD"
}
},
"metadata": {
"timestamp": "2023-09-01T12:00:00Z"
}
}Implementation Details
The server works by:
Analyzing JSON templates to extract placeholder keys
Generating prompts that guide AI models to extract information by these keys
Parsing AI-generated text to extract key-value pairs
Reconstructing JSON objects based on the original template structure
Development
Prerequisites
Node.js v18 or higher
npm or yarn
Build and Run
# Install dependencies
npm install
# Build the project
npm run build
# Run the server
npm start
# Development with hot reloading
npm run dev:watchCustom Hot Reloading
This project includes a custom hot reloading setup that combines:
nodemon: Watches for file changes in the src directory and rebuilds TypeScript files
browser-sync: Automatically refreshes the browser when build files change
Concurrent execution: Runs both services simultaneously with output synchronization
The setup is configured in:
nodemon.json: Controls TypeScript watching and rebuildingpackage.json: Uses concurrently to run nodemon and browser-sync together
To use the custom hot reloading feature:
npm run dev:watchThis creates a development environment where:
TypeScript files are automatically rebuilt when changed
The MCP server restarts with the updated code
Connected browsers refresh to show the latest changes
Using with MCP Inspector
You can use the MCP Inspector for debugging:
npm run devThis runs the server with the MCP Inspector for visual debugging of requests and responses.
Available Tools
2 toolsgroup-text-by-jsonC
Gives a prompt text for AI to group text based on JSON placeholders. This tool accepts a JSON template with placeholders.
Inputs: template (required).
text-to-jsonB
Converts groupped text from group-text-by-json tool to JSON. This tool accepts a JSON template with placeholders and groupped text from group-text-by-json tool.
Inputs: template (required), text (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: group-text-by-json prepares text for grouping based on a JSON template, while text-to-json converts that grouped text into JSON. There is no overlap or ambiguity between them, as they represent sequential steps in a workflow.
Both tools follow a consistent verb-noun pattern with hyphens (group-text-by-json and text-to-json), clearly indicating their actions and targets. The naming is predictable and readable across the set.
With only 2 tools, the server feels thin for its apparent purpose of custom context management. This minimal set may limit functionality and require agents to work around gaps, as typical context-related operations might include more than just grouping and conversion.
The tool surface is severely incomplete for a custom context server. It lacks core operations such as creating, updating, deleting, or retrieving context entries, and only covers a narrow text-to-JSON conversion workflow, leaving significant gaps that will likely cause agent failures.
Maintenance
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
Related MCP Servers
- AlicenseCqualityFmaintenanceA Model Context Protocol server implementation that enables LLMs to query and manipulate JSON data using JSONPath syntax with extended operations for filtering, sorting, transforming, and aggregating data.245 npm90MIT
- FlicenseBqualityDmaintenanceA Model Context Protocol server that enables LLMs to extract and use content from unstructured documents across a wide variety of file formats.111-
- AlicenseAqualityDmaintenanceA Model Context Protocol server for querying large JSON files using JSONPath expressions, enabling LLMs to efficiently search and extract information from large JSON data.311MIT
- -licenseBqualityNot gradedmaintenanceA Model Context Protocol server that enables AI models to extract structured data from websites through the extract\_structured\_data tool.146 npm-