@intettext/mcp服务器
什么是IntentText?
IntentText(.it)是一种纯文本文档格式,其中每一行都有一个声明的语义类型,使文档同时具有人类可写性和原生JSON。A. task: 这是一项任务。A. step: 是一个可执行的工作流步骤。每个块都解析为类型化的、确定性的JSON,不需要解释。
此MCP服务器使任何AI代理都能够以本机工具调用的方式处理IntentText文档。
已部署实例: https://intenttext-mcp.onrender.com --在任何支持远程服务器的MCP客户端中直接使用此URL。
______________________________________________________________________
MCP服务器 IntentText --解析、验证、查询、呈现和生成 .it 来自任何AI代理的文档。
运行此服务器后,Claude、GPT或任何与MCP兼容的代理都可以将IntentText文档作为本机工具调用使用,而无需了解格式本身。
安装
npm install -g @intenttext/mcp-server
# or use npx (no install required)
npx @intenttext/mcp-server使用Claude Desktop进行配置
添加 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"intenttext": {
"command": "npx",
"args": ["@intenttext/mcp-server"]
}
}
}使用任何MCP客户端进行配置
{
"command": "npx",
"args": ["@intenttext/mcp-server"],
"env": {}
}HTTP包装器(用于托管MCP URL)
此包还包括一个HTTP包装器,因此您可以将其从此GitHub仓库部署到Railway/Render/Fly等平台,并提供一个URL(用于要求 https://.../mcp).
npm install
npm run build
npm run start:http终点:
POST /mcp-MCP可流式HTTP端点GET /health-健康检查终点
环境变量:
PORT(默认值3000)HOST(默认值0.0.0.0)
注意:GitHub本身不能承载长时间运行的Node服务器进程。将包装器代码保存在GitHub中,然后将其部署到运行时提供程序,并在Smithery表单中使用该公共URL。
公开部署可在 https://intenttext-mcp.onrender.com.
可用工具
parse_intent_text
将IntentText(.it)源字符串解析为结构化JSON文档。
| 参数 | 类型 | 说明 |
|---|---|---|
source | string | 要解析的IntentText源字符串 |
safe | boolean | 如果为true,则永不抛出--返回警告而不是错误。默认值:true |
render_html
将IntentText源字符串渲染为样式化的HTML。
| 参数 | 类型 | 说明 |
|---|---|---|
source | string | IntentText源字符串(.it格式) |
render_print
渲染IntentText文档,使用@media print CSS打印优化的HTML。适用于PDF生成。
| 参数 | 类型 | 说明 |
|---|---|---|
source | string | IntentText源字符串 |
合并模板
合并IntentText模板(包含 {{variable}} 占位符)与数据对象。
| 参数 | 类型 | 说明 |
|---|---|---|
template | string | IntentText模板源 {{variable}} 占位符 |
data | object | JSON对象,具有要替换到模板中的值 |
render | 字符串 | "none" (默认), "html",或 "print" --可选地呈现合并结果 |
validate_document
验证IntentText文档的语义正确性。检查是否存在损坏的步骤引用、缺少必需的属性、未解析的变量和工作流逻辑错误。
| 参数 | 类型 | 说明 |
|---|---|---|
source | string | 要验证的IntentText源字符串 |
查询文档
按类型、内容或属性查询IntentText文档中的特定块。
| 参数 | 类型 | 说明 |
|---|---|---|
source | string | IntentText源字符串 |
type | string | 块类型筛选器--例如。 "task", "step,gate,decision" |
content | string | 要在块内容中搜索的子字符串 |
section | string | 仅返回此节中的块 |
limit | number | 要返回的最大结果数 |
diff_文档
比较IntentText文档的两个版本,并返回语义差异。
| 参数 | 类型 | 说明 |
|---|---|---|
before | string | 原始IntentText源 |
after | string | 已更新的IntentText源 |
document_to_source
将IntentText JSON文档转换回 .it 源格式。
| 参数 | 类型 | 说明 |
|---|---|---|
document | object | IntentText文档JSON对象(由parse_intent_text生成) |
提取工作流
从IntentText工作流文档中提取执行图。返回拓扑顺序、依赖关系、并行批和门位置中的步骤。
| 参数 | 类型 | 说明 |
|---|---|---|
source | string | 包含工作流块的IntentText源(步骤:、决策:、门:等) |
示例:代理工作流
User: Create a deployment workflow for a web app
Agent calls: parse_intent_text with a generated .it document
Agent calls: validate_document to check for issues
Agent calls: extract_workflow to get the execution graph
Agent calls: render_html to produce a visual version许可证
麻省理工学院
