mcpField
P
Pipe (SPR) MCP Server

Pipe (SPR) MCP Server

本地服务
github.com/MachuraHarry开发工具36 周前更新

关于 Pipe (SPR) MCP Server

Pipe 是面向 AI 工作流的语义流水线运行时和语言,适用于构建 AI Agent 与自动化流程的开发者。它以单个轻量二进制文件提供内置 MCP 服务端和客户端、AI 工具及沙箱能力。

主要功能

  1. 01流水线式组合数据处理
  2. 02内置 MCP 服务端与客户端
  3. 03支持多 Agent 协作
  4. 04并行执行 AI 调用
  5. 05声明式沙箱配置
  6. 06单个轻量二进制部署

适用场景

  1. 01构建检索增强生成流程
  2. 02编排调用外部工具的 AI Agent
  3. 03分析日志并生成事件报告
  4. 04并行处理多项 LLM 请求

MCP 相关

Pipe 内置 MCP 服务端和客户端。它可将 Pipe 工具暴露给 MCP 客户端,也能通过 stdio 连接外部 MCP 服务。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库
安装包
mcpbpipe-server-linux-amd64.mcpb
mcpbpipe-server-linux-arm64.mcpb
mcpbpipe-server-darwin-amd64.mcpb
mcpbpipe-server-darwin-arm64.mcpb
mcpbpipe-server-windows-amd64.mcpb

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

README 配图 Pipe — 原生支持 MCP、可用于生产环境的运行时

CI License: MIT Version SPR MCP GitHub MCP Registry MCP Registry

首个内置 MCP 的语言,同时支持服务端和客户端。249 个内置功能,单个约 8 MB 的二进制文件。零依赖。 已正式列入官方 MCP Registry(v1.1.1,活跃)。可通过 GitHub MCP Registry 一键安装,用于 Copilot 和 VS Code。

v1.3 新增内容

Pipe v1.3.0 在 v1.2.0 的多 Agent 和视觉功能基础上进一步升级:

  • 多 Agent 集群 — ai_swarm / ai_swarm_trace / swarm_agent:具名 Agent 通过保留的工具调用将对话交接给彼此,并传递完整的消息历史记录。ai_swarm_stream 支持实时观察进度(工具调用、交接、推理、可在运行过程中介入的轮次检查回调),现在还会在安全的情况下并行执行一轮中的独立工具调用。
  • ai_vision — 通过兼容 OpenAI 的视觉模型,针对图像提问(支持 http(s) URL、本地文件或原始字节)。
  • OpenCode Zen AI 提供商 — 第 6 个提供商,其免费层模型无需 API 密钥即可使用。
  • 内置自更新程序 — pipe --update / --update-check 会获取最新的 GitHub 版本、验证校验和并替换当前版本。
  • tool_call — 直接调用已注册的工具,无需 LLM。
  • file_lock / file_unlock — 真正支持跨进程的建议式文件锁定。
  • if/else 链中的 elif 关键字。
  • ai_tool:parallel_safe 标志 — Pipe 定义的 fn 工具现在也可以批量并行运行,而不仅限于内置功能。
  • pipe -build 现在支持真正的多文件项目,并保留相对的子目录路径。
  • 强化的沙箱 — 第 7 至第 11 轮审计:修复了文件系统写入门控漏洞、wiki_search 出站访问漏洞、exec_whitelist shell 注入漏洞,以及硬链接逃逸漏洞。
  • 249 个内置功能 — 41 个 AI + 13 个 MCP + 195 个标准功能,高于 v0.9.3 的 226 个
  • 23 个模块 — MQTT、SQLite、pipe-http、pipe-web、pipe-orm、pipe-cli 等

快速安装

curl -fsSL https://pipe-lang.com/install.sh | bash   # Linux & macOS

Windows(PowerShell):irm https://pipe-lang.com/install.ps1 | iex

安装程序会下载最新版本、验证其 SHA256 校验和,并将 pipe 安装到 ~/.local/bin(以 root 身份运行时则安装到 /usr/local/bin)。使用 PIPE_VERSION=v1.0.0 固定版本。请参阅完整安装文档。

已安装的副本会自动更新到最新的 GitHub 版本:运行 pipe --update(或运行 pipe --update-check 仅检查更新,运行 pipe --version 查看当前版本)。更新程序会验证版本校验和,并就地替换二进制文件。

隐私与 DSGVO

Pipe 的设计符合 DSGVO / GDPR 要求:

  • 零遥测与分析 — 二进制文件绝不会向外发送请求,不会有任何数据离开你的计算机
  • 可自托管的单个二进制文件 — 完全在你的基础设施上运行
  • 无云服务 — 不会有供应商的服务处理你的数据
  • 开源(MIT) — 完全可审计
  • 本地 AI — 使用 Ollama 时,没有任何字节会离开你的网络;仅在你配置云服务提供商时才会使用云服务

问题

在生产环境中运行 AI 比想象中更困难:

  • 安全性 — 拥有文件访问、网络访问和 exec 权限的大模型会带来风险。你需要在语言层面实现细粒度沙箱,而不是事后补上中间件。
  • 性能 — 顺序调用 API 会让 1 秒的流水线变成 10 秒的瓶颈。并行处理不应该需要编写 asyncio.gather() 样板代码。
  • 供应商锁定 — 从 OpenAI 切换到 DeepSeek 意味着要重写 Python SDK 代码。更换提供商应该只需改一行。
  • 工具集成 — 将大模型连接到外部工具(GitHub、数据库、文件系统)会陷入 SDK 和 API 封装的迷宫。MCP 应该是语言原语,而不是库。

Pipe 在语言层面解决了这个问题。

什么是 Pipe?

Pipe 是一种语义流水线运行时(SPR)——一种原生支持流水线的语言,其中 summarize、translate 和 classify 与 +、sort 和 len 处于同一语法层级。数据通过可组合的转换从上到下流动。单个二进制文件,零依赖。

Python + LangChain(约 80 行):

import openai
client = openai.OpenAI()
def summarize(text):
    r = client.chat.completions.create(model="gpt-4o", messages=[{"role":"user","content":text}])
    return r.choices[0].message.content
def translate(text, lang):
    r = client.chat.completions.create(model="gpt-4o",
        messages=[{"role":"system","content":f"Translate to {lang}"},{"role":"user","content":text}])
    return r.choices[0].message.content
text = open("news.txt").read()
print(translate(summarize(text), "de"))

Pipe(5 行):

read_file "news.txt"
    > summarize       -- LLM call
    > translate "de"  -- LLM call
    > print

模型上下文协议

Pipe 内置 MCP,既可以作为服务端,也可以作为客户端。无需 SDK、无需 npm 包、无需 Python。纯 Go 标准库。

MCP 服务端 — 暴露你的工具
fn get_weather city
    match city
        | "Berlin" -> "22°C, sunny"
        | "London" -> "15°C, rainy"
        | _ -> city ++ ": no data"

ai_tool "get_weather" "Get weather for a city" {city: "City name"} get_weather
mcp_server "Weather Agent" "1.0.0"
mcp_serve_stdio

在 Claude Desktop 中配置(claude_desktop_config.json):

{ "mcpServers": { "pipe": { "command": "/tmp/pipe", "args": ["agent.pipe"] } } }
MCP 客户端 — 使用外部工具
ai_provider "deepseek"
ai_set_key "deepseek" (env "DEEPSEEK_API_KEY")

-- Connect to GitHub + Filesystem MCP servers
mcp_use_stdio "npx" "-y" "@modelcontextprotocol/server-github" {GITHUB_TOKEN: (env "GITHUB_TOKEN")}
mcp_use_stdio "npx" "-y" "@modelcontextprotocol/server-filesystem" "/tmp"

-- AI discovers and uses all tools automatically
result: ai_with_tools "You are a DevOps assistant." "Search pipe's open issues and list files in /tmp." 10
print result

任何 stdio MCP 服务都能立即使用:Filesystem、GitHub、Git、Postgres、SQLite、Slack、Brave Search、Memory、Sequential Thinking——任何可通过 npm/uvx 获取的工具。

使用场景

日志分析 → 事件报告
is_critical: fn line
    contains line "critical"

read_file "/var/log/app/errors.log"
    > split "\n"
    > filter is_critical
    > summarize
    > translate "de"
    > save "incident_report.txt"
RAG 流水线
ai_provider "deepseek"

docs: read_lines "knowledge_base.txt"
vectors: embed_batch docs

question: "How does the bytecode VM work?"
q_vec: embed question
top: nearest q_vec vectors 3

context: ""
for idx in top
    context: context ++ (at docs idx) ++ "\n---\n"

ask ("Context:\n" ++ context ++ "\nQuestion: " ++ question)
    > print
支持工具调用的 AI Agent
fn get_weather city
    match city
        | "Berlin" -> "22°C, sunny"
        | "London" -> "15°C, rainy"
        | _ -> city ++ ": no data"

ai_tool "get_weather" "Get current weather for a city" {city: "Name of the city"} get_weather

ai_with_tools "You are a weather assistant." "What's the weather in Berlin and London?"
    > print
并发 — 1.5 秒完成 3 次大模型调用,而非 4 秒
ai_provider "deepseek"

a: "Explain monads" >> ask
b: "What is CP/M?" >> ask
c: "Explain RFC 791" >> ask

print a ++ b ++ c   -- Future auto-resolution
Discord CI/CD 通知
import "discord.pipe" as d
ai_provider "deepseek"

-- AI code review per commit, sent as Discord embed
review: ai_chat "Review this code change" diff 800

d.d_webhook_embed (env "DISCORD_WEBHOOK") {
    title: "CI: Push to master",
    color: 3447003,
    fields: [
        {name: "Changed Files", value: stat},
        {name: "AI Review", value: review}
    ]
}

对比:Pipe 与 Python + LangChain

Python + LangChainPipe
RAG 流水线约 80 行代码约 8 行代码
沙箱化大模型访问自定义中间件一个 sandbox_profile 配置块
切换 AI 提供商重写 SDK 调用ai_provider "deepseek"
部署到服务端Docker + venv + pipscp pipe binary
并行大模型调用asyncio.gather() 样板代码>> 运算符,ai_batch
MCP 服务端 + 客户端依赖库13 个内置工具,零依赖,100 多个服务
二进制文件大小约 500 MB(含依赖)约 8 MB

特性

  • 原生支持 MCP — 为 MCP 服务 + 客户端提供 13 个内置工具。纯 Go 标准库。可连接任何 stdio MCP 服务
  • AI 流水线交付速度提升 10 倍 — 41 个 AI + 13 个 MCP 内置工具:无需导入、无需 SDK、无需 API 封装
  • 一行代码锁定 AI Agent — 声明式沙箱配置:使用一个代码块限制 exec、write_file、http_get
  • 数秒内完成部署 — 一个静态链接的约 8 MB 二进制文件。无需 venv、pip 或 Docker。支持 Linux、macOS、Windows、Raspberry Pi,也可通过 WebAssembly 在浏览器中运行
  • 1.5 秒内完成 3 次大模型调用,而非 4 秒 — >> 可在后台启动任何流水线阶段。Future 会自动解析。ai_batch 可借助内置限流机制并发处理数百条文本
  • 不受供应商锁定 — OpenAI、Anthropic(Claude)、DeepSeek、Ollama。只需一行即可切换。同一份代码可在所有平台运行
  • 并发原语 — 通道(send/recv)、互斥锁(lock/unlock)、计数信号量(acquire/release)
  • 原生流水线语法 — > 表示顺序执行,>> 表示并行执行。数据自上而下流动,易读、易组合、易调试
  • 内置社交平台支持 — Discord Webhook 和 Telegram 机器人可作为 Pipe 模块使用。AI 代码审查、通知、聊天——发送无需 API 费用
  • 字节码虚拟机 — 编译为字节码,在带自动缓存的栈式虚拟机上运行。根据工作负载,实测性能为树遍历器的 0.6 倍至 55 倍(递归密集型代码最高约 55 倍)
  • 模块生态系统 — 23 个精选模块,注册表支持固定版本(@1.0.0)。使用 pipe -get 安装,按名称导入
  • 内置测试 — 使用带有 assert_eq、assert_error 的 test 代码块。运行 pipe -test 即可。零配置
  • GitHub Action — 直接在 CI/CD 中运行 Pipe,无需安装
  • VSCode 扩展 — 语法高亮、IntelliSense、由 LSP 驱动的诊断和补全
  • 自解压二进制文件 — 将流水线打包为独立可执行文件(pipe -build)

快速开始

git clone https://github.com/MachuraHarry/pipe && cd pipe && make build
export DEEPSEEK_API_KEY="sk-..."
./bin/pipe -vm -q -c 'ai_provider "deepseek"; ask "What makes Pipe different?" > print'

在浏览器中试用

无需安装——Pipe 可通过 WebAssembly 完全在浏览器中运行:

Pipe
打开 Pipe Playground

-- Paste this into the playground and hit Run
levels: ["error","warn","info"]
read_file "server.log"
    > classify levels
    > summarize
    > print

GitHub Action

直接在 CI/CD 中运行 Pipe,无需安装:

- uses: MachuraHarry/pipe/.github/actions/pipe-action@master
  with:
    script: |
      print "Hello from CI/CD!"
      log: exec "git log --oneline -20"
      print (get log "output")

→ GitHub Action 文档

VSCode 扩展

为 .pipe 文件提供语法高亮和完整的 IntelliSense,由语言服务器协议客户端(vscode/)和 pipe-lsp 服务端(cmd/pipe-lsp)驱动:

  • 补全、悬停文档、签名帮助、转到定义、引用、重命名
  • 诊断(解析错误、未定义/未使用的变量)和语义高亮
  • 格式化文档、括号自动补全、自动缩进和代码折叠
make vsix     # builds the server and packages vscode/pipe-syntax-1.0.0.vsix

或者在开发模式下,从 vscode/ 文件夹按 F5 运行扩展。请参阅 VSCode 扩展文档。

模块生态系统

Pipe 拥有一个精选模块库,包含 23 个可复用模块,并支持固定版本:

基础设施数据与命令行AI 与 Agent开发工具社交
pipe-httpsqliterag-pipepipe-testtelegram-bot
pipe-clijpipelog-analyzerpipe-validatemqtt
pipe-ormpipe-tplsentiment
pipe-webpipe-datecode-review
translate-batch
changelog-gen
email-classifier
incident-report
parallel-runner
date-formatter
docs-pipe
pipe -search                 # Browse modules
pipe -search sql             # Filter by keyword
pipe -get sqlite             # Install latest
pipe -get [email protected]       # Install specific version
import "sqlite"                            -- database engine
import "pipe-http"                         -- HTTP client
import "mqtt"                              -- MQTT 5.0 client
import "discord.pipe" as d                 -- Discord webhooks + bot

idx: index_create h "knowledge"
index_add idx "Pipe is an AI-native language."
index_search idx "language" 3 > each print

→ 生态系统文档 | → 贡献模块

执行模式

模式命令速度
Tree-Walker./bin/pipe script.pipe基准
Bytecode VM./bin/pipe -vm -q script.pipe0.6x-55x(递归密集型场景下最高约 55x)

54 个 AI + MCP 内置函数(41 个 AI + 13 个 MCP)

理解

summarize、translate、classify、extract、ask、generate、generate_json

速度与控制

ai_stream、ai_batch、ai_parallel、ai_rate_limit、ai_chat、ai_chat_json

搜索与检索

web_search、wiki_search、embed、embed_batch、cosine_sim、dot_product、nearest

Agent 与工具

agent、agent_ask、agent_clear、ai_tool、ai_with_tools、tool_call、swarm_agent、ai_swarm、ai_swarm_trace、ai_swarm_stream、ai_vision

配置与成本

ai_provider、ai_model、ai_host、ai_set_key、ai_timeout、ai_cache、ai_cost、ai_tokens、ai_cache_hits、ai_cache_misses

MCP — Model Context Protocol

mcp_server、mcp_serve_stdio、mcp_serve_sse、mcp_tools、mcp_resource、mcp_resource_template、mcp_prompt、mcp_resources、mcp_read_resource、mcp_prompts、mcp_prompt_get、mcp_use_stdio、mcp_use_sse

自我修复

try_ai、try_ai_log

高级功能

自我修复代码(try_ai)
ai_provider "deepseek"

result: try_ai
    "42" * 3           -- E002 Type Error -> AI wraps with to_num -> 126
catch e
    0                   -- only reached if AI fix fails

print result           -- 126
并行管道(>>)
a: "Frage A"
    >> ask
b: "Frage B"
    >> ask
c: "Frage C"
    >> ask

print a ++ b ++ c   -- Future auto-resolution
Match 中的守卫子句
fn classify severity
    match severity
        | s if s > 9 -> "critical"
        | s if s > 5 -> "warning"
        | _ -> "info"
并发:通道
ch: chan 3
go { send ch "hello" }
go { send ch "world" }
print (recv ch) ++ " " ++ (recv ch)
沙箱配置
sandbox_profile "safe" {fs: "read-only", network: false, exec: false, ai: true}
sandbox_profile "agent" {fs: "temp-only", network: true, exec: false, ai: true}

set_sandbox "safe"
read_file "/etc/config"     -- reading allowed
write_file "/etc/config"    -- E_SANDBOX blocked

架构

Source (.pipe) -> Lexer -> Parser -> AST -> [ Tree-Walker | Compiler + VM ]
                                              |
                                    Builtins (249 total: 41 AI + 13 MCP + 195 standard)
                                              |
                                MCP Server <-> MCP Clients (stdio + HTTP)
  • 67 种令牌类型、43 种 AST 节点类型、43 条操作码
  • 约 37,000 行 Go 代码、752 个测试、101 个示例程序
  • 零依赖——纯 Go 标准库

文档

→ 完整文档(英语) → 完整文档(德语)

项目结构

pipe/
├── cmd/
│   ├── pipe/main.go           # Entry point
│   └── pipe-lsp/              # Language Server Protocol server (IntelliSense)
├── pkg/
│   ├── ai/                    # AI provider integrations
│   ├── analysis/              # IntelliSense library (builtins, diagnostics, completion...)
│   ├── ast/                   # AST node definitions
│   ├── build/                 # Self-extracting binary builder
│   ├── cache/                 # Bytecode cache
│   ├── compiler/              # Compiler to bytecode
│   ├── eval/                  # Tree-walk interpreter
│   ├── formatter/             # Code formatter
│   ├── gen/                   # Code generation helpers
│   ├── lexer/                 # Lexer and tokens
│   ├── mcp/                   # MCP server + client (zero-dependency)
│   ├── object/                # Runtime objects
│   ├── parser/                # Parser
│   ├── stdlib/                # Standard library helpers
│   └── vm/                    # Bytecode VM
├── examples/                  # 87 example programs
├── test/integration/          # Integration tests
├── vscode/                    # VSCode extension (syntax highlighting + LSP client)
├── docs/                      # Documentation (DE + EN)
├── website/                   # Project website
├── modules/                   # Language modules (mqtt, discord, x, etc.)
├── Makefile
├── go.mod
└── LICENSE

贡献

请参阅 CONTRIBUTING.md。

许可证

MIT — 请参阅 LICENSE。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。