Text To JSON MCP

MCP开发工具

提供方 chiragdarji · 包名 text-to-json-mcp

开发工具 stdio · 本地进程 OAuth 授权 社区 / 第三方 Cursor
查看接入方式

一个本地运行的MCP服务器,使用Zod模式将文本提示转换为结构化的JSON,帮助开发者和AI助手将非结构化文本转换为定义良好且经过验证的数据结构。

一句话选型结论

按资料字段整理

Text To JSON MCP 属于开发工具类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Cursor,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类开发工具 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 3 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

开发工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量3暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

文本处理JavaScript本地部署JSON转换开发工具本地运行IDE集成

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
npx text-to-json-mcp --help

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 3 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
代码与仓库操作

在对话里直接查代码、提 issue、走 PR,省掉来回切工具。

本地命令与脚本

把构建、测试、格式化这类重复命令交给模型执行。

接口联调与测试

让模型调你的接口、跑一遍用例,快速定位问题。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 3 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Text To JSON MCP当前 3 stdio · 本地进程 本地部署 有 2026-05-17
Git 838e2ec1 12 stdio · 本地进程 本地部署 有 2026-05-17
Markitdown MCP 2c653a5f 1 stdio · 本地进程 本地部署 有 2026-05-17
JavaGuide 未标注 stdio · 本地进程 本地部署 有 2026-04-11
awesome-claude-skills 未标注 stdio · 本地进程 本地部署 有 2026-04-26
Context7 831acf40 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

开发工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方chiragdarji上游标注的维护方 chiragdarji
分类开发工具本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时text-to-json-mcp · Node.js本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

15.3 KB
来自项目仓库与上游目录的原文,未做删改

文本到JSON MCP服务器

一个本地MCP(模型上下文协议)服务器,使用Zod模式将文本提示转换为结构化JSON。该工具可帮助开发人员和人工智能助手将非结构化文本结构化为定义良好、经过验证的数据结构。

特性

  • 将提示转换为JSON:将自然语言提示转换为具有任务、意图、输入、输出和清晰度差距的结构化JSON
  • 查找清晰度差距:识别文本提示中缺失的细节、歧义和需要改进的地方
  • 优化提示:生成更清晰、更具体的输入提示版本
  • 本地优先:完全在本地计算机上运行,不依赖于云
  • IDE集成:与Cursor、VSCode和其他MCP兼容编辑器无缝集成
  • CLI接口:用于快速文本处理和测试的命令行界面

安装

地方发展```bash

Clone the repository

git clone https://github.com/chiragdarji/text-to-json-mcp.git
cd text-to-json-mcp

Install dependencies

npm install

Start development server

npm run dev


### 全球安装```bash
# Install globally
npm install -g text-to-json-mcp

# Or use npx (recommended)
npx text-to-json-mcp --help

用法

CLI命令```bash

Convert text to structured JSON

npx text-to-json-mcp convert "Create a user authentication system with login and registration"

Find clarity gaps in text

npx text-to-json-mcp gaps "Make something good"

Refine text for better clarity

npx text-to-json-mcp refine "Build a website"

Start MCP server for IDE integration

npx text-to-json-mcp server

Show help

npx text-to-json-mcp help


### 输出示例

**输入**: `"Create a user authentication system with login and registration"`

**输出**:```json
{
"success": true,
"data": {
"task": "Create a user authentication system with login and registration",
"intent": "To fulfill the specified requirements and deliver the requested output",
"inputs": {
"required": [
"Input text or prompt",
"Context or background information"
],
"optional": [
"Additional context",
"Preferences or style guidelines"
],
"constraints": [
"Available time and resources",
"Technical limitations"
]
},
"outputs": {
"primary": "Catalog",
"secondary": [
"Documentation or instructions",
"Quality assurance metrics"
],
"format": "JSON"
},
"clarity_gaps": [
"Missing specific authentication methods (JWT, OAuth, etc.)",
"Unclear user data requirements and validation",
"Missing security requirements and password policies"
]
},
"processing_time_ms": 15
}

MCP集成

光标IDE设置

  1. 安装软件包:```bash
    npm install -g text-to-json-mcp

1. **在游标中配置MCP**:

- 打开光标设置
- 导航到MCP配置
- 添加以下配置:```json
{
"mcpServers": {
"text-to-json-mcp": {
"command": "npx",
"args": ["text-to-json-mcp", "server"],
"env": {}
}
}
}
  1. 重新启动游标 加载MCP服务器

  2. 在游标中使用:```
    /mcp text-to-json-mcp convertPromptToJson "Create a user authentication system with login and registration"


### VSCode设置

1. 安装VSCode的MCP扩展
1. 在工作区设置中配置MCP服务器
1. 使用与上述相同的配置格式

## API方法

### 1. `convertPromptToJson`

将原始文本转换为结构化JSON。

**输入**: `{ "text": "your prompt here" }`

**输出**:具有任务、意图、输入、输出和清晰度差距的结构化JSON。

### 2. `findClarityGaps`

识别提示中缺少的细节或歧义。

**输入**: `{ "text": "your prompt here" }`

**输出**:类别、描述、建议和严重程度方面的一系列清晰度差距。

### 3. `refinePrompt`

建议输入提示的更清晰版本。

**输入**: `{ "text": "your prompt here" }`

**输出**:原始提示、精炼提示和改进列表。

## 发展

### 项目结构```
text-to-json-mcp/
├── src/
│   └── index.js          # Main MCP server implementation
├── utils/
│   ├── gapAnalysis.js    # Text analysis utilities
│   └── promptProcessor.js # Prompt processing logic
├── schema.js             # Zod schema definitions
├── cli.js                # CLI entrypoint
├── package.json          # Package configuration
├── README.md             # This file
├── LICENSE               # MIT license
└── mcp.json             # Example MCP configuration

可用脚本```bash

npm start # Start the MCP server
npm run dev # Start with nodemon for development
npm test # Run tests
npm run lint # Run ESLint
npm run format # Format code with Prettier


### 添加新方法

1. 在中定义架构 `schema.js`
1. 在适当的实用程序文件中实现逻辑
1. 在中添加方法处理程序 `src/index.js`
1. 更新中的CLI界面 `cli.js`
1. 添加测试和文档

## 向NPM发布

### 先决条件

1. **NPM账户**:在以下网址创建帐户 npmjs.com
1. **登录**: `npm login` 在您的终端
1. **包名**:确保包名称可用

### 发布步骤```bash
# 1. Test the package locally
npm install -g .

# 2. Test CLI functionality
text-to-json-mcp --help

# 3. Update version (patch, minor, or major)
npm version patch

# 4. Publish to npm
npm publish --access public

版本管理```bash

npm version patch # 1.0.0 → 1.0.1 (bug fixes)
npm version minor # 1.0.0 → 1.1.0 (new features)
npm version major # 1.0.0 → 2.0.0 (breaking changes)


## 用例

- **AI快速工程**:在发送给AI模型之前,对提示进行结构化和验证
- **需求分析**:将自然语言要求转换为结构化格式
- **文档**:根据文本描述生成一致的文档模板
- **质量保证**:识别不清楚或不完整的规格
- **团队协作**:规范开发团队之间的沟通格式
- **实时开发**:活动编码会话期间的结构要求和任务

## 实时软件开发示例

### 示例1:主动编码过程中的特征开发

**场景**:当您的团队领导要求您添加新功能时,您正在构建用户身份验证系统。

**原始请求**: *“我们需要在身份验证系统中添加密码重置功能。用户应该能够通过电子邮件请求重置链接并设置新密码。确保它是安全的,并遵循我们现有的模式。”*

**在Cursor中使用文本到json-mcp**:```
/mcp text-to-json-mcp convertPromptToJson "We need to add password reset functionality to the auth system. Users should be able to request a reset link via email and set a new password. Make sure it's secure and follows our existing patterns."

结构化输出:```json
{
"success": true,
"data": {
"task": "Add password reset functionality to the auth system",
"intent": "To fulfill the specified requirements and deliver the requested output",
"inputs": {
"required": [
"Input text or prompt",
"Context or background information"
],
"optional": [
"Additional context",
"Preferences or style guidelines"
],
"constraints": [
"Available time and resources",
"Technical limitations"
]
},
"outputs": {
"primary": "System",
"secondary": [
"Documentation or instructions",
"Quality assurance metrics"
],
"format": "JSON"
},
"clarity_gaps": [
"Missing specific security requirements (token expiration, rate limiting)",
"Unclear email template requirements",
"Missing integration points with existing auth flow"
]
},
"processing_time_ms": 12
}


**下一步-找出清晰度差距**:```
/mcp text-to-json-mcp findClarityGaps "We need to add password reset functionality to the auth system. Users should be able to request a reset link via email and set a new password. Make sure it's secure and follows our existing patterns."

差距分析输出:```json
{
"success": true,
"gaps": [
{
"category": "missing_constraints",
"description": "Missing constraint: \"secure\"",
"suggestion": "Specify limits, boundaries, or specific criteria for \"secure\"",
"severity": "high"
},
{
"category": "unclear_output",
"description": "Unclear output: \"system\"",
"suggestion": "Specify the exact format, structure, and content of the \"system\"",
"severity": "medium"
}
],
"overall_clarity_score": 70
}


**最后一步-细化请求**:```
/mcp text-to-json-mcp refinePrompt "We need to add password reset functionality to the auth system. Users should be able to request a reset link via email and set a new password. Make sure it's secure and follows our existing patterns."

精炼输出:```json
{
"success": true,
"original_prompt": "We need to add password reset functionality to the auth system...",
"refined_prompt": "Context: This request is for adding password reset functionality to an existing authentication system. We need to add password reset functionality to the auth system. Users should be able to request a reset link via email and set a new password. The output should be in [specific format] with [specific structure] and include [specific content]. Constraints: [specify time limits, resource constraints, technical limitations].",
"improvements": [
{
"type": "clarity",
"description": "Added context section",
"before": "We need to add password reset functionality...",
"after": "Context: This request is for adding password reset functionality to an existing authentication system. We need to add password reset functionality..."
},
{
"type": "structure",
"description": "Added specific output requirements",
"before": "Make sure it's secure and follows our existing patterns.",
"after": "The output should be in [specific format] with [specific structure] and include [specific content]."
},
{
"type": "completeness",
"description": "Added constraints section",
"before": "Make sure it's secure and follows our existing patterns.",
"after": "Constraints: [specify time limits, resource constraints, technical limitations]."
}
]
}


### 示例2:调试会话期间的错误修复

**场景**:您正在调试一个生产问题,需要快速为您的团队构建问题描述。

**原始请求**: *“登录API为某些用户返回了500个错误。当他们的电子邮件地址中有特殊字符时,似乎会发生这种情况。我们需要尽快修复此问题,因为它会阻止客户访问。”*

**将文本转换为json-mcp**:```
/mcp text-to-json-mcp convertPromptToJson "The login API is returning 500 errors for some users. It seems to happen when they have special characters in their email addresses. We need to fix this ASAP because it's blocking customer access."

结构化输出:```json
{
"success": true,
"data": {
"task": "Fix login API 500 errors for users with special characters in email addresses",
"intent": "To resolve production blocking issue and restore customer access",
"inputs": {
"required": [
"Input text or prompt",
"Context or background information"
],
"optional": [
"Additional context",
"Preferences or style guidelines"
],
"constraints": [
"Available time and resources",
"Technical limitations"
]
},
"outputs": {
"primary": "API",
"secondary": [
"Documentation or instructions",
"Quality assurance metrics"
],
"format": "JSON"
},
"clarity_gaps": [
"Missing specific error details and stack traces",
"Unclear which special characters are problematic",
"Missing user impact metrics and urgency level"
]
},
"processing_time_ms": 8
}


### 示例3:代码审查反馈结构

**场景**:您正在审查一个pull请求,并希望系统地组织您的反馈。

**原始请求**: *此服务层中的错误处理不一致。有些方法返回null,有些方法抛出异常,有些方法返回空对象。我们应该在所有方法中对此进行标准化*

**将文本转换为json-mcp**:```
/mcp text-to-json-mcp convertPromptToJson "The error handling in this service layer is inconsistent. Some methods return null, others throw exceptions, and some return empty objects. We should standardize this across all methods."

结构化输出:```json
{
"success": true,
"data": {
"task": "Standardize error handling across service layer methods",
"intent": "To create consistent error handling patterns for better maintainability",
"inputs": {
"required": [
"Input text or prompt",
"Context or background information"
],
"optional": [
"Additional context",
"Preferences or style guidelines"
],
"constraints": [
"Available time and resources",
"Technical limitations"
]
},
"outputs": {
"primary": "Layer",
"secondary": [
"Documentation or instructions",
"Quality assurance metrics"
],
"format": "JSON"
},
"clarity_gaps": [
"Missing specific error handling strategy (null vs exceptions vs empty objects)",
"Unclear scope of methods to be updated",
"Missing migration plan for existing code"
]
},
"processing_time_ms": 10
}


### 示例4:Sprint计划和任务分解

**场景**:在冲刺计划期间,您需要快速构建利益相关者的新功能请求。

**原始请求**: *“我们需要一个仪表板,显示用户分析,包括登录频率、功能使用和保留指标。它应该是实时的,可以导出到CSV。设计团队希望它与我们的新设计系统相匹配。”*

**将文本转换为json-mcp**:```
/mcp text-to-json-mcp convertPromptToJson "We need a dashboard that shows user analytics including login frequency, feature usage, and retention metrics. It should be real-time and exportable to CSV. The design team wants it to match our new design system."

结构化输出:json { "success": true, "data": { "task": "Create user analytics dashboard with real-time data and CSV export", "intent": "To provide stakeholders with comprehensive user behavior insights", "inputs": { "required": [ "Input text or prompt", "Context or background information" ], "optional": [ "Additional context", "Preferences or style guidelines" ], "constraints": [ "Available time and resources", "Technical limitations" ] }, "outputs": { "primary": "Dashboard", "secondary": [ "Documentation or instructions", "Quality assurance metrics" ], "format": "JSON" }, "clarity_gaps": [ "Missing specific metrics calculation methods", "Unclear real-time update frequency requirements", "Missing design system component specifications", "Missing data retention and privacy requirements" ] }, "processing_time_ms": 15 }

实时使用的好处

  1. 直接结构:在几秒钟内将模糊的请求转化为可操作的任务
  2. 差距识别:在开始开发之前发现缺失的需求
  3. 团队沟通:在代码审查期间提供结构化反馈
  4. Sprint计划:将功能分解为清晰、可衡量的任务
  5. 文档:为项目管理工具生成一致的任务描述
  6. 质量保证:在不清楚的规格成为bug之前识别它们
  7. 入职:帮助新团队成员快速了解需求
  8. 利益相关者协调:确保每个人对请求都有相同的理解

与开发工作流集成

  • 站立时:快速构建功能请求和错误报告
  • 代码评审:结构反馈和改进建议
  • Sprint计划:将史诗分解为可操作的故事
  • 缺陷类选:结构问题描述,以便更好地跟踪
  • API设计:结构端点要求和规范
  • 测试:结构测试用例要求和验收标准

贡献

  1. 分叉存储库
  2. 创建要素分支: git checkout -b feature/amazing-feature
  3. 提交您的更改: git commit -m 'Add amazing feature'
  4. 推到分支: git push origin feature/amazing-feature
  5. 打开拉取请求

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

支持

  • 问题: GitHub问题
  • 讨论: GitHub讨论
  • 文档: GitHub维基

路线图

  • []支持多种输出格式(YAML、XML等)
  • []自定义架构定义
  • []批处理能力
  • []与流行的AI平台集成
  • []面向非技术用户的Web界面
  • []自定义分析器的插件系统

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Text To JSON MCP 怎么安装?

在客户端按下面的安装命令接入:npx text-to-json-mcp --help。对应的包名是 text-to-json-mcp。装完在客户端配置里引用同一个包或端点。

Text To JSON MCP 怎么在 Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Text To JSON MCP 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Text To JSON MCP 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

Text To JSON MCP 支持哪些客户端?

资料标注支持 Cursor;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Text To JSON MCP 能提供哪些能力?

资料显示约 3 个工具;能力标签包括 文本处理、本地运行、JavaScript、Cursor、开发工具。具体工具清单以官方文档为准。

Text To JSON MCP 需要什么运行环境?

运行时为 Node.js;属于本地进程,需要在本机装好运行环境。

Text To JSON MCP 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。