
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
@yilin-jing/mcp-json-utils
Advanced tools
JSON response utilities for MCP servers - formatting, limiting, and saving responses
JSON response utilities for MCP (Model Context Protocol) servers. Provides formatting, item limiting, and file saving capabilities for API responses.
npm install @yilin-jing/mcp-json-utils
import { JsonResponseHandler } from '@yilin-jing/mcp-json-utils';
// Create handler with custom max items (default: 10)
const jsonHandler = new JsonResponseHandler({ maxItemsForContext: 10 });
// Format a response
const result = jsonHandler.formatResponse(data, {
rawDataSaveDir: '/tmp/my_data', // Optional: save full data to file
toolName: 'get_posts', // Optional: tool name for filename
params: { featured: true } // Optional: params for filename
});
// Result is a CallToolResult with formatted markdown
The formatted response includes:
rawDataSaveDir is provided) with path and sizeExample output:
## get_posts
> **Raw data saved to**: `/tmp/my_data/get_posts_featured=true_2024-01-15T10-30-00-000Z.json` (15.2 KB)
> **Note**: `edges` limited to 10 items (25 total). Full data saved to file.
### JSON Structure
├── edges: Array[10]
│ └── [item]:
│ ├── id: string
│ ├── name: string
│ └── ...
└── pageInfo:
├── hasNextPage: boolean
└── endCursor: string
### Data (`edges`: 10/25 items)
```json
{
"edges": [...],
"pageInfo": {...}
}
JsonResponseHandlernew JsonResponseHandler(config: { maxItemsForContext: number })
formatResponse(data, options?) - Format data as MCP CallToolResultsaveRawData(data, saveDir, toolName, params?) - Save data to filelimitItems(data) - Limit large arrays in datafindLargeArrayField(data) - Find first array with >maxItems itemsgenerateJsonStructureTree(obj) - Generate tree visualizationformatFileSize(bytes) - Format bytes to human readable stringMIT
FAQs
JSON response utilities for MCP servers - formatting, limiting, and saving responses
The npm package @yilin-jing/mcp-json-utils receives a total of 5 weekly downloads. As such, @yilin-jing/mcp-json-utils popularity was classified as not popular.
We found that @yilin-jing/mcp-json-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.