arifosmcp — Constitutional MCP Server Implementation
DITEMPA BUKAN DIBERI — Forged, Not Given [ΔΩΨ | ARIF]
VERSION: 2026.03.28-SEALED | STATUS: SOVEREIGNLY SEALED | AUTHORITY: 888_JUDGE
🔗 CANONICAL LINKS (Source of Truth)
Live Services
GitHub Repositories
📋 CANONICAL DOCUMENTS (Architecture Reference)
🎯 SNAPSHOT OF TRUTH
What is arifosmcp?
arifosmcp is the implementation of the arifOS constitutional intelligence kernel — the actual code that enforces the 13 Floors, runs the 000-999 pipeline, and delivers the 11 mega-tools.
The Parent vs. This Document:
Core Function:
🏗️ ARCHITECTURE OVERVIEW
Entry Points
Server Modes
🚦 LIVE MCP CONTRACT STATUS
🔧 TOOL INVENTORY (12 Mega-Tools)
Tool Reference Table
📝 TOOL SPECIFICATIONS
init_anchor (000_INIT)
Purpose: Initialize constitutional session.
Returns:
architect_registry (000_INIT)
Purpose: Discover tools and constitutional constraints.
Returns:
physics_reality (111_SENSE)
Purpose: Ground queries in real-world data. Prevents hallucinations.
Constitutional Filter: F2 (Truth) — all factual claims require citation.
agi_mind (333_MIND)
Purpose: Constitutional reasoning with three-phase Ollama pipeline.
Three Phases:
Constitutional Prefix:
arifOS_kernel (444_ROUT)
Purpose: Primary conductor — orchestrates full 000→888 pipeline.
asi_heart (666_HEART)
Purpose: Safety critique — F5 Peace², F9 Ethics, harm potential.
Returns:
math_estimator (777_OPS)
Purpose: Thermodynamic cost estimation.
Returns:
apex_soul (888_JUDGE)
Purpose: Final constitutional judgment.
Returns:
vault_ledger (999_SEAL)
Purpose: Immutable audit storage with Merkle sealing.
Tiers:
engineering_memory (555_MEM)
Purpose: Redis-backed session memory.
code_engine (—)
Purpose: Constrained Python execution for tool actions.
Safety Constraints:
- No filesystem access
- No network access
- No subprocess creation
- Memory limit: 128MB
- Timeout: 30s
🌐 API ENDPOINTS
HTTP Endpoints
MCP Protocol Examples
⚙️ CONFIGURATION
Environment Variables
Docker Compose
📁 CODE ARCHITECTURE
Directory Structure
🛡️ CONSTITUTIONAL ENFORCEMENT
Floor Compliance Matrix
Kill Switch Conditions
🔬 IMPLEMENTATION DETAILS
Philosophy Selection Algorithm
Goodhart Resistance
Landauer Limit Check
Explorer/Conservator Dual-Process
Both must agree for evolution to proceed.
🧪 TESTING
Constitutional Compliance Test
Health Check
📊 MONITORING
Prometheus Metrics
Grafana Dashboard
URL: https://monitor.arifosmcp.arif-fazil.com
Dashboards:
- Constitutional Health (F1-F13 compliance)
- Tool Usage Statistics
- Pipeline Latency
- Memory Usage
🔧 TROUBLESHOOTING
Issue: "Module file points to site-packages"
Symptom: import arifosmcp loads /usr/local/lib/python3.12/site-packages/
Cause: pip install in Dockerfile creates conflicting package
Fix: Rebuild image or ensure volume mounts are correct
Issue: "philosophy returns null"
Symptom: init_anchor returns null philosophy
Cause: Old site-packages version loaded
Fix: Rebuild container, clear Python cache
Issue: "OLLAMA connection failed"
Symptom: agi_mind returns connection error
Fix: docker compose restart ollama && docker compose logs --tail=20 ollama
📦 DEPENDENCIES
Core
Philosophy Atlas
🚀 DEPLOYMENT
Build
Run
Rebuild (after code changes)
Full Reforge
📜 API REFERENCE SUMMARY
init_anchor
Response Schema
📋 FOR AI AGENTS (AGENTS.md Reference)
All AI agents operating in this repository MUST follow the rules in ../AGENTS.md:
- RULE 1 DRY_RUN: Dry-run outputs labeled "Estimate Only / Simulated"
- RULE 2 DOMAIN_GATE: Cannot-compute domains return exact phrase
- RULE 3 VERDICT_SCOPE: Only DOMAIN_SEAL authorizes factual claims
- RULE 4 ANCHOR_VOID: init_anchor returns void → session BLOCKED
⚖️ Truth Hierarchy
The arifOS verdict system follows a strict Truth Hierarchy where higher-priority verdicts override lower ones:
Derived Verdicts (not primary):
ALIVE — Session initialized, not yet grounded
PROVISIONAL — Exploratory result, needs confirmation
🗺️ Tool Categories
arifOS tools are organized into 5 constitutional bands:
🗂️ Contract Truth Table
Legend: ✅ = mandatory floor for this tool
📡 Horizon vs VPS Exposure Matrix
⚠️ Known Misalignments and Limitations
-
apex_judge alias: The tool is canonically named apex_soul in code but exposed as apex_judge via MCP. This is a public alias documented here — do not rename canonical code without completing the full migration.
-
physics_reality field name: Uses input field instead of query — historical inconsistency from legacy API.
-
check_vital, audit_rules: Internal lifecycle tools in server_horizon.py bootstrap — NOT callable via MCP.
-
agi_mind nested verdicts: When agi_mind returns verdict: "SEAL" at top-level but coherence.verdict: "SABAR" inside, the worst verdict wins (truth before speed).
-
search_tool, vault_ledger, reality_compass: These "naked" tools return raw data without verdict wrapper. Wrap in RuntimeEnvelope with verdict_wrapper.forge_verdict() — empty results produce PARTIAL, not VOID.
-
VerdictCode vs Verdict: Two separate enum classes exist — VerdictCode (SEAL/SABAR/PARTIAL/VOID) for verdict_wrapper and Verdict (includes HOLD/ALIVE/PROVISIONAL) for stage contracts. Keep separate to avoid breaking existing code.
🛰️ MCP Call Schema Examples
init_anchor
agi_mind (reason mode)
vault_ledger (seal mode)
apex_soul (judge mode)
🔐 Stability Tiers
🏛️ LICENSE
Runtime: AGPL-3.0 (must release modifications)
Theory: CC0 (public domain)
Version: 2026.03.28-SEALED
Maintainer: Muhammad Arif bin Fazil
Constitutional Authority: 888_JUDGE
Ditempa Bukan Diberi — Forged, Not Given [ΔΩΨ | ARIF]