Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Reality-check layer for AI agents. Detect hidden risks, missing context & real-world consequences before your LLM answers or acts. MCP tool for Claude Code & Cursor.
Jump to setup instructionsNo tool list is on record. This does not mean the server has no tools. Tools were not run.
No setup evidence yet No matching config or report on record. This does not mean the server is incompatible.
Same catalog task: AI & machine learning.
.prompts, the home to all your AI prompts, everywhere you need them.
Same catalog task: AI & machine learning.
Real MCP server (stdio + @modelcontextprotocol/sdk) that exposes x402-paywalled HTTP endpoints as MCP tools. Drop into Claude Desktop, Cursor, or any MCP client.
Same catalog task: AI & machine learning.
Standalone MCP (Model Context Protocol) server - stdio/http/websocket transports, connection pooling, tool registry
Fetched from the repository for this visit.
A reality-check layer for AI agents — detect hidden risks, missing context, and real-world consequences before your LLM answers or acts.
WorldSense is an open source Python library and MCP server that wraps any LLM, chatbot, coding agent, or RAG app and adds a practical judgment pass before it answers or acts.
It catches what language models miss: fatigue and logistical constraints, irreversible actions, implicit social risk, overconfident claims, and dangerous tool use — returning a structured JSON analysis with risk level, consequences, and rewrite guidance.
"Fluent text is not the same thing as good judgment."
Works as:
pip install worldsense)worldsense analyze "...")Most LLMs are excellent at generating fluent text but poor at practical judgment:
WorldSense is a modular judgment layer you attach to any AI system to catch these problems before they reach the user.
It returns structured, machine-readable output with a risk level, triggered categories, consequences, recommendations, and optional action gating.
WorldSense is not an LLM, a vector database, a RAG framework, a moderation API, a prompt template, or a replacement for domain experts. The rule-based core is intentionally inspectable and works offline by default. Optional Claude, OpenAI, and Ollama adapters are also available for LLM-assisted analysis.
pip install worldsense
For local development:
pip install -e ".[dev]"
from worldsense import RealityEngine
engine = RealityEngine()
analysis = engine.analyze(
user_message="Ho dormito 2 ore ma devo guidare 3 ore.",
proposed_response="Fai delle pause e bevi un caffe.",
)
print(analysis.risk.risk_level)
print(analysis.recommendations)
Agent action gate:
from worldsense import RealityEngine
engine = RealityEngine()
decision = engine.evaluate_action(
action={
"tool": "filesystem.delete",
"target": "/project/temp",
"description": "Delete temporary files",
},
context={"project_path": "/project", "user_confirmation": False},
)
if decision.should_block:
print(decision.recommended_confirmation_prompt)
WorldSense ships a built-in MCP server. Once registered, any MCP-compatible AI can call WorldSense tools natively — no extra code required.
Add this to your project's .claude/settings.json (or ~/.claude/settings.json for global use):
{
"mcpServers": {
"worldsense": {
"command": "worldsense",
"args": ["mcp"]
}
}
}
Restart Claude Code. Three tools become available:
| Tool | What it does |
|---|---|
worldsense_analyze | Analyze a message for hidden risks, missing context, and real-world consequences |
worldsense_evaluate_action | Gate a destructive action (file delete, shell command, API call…) before execution |
worldsense_check_response | Check a draft AI response for overconfidence, social risk, and unsafe advice |
You can ask Claude to use them explicitly:
"Before deleting those files, run
worldsense_evaluate_actionto check if it's safe."
Or add this to your CLAUDE.md to make it automatic for every project:
## Safety policy
Before executing any destructive action (file deletion, shell commands, database writes,
API calls with side effects), call `worldsense_evaluate_action` and respect the result:
- `should_block: true` → do not proceed, explain why to the user
- `requires_confirmation: true` → ask the user before proceeding
- `should_warn: true` → show the warning, then proceed if the user confirms
Before answering questions with real-world risk (medical, legal, financial, physical safety),
call `worldsense_analyze` on the user message and incorporate the `rewrite_guidance`
into your response.
In ~/.cursor/mcp.json:
{
"mcpServers": {
"worldsense": {
"command": "worldsense",
"args": ["mcp"]
}
}
}
In claude_desktop_config.json:
{
"mcpServers": {
"worldsense": {
"command": "worldsense",
"args": ["mcp"]
}
}
}
Full MCP documentation: docs/MCP_SERVER.md
By default WorldSense works offline with YAML rules. Pass an adapter to enable LLM-assisted context extraction and consequence simulation:
pip install "worldsense[claude]" # Anthropic Claude
pip install "worldsense[openai]" # OpenAI
pip install "worldsense[ollama]" # Ollama (local)
from worldsense import RealityEngine, get_claude_adapter
engine = RealityEngine(adapter=get_claude_adapter())
analysis = engine.analyze("Ho dormito 2 ore ma devo guidare 3 ore.")
The rule-based core always runs first. The LLM enriches context extraction and consequence simulation on top. If the LLM call fails, the engine falls back to rules silently.
worldsense analyze "Ho dormito 2 ore ma devo guidare 3 ore." \
--response "Fai delle pause e bevi un caffe."
worldsense action "{\"tool\":\"filesystem.delete\",\"target\":\"/tmp/data\"}"
PowerShell-friendly form:
worldsense action --tool filesystem.delete --target /tmp/data --description "Delete temporary files"
Run the seed benchmark:
worldsense benchmark data/seed_scenarios.jsonl
The bundled seed benchmark currently covers 20 scenarios across destructive actions, travel realism, social escalation, medical urgency, privacy, overconfidence, and missing context.
Validate rules, taxonomy, and dataset:
worldsense validate
Understanding WorldSense
Using WorldSense
Contributing
WorldSense starts with a small but extensible taxonomy:
WorldSense is early alpha. The first version is deliberately conservative and rule-based. It is meant to be understandable, testable, and easy to extend.
WorldSense is a developer tool for risk awareness and action gating. It does not provide medical, legal, financial, or safety guarantees. High-risk domains still require qualified human judgment.
Contributions are welcome — new rules, new adapters, benchmark scenarios, translations. See CONTRIBUTING.md.
Apache-2.0
Loading reviews...
GitHub checked 88h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.