TypeSafe MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
TypeSafe MCP Server
一个基于 Model Context Protocol (MCP) 的 TypeSafe System One 服务,让 MCP 客户端可以调用 Jev 模型完成结构化判断。
工具
typesafe_classify
通用结构化判断,支持 TypeSafe 的三种问题类型:
choice:从一组候选项中选择并返回概率分布score:根据有序标准评分noul:返回“是”的概率
content 可以是字符串、JSON 对象或数组,并可在一次请求中提交多个问题。
typesafe_ticket_classify
分析工单类型、优先级、负责部门、用户情绪和影响范围。
typesafe_content_moderate
检测暴力、色情、仇恨言论和垃圾信息,并给出风险评分与处理建议。
Related MCP server: OCR MCP Server
要求
Python 3.10+
TypeSafe API Key,可从 TypeSafe Console 获取
安装与运行
推荐使用 uv:
git clone https://github.com/wangBoYi972/typesafe-mcp.git
cd typesafe-mcp
uv sync
TYPESAFE_API_KEY=your-api-key uv run typesafe-mcp也可以使用 pip:
python -m venv .venv
source .venv/bin/activate
pip install .
TYPESAFE_API_KEY=your-api-key typesafe-mcp服务使用 stdio 传输,正常启动后不会输出提示信息。
MCP 客户端配置
以 Claude Code 为例,在 MCP 配置中添加:
{
"mcpServers": {
"typesafe": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/typesafe-mcp",
"run",
"typesafe-mcp"
],
"env": {
"TYPESAFE_API_KEY": "your-api-key"
}
}
}
}将仓库路径替换为本机绝对路径,然后重新加载 MCP 客户端。
通用分类示例
下面是传给 typesafe_classify 的参数:
{
"content": "这个产品太棒了!",
"questions": {
"sentiment": {
"type": "choice",
"instructions": "判断文本表达的主要情感。",
"criteria": {
"positive": "积极正面",
"neutral": "中性客观",
"negative": "消极负面"
}
},
"intensity": {
"type": "score",
"instructions": "评估情感表达强度。",
"criteria": ["几乎没有情感", "轻微", "明显", "强烈"]
},
"is_recommendation": {
"type": "noul",
"instructions": "这段文本是否在推荐该产品?"
}
},
"model": "jev-latest"
}Score 的结果按 criteria 的零基索引计算。例如四个等级对应 0 到 3,而不是任意的
min/max 区间。
配置
环境变量 | 必需 | 默认值 | 说明 |
| 是 | - | TypeSafe API 密钥 |
| 否 | SDK 默认值 | 自定义 API 根地址 |
| 否 |
| 单次 HTTP 操作超时秒数 |
| 否 |
| 连接失败、超时、429 和 5xx 的最大重试次数 |
支持 jev-latest、jev-preview 和版本化模型 ID,例如 jev-1.13.0。完整模型列表见
TypeSafe Models。
开发
安装开发依赖并运行全部检查:
uv sync --extra dev
uv run pytest
uv run ruff check .
uv run pyright测试不会调用真实 TypeSafe API。GitHub Actions 会在 Python 3.10、3.11、3.12 和 3.13 上运行相同检查。
错误处理
服务使用官方 typesafe-sdk:
API 请求全程异步
默认对连接错误、超时、429 和 5xx 自动重试
认证、权限、限流和连接错误会转换成可读的 MCP 工具错误
API 密钥不会包含在工具错误或日志中
许可证
相关链接
This server cannot be deployed
Maintenance
Related MCP Connectors
Typed AI decisions for agents: classify, route, screen evidence, score and batch-label text.
Sentiment, toxicity, entity extraction, PII, translation, summary, QA, fraud scoring, safety audit.
Use your own trained text and picture classification models from any AI assistant.
Turn messy text into strict JSON schemas agents can trust (invoice, receipt, contact, resume).
Related MCP Servers
- AlicenseCqualityAmaintenanceProvides Claude with 44 tools for confidence gating, typed outputs, hallucination detection, and constraint enforcement during conversations.5144 PyPI1MIT
- AlicenseNot gradedqualityCmaintenanceEnables document text recognition and extraction from images and PDFs using Claude Vision, including support for scanned documents and structured output, without requiring local OCR engines.MIT
- AlicenseAqualityBmaintenanceEnables typed, calibrated judgment calls through classify, score, check, and batched ask tools, each returning full probability distributions for programmatic decisions.5237 npm7MIT
- AlicenseAqualityCmaintenanceEnables agents to call typed code-review and content-moderation decision tools, returning structured verdicts, probabilities, and confidence-gated actions.2MIT