# Euclid-MCP

The Euclid-MCP MCP server turns facts and rules into traceable conclusions with proof trees. Use it for access policies, cloud audits, and other formal rule systems.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9 repo stars
- Author: Euclid-BG
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Euclid-BG/Euclid-MCP
- Updated: 2026-10-15
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/euclid-mcp

## What it does

Euclid-MCP receives facts, rules, and queries written in Euclid-IR, then returns solutions with proof trees as structured JSON. The language covers variables, conjunctions, alternatives, negation, arithmetic comparisons, and compound queries. You can describe the rules without writing Prolog syntax.

The server translates Euclid-IR into Prolog and runs inference through a persistent SWI-Prolog process. When SWI-Prolog cannot be used, a native Python engine interprets the intermediate language. The `explain`, `diagnose`, `what_if`, and `check_kb` tools add explanations, issue analysis, scenario checks, and knowledge-base validation. A knowledge base may be loaded at startup and reused across calls.

The setup commands rely on `uvx`. The server can be connected to Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, or Gemini CLI.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add euclid-mcp -- uvx euclid-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from euclid-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add euclid-mcp -- uvx euclid-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from euclid-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "euclid-mcp": {
            "command": "uvx",
            "args": [
                "euclid-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from euclid-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "euclid-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "euclid-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from euclid-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add euclid-mcp uvx euclid-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from euclid-mcp <command>

## When to use it
- check access rules against supplied facts
- return a proof tree for each conclusion
- audit decisions against their source rules
- test alternate cases with `what_if`
- validate a knowledge base before querying

## Example prompts
- Check whether `alice` can access this resource under the supplied facts and rules.
- Explain the deployment decision and show the proof tree behind it.
- Test the same query after changing the user role and compare the result.

## Similar
- [critical-thinking-logical-reasoning](https://affpapa.org/en/nevibecode/skills/critical-thinking-logical-reasoning.md) — skill · 2500 installs
- [gke-multitenancy](https://affpapa.org/en/nevibecode/skills/gke-multitenancy.md) — skill · 6448 installs
- [gke-platform-security](https://affpapa.org/en/nevibecode/skills/gke-platform-security.md) — skill · 5000 installs
- [kubernetes-pentesting](https://affpapa.org/en/nevibecode/skills/kubernetes-pentesting.md) — skill · 4100 installs
- [iam-audit](https://affpapa.org/en/nevibecode/skills/iam-audit.md) — skill · 450 installs
- [agent-security-engineer](https://affpapa.org/en/nevibecode/skills/agent-security-engineer.md) — skill · 402 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
