Omni-NLI
Provides natural language inference (NLI) capabilities via the Model Context Protocol, allowing AI agents to verify factual consistency and detect contradictions in text.
README
<div align="center"> <picture> <img alt="Omni-NLI Logo" src="logo.svg" width="200"> </picture> <br>
<h2>Omni-NLI</h2>
A multi-interface (REST and MCP) server for natural language inference
</div>
Omni-NLI is a self-hostable server that provides natural language inference (NLI) capabilities via RESTful and the Model Context Protocol (MCP) interfaces. It can be used both as a very scalable standalone stateless microservice (via the REST API) and also as an MCP server for AI agents to implement a verification layer for AI-based applications.
What is NLI?
Given two pieces of text called premise and hypothesis, NLI (AKA textual entailment) is the task of determining the directional relationship between them as it is perceived by a human reader. The relationship is given one of these three labels:
"entailment": the hypothesis is supported by the premise"contradiction": the hypothesis is contradicted by the premise"neutral": the hypothesis is neither supported nor contradicted by the premise
[!IMPORTANT] NLI is not the same as logical entailment. Its goal is to determine if a reasonable human would consider the hypothesis to follow from the premise. This checks for consistency instead of the absolute truth of the hypothesis.
Typical applications of NLI include:
- NLI can be used to check if a given piece of text is consistent with the rest of the text. For example, if a new response from a chatbot or AI assistant contradicts something that was said earlier in the conversation.
- It can be used to check if a summarization contradicts the original text in some way.
- It can be used to check if the documents in the ranked list of results entail the query.
- It can be used to check if a piece of text is supported by some facts. Note that this is not the same as using logic.
[!IMPORTANT] The quality of the results depends a lot on the model (the LLM) that is used. A good strategy is to first fine-tune the model using a dataset of premise-hypothesis-label triples that are relevant to your application domain.
Main Features of Omni-NLI
- Helps mitigate LLM hallucinations by verifying if the generated content is supported by facts
- Supports models provided by different backends, including Ollama, HuggingFace (public and private/gated models), and OpenRouter
- Supports REST API (for traditional applications) and MCP (for AI agents) interfaces
- Fully configurable and very scalable, with built-in caching
- Provides confidence scores and (optional) reasoning traces for explainability
See ROADMAP.md for the list of implemented and planned features.
[!IMPORTANT] Omni-NLI is in early development, so bugs and breaking changes are expected. Please use the issues page to report bugs or request features.
Quickstart
1. Installation
pip install omni-nli[huggingface]
2. Start the Server
omni-nli
3. Evaluate NLI (with REST API)
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"premise": "A football player kicks a ball into the goal.",
"hypothesis": "The football player is asleep on the field."
}' \
http://127.0.0.1:8000/api/v1/nli/evaluate
Example response:
{
"label": "contradiction",
"confidence": 0.99,
"model": "microsoft/Phi-3.5-mini-instruct",
"backend": "huggingface"
}
4. Evaluate NLI (with MCP Interface)

Documentation
Check out the Omni-NLI Documentation for more information, including configuration options, API reference, and examples.
Contributing
Contributions are always welcome! Please see CONTRIBUTING.md for details on how to get started.
License
Omni-NLI is licensed under the MIT License (see LICENSE).
Acknowledgements
- The logo is from SVG Repo with some modifications.
<!-- Need to add this line for MCP registry publication --> <!-- mcp-name: io.github.CogitatorTech/omni-nli -->
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。