Token导航 LogoToken导航

MCP Server · 开发工具

Text To JSON MCP

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

stdio官方级别未说明来源级核验工具 3text-to-json-mcp
文本处理本地运行JavaScriptCursor开发工具

快速开始

作者 / 组织
chiragdarji
提供方
chiragdarji
运行时
Node.js

工具数量

3

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

Text To JSON MCP 属于开发工具类 MCP Server,公开资料标注 3 个工具,通过stdio 本地进程接入,适配 Cursor,有可以直接复制的安装命令;接入前要先准备 OAuth 授权。

分类

开发工具

传输方式

stdio

认证方式

OAuth 授权

部署方式

公开资料未说明

安装与配置

安装命令

npx text-to-json-mcp --help

客户端配置示例

{
  "mcpServers": {
    "text-to-json-mcp": {
      "command": "npx",
      "args": [
        "text-to-json-mcp",
        "--help"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    准备运行环境

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

  2. 2

    安装服务

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

  3. 3

    写入客户端配置

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

  4. 4

    验证是否可用

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

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

文本到JSON MCP服务器

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

特性

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

安装

地方发展

# 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

全球安装

# Install globally
npm install -g text-to-json-mcp

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

用法

CLI命令

# 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"

输出:

{
  "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. 安装软件包:
   npm install -g text-to-json-mcp
  1. 在游标中配置MCP:

- 打开光标设置 - 导航到MCP配置 - 添加以下配置:

   {
     "mcpServers": {
       "text-to-json-mcp": {
         "command": "npx",
         "args": ["text-to-json-mcp", "server"],
         "env": {}
       }
     }
   }
  1. 重新启动游标 加载MCP服务器
  1. 在游标中使用:
   /mcp text-to-json-mcp convertPromptToJson "Create a user authentication system with login and registration"

VSCode设置

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

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

可用脚本

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
  2. 在适当的实用程序文件中实现逻辑
  3. 在中添加方法处理程序 src/index.js
  4. 更新中的CLI界面 cli.js
  5. 添加测试和文档

向NPM发布

先决条件

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

发布步骤

# 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

版本管理

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."

结构化输出:

{
  "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."

差距分析输出:

{
  "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."

精炼输出:

{
  "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."

结构化输出:

{
  "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."

结构化输出:

{
  "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."

结构化输出:

{
  "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许可证获得许可-请参阅 许可证 文件以获取详细信息。

支持

  • 问题:
  • 讨论:
  • 文档:

路线图

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

工具与能力

工具数量

3

资源数量

0

提示词数量

0

能力标签

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

支持客户端

Cursor

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

  • 只提供 3 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 Node.js,换机器要重新装一遍。
  • 需要自备OAuth 授权,没有凭据没法直接试。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

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

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到OAuth 授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Text To JSON MCP

MCP World · 本页

3stdio有1 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Text To JSON MCP 怎么安装?

公开资料给出的安装命令是 npx text-to-json-mcp --help,运行环境为 Node.js。装完后按客户端要求写进 MCP 配置,重启客户端生效。

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

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Node.js;保存后完全退出客户端再打开,配置才会生效。

Text To JSON MCP 收费吗?

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

Text To JSON MCP 需要 API Key 吗?

公开资料标注的认证方式是OAuth 授权,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

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

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

来源信息

继续浏览同类 MCP