custom-context-mcp
This Model Context Protocol (MCP) server provides tools for structuring and extracting data from text according to JSON templates.
Documentation
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
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\": \"\", \"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\": \"\", \"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
1. Define a JSON template with placeholders:
{
"item": {
"name": "",
"price": "",
"description": ""
}
}2. Use `group-text-by-json` to create a prompt for AI:
3. 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 ink4. Use `text-to-json` to convert the grouped text to JSON:
{
"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: ``, ``, ``, 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": "",
"category": ""
},
"pricing": {
"amount": "",
"currency": "USD"
}
},
"metadata": {
"timestamp": "2023-09-01T12:00:00Z"
}
}Implementation Details
The server works by:
1. Analyzing JSON templates to extract placeholder keys
2. Generating prompts that guide AI models to extract information by these keys
3. Parsing AI-generated text to extract key-value pairs
4. 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 rebuilding
- `package.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:
1. TypeScript files are automatically rebuilt when changed
2. The MCP server restarts with the updated code
3. 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.
Frequently asked questions
What is custom-context-mcp?
custom-context-mcp is This Model Context Protocol (MCP) server provides tools for structuring and extracting data from text according to JSON templates.
How do I install custom-context-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is custom-context-mcp open source?
Yes — it is hosted on GitHub at https://github.com/omer-ayhan/custom-context-mcp and has 1 stars.
Related MCP tools
🍒 Cherry Studio is a desktop client that supports for multiple LLM providers. Built for the Model Context Protocol to enhance AI capabilities.
Enhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini...
FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, ...
Composio equips your AI agents & LLMs with 100+ high-quality integrations via function calling for the Model Context Protocol. Enhance AI assistants with powerf
📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Lan...
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Ag...
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP