Lingua Universale MCP Server

io.github.rafapra3008由 GitHub 账号 rafapra3008 发布v0.1.1更新于 Oct 24, 2026

Verify AI agent communication with session types and formal proofs

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

面向 Lingua Universale 的本地 MCP 服务器,借助会话类型让助手定义、验证并强制执行 AI 智能体之间的通信协议。

可以做什么
定义包含角色、消息顺序和分支选择的智能体协议,并检查与形式化验证终止性、无死锁、角色参与等性质。对协议进行 lint、格式化和可视化,并从已验证模板生成项目骨架。运行协议并审计 MCP 服务器的协议清单。从协议源码生成 Lean 4 证明和 Python 代码。
适用场景
适合在构建多智能体系统时,让助手编写、验证或调试智能体之间的通信协议,或把协议验证加入 CI 流程。
运行要求
以本地进程通过 stdio 运行,使用 uvx 从 PyPI 包 lu-mcp-server 启动,因此需要带 uv 的 Python 环境。未声明认证、环境变量或请求头。
安装前请注意
README 的安装说明引用的包名与清单不一致,安装前请确认实际安装的包。协议验证和代码生成会作用于你自己的协议文件,运行生成的代码前应先审阅。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Lingua Universale MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Lingua Universale

A language for verified AI agent protocols.

[PyPI] [License: Apache 2.0] [Zero Dependencies] [VS Code] [Discord]

Try it in your browser -- no install needed. Watch AI agents live -- 3 agents on a verified protocol.


The Problem

Your AI agents talk to each other, but nothing guarantees they follow the rules. Wrong sender, wrong message order, missing steps -- and you only find out in production.

Lingua Universale (LU) is a type checker for AI agent conversations. You define the protocol, LU proves it's correct, and the runtime enforces it.

python
from cervellaswarm_lingua_universale import Protocol, ProtocolStep, MessageKind, SessionChecker, TaskRequest
# Define: who sends what, to whom, in what orderreview = Protocol(name="Review", roles=("dev", "reviewer"), elements=(    ProtocolStep(sender="dev", receiver="reviewer", message_kind=MessageKind.TASK_REQUEST),    ProtocolStep(sender="reviewer", receiver="dev", message_kind=MessageKind.TASK_RESULT),))
checker = SessionChecker(review)checker.send("dev", "reviewer", TaskRequest(task_id="1", description="Review auth"))  # OKchecker.send("dev", "reviewer", TaskRequest(task_id="2", description="Oops"))         # ProtocolViolation!#                                                                                      ^^^ wrong turn: reviewer must send next

The protocol says reviewer goes next. The runtime blocks it. Not because you trust the code -- because the session type makes it impossible.


Install

bash
pip install cervellaswarm-lingua-universale

Or try it first: Playground (runs in your browser via Pyodide).


Write a Protocol

protocol DelegateTask:    roles: supervisor, worker, validator
    supervisor asks worker to execute analysis    worker returns result to supervisor    supervisor asks validator to verify result
    when validator decides:        pass:            validator returns approval to supervisor        fail:            validator sends feedback to supervisor
    properties:        always terminates        no deadlock        no deletion        all roles participate

Then verify it:

bash
lu verify delegate_task.lu
  [1/4] always_terminates  ... PROVED  [2/4] no_deadlock        ... PROVED  [3/4] no_deletion        ... PROVED  [4/4] all_roles_participate ... PROVED
  All 4 properties PASSED.

Mathematical proof. Not a test that passes today and fails tomorrow.


What You Get

FeatureDescription
Full compilerTokenizer, parser (64 rules), AST, contract checker, Python codegen
9 verified propertiesalways_terminates, no_deadlock, no_deletion, role_exclusive, and more
20 stdlib protocolsAI/ML, Business, Communication, Data, Security -- ready to use
Linter + Formatterlu lint (10 rules) + lu fmt (zero-config, like gofmt)
LSP serverDiagnostics, hover, completion, go-to-definition, formatting
VS Code extensionInstall from Marketplace
Interactive chatlu chat -- build protocols conversationally (English, Italian, Portuguese)
Browser playgroundTry it now -- Check, Lint, Run, Chat
Lean 4 bridgeGenerate and verify mathematical proofs
REPLlu repl for interactive exploration
Project scaffoldinglu init --template rag_pipeline from 20 verified templates

Zero external dependencies. Pure Python stdlib.


CLI

bash
lu check file.lu          # Parse and compilelu verify file.lu         # Formal property verificationlu run file.lu            # Executelu lint file.lu           # 10 style and correctness ruleslu fmt file.lu            # Zero-config auto-formatterlu chat --lang en         # Build a protocol conversationallylu demo --lang it         # See the La Nonna demolu init --template NAME   # Scaffold from stdlib templateslu visualize file.lu      # Generate Mermaid sequence diagramlu mcp-audit --manifest t.json  # Audit MCP server protocolslu repl                   # Interactive REPLlu lsp                    # Start LSP server

CI Integration

Add protocol verification to your GitHub Actions workflow:

yaml
# .github/workflows/lu-check.ymlon:  push:    paths: ["**/*.lu"]
jobs:  lu-check:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - uses: actions/setup-python@v6        with:          python-version: "3.11"      - run: pip install cervellaswarm-lingua-universale      - run: lu lint protocols/      - run: lu verify protocols/

Exit code is non-zero on violations -- works with any CI system.


How It Works

LU is built on multiparty session types (Honda, Yoshida, Carbone -- POPL 2008). Session types describe communication protocols as types: if two processes follow the same session type, they cannot deadlock, messages cannot arrive in the wrong order, and the conversation always terminates.

The pipeline:

.lu source → Tokenizer → Parser → AST → Spec Checker → Lean 4 Proofs → Python Codegen                                           ↓                                    PROVED or VIOLATED

LU doesn't replace your AI agent framework. It makes it safe. Like TypeScript for JavaScript -- you keep your tools, you add guarantees.


Examples

LU Debugger -- Live web app: 3 AI agents (Customer, Warehouse, Payment) communicate on a verified OrderProcessing protocol. Click "Break" to see a protocol violation blocked in real time. Source code.

See the examples/ directory:

Or try the interactive Colab notebook -- 2 minutes, zero setup.


More from CervellaSwarm

Lingua Universale is the core project by CervellaSwarm. We also publish these Python packages:

PackageWhat it does
code-intelligenceAST-powered code understanding (tree-sitter, PageRank)
agent-hooksLifecycle hooks for Claude Code agents
agent-templatesAgent definition templates & team configuration
task-orchestrationDeterministic task routing & validation
spawn-workersMulti-agent process management
session-memoryPersistent session context across conversations
event-storeImmutable event logging & audit trail
quality-gatesAutomated quality checks & scoring

All Apache 2.0, Python 3.11+, tested, documented.


Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.


License

Apache License 2.0 -- see LICENSE.

Copyright 2025-2026 CervellaSwarm Contributors.


Lingua Universale -- Verified protocols for AI agents.

Playground | LU Debugger | PyPI | VS Code | Blog | Colab Demo

来源:README.md,提交 e1aea16

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分