PA

palaryn-ai/mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 0 forks 质量 69 趋势 0MIT

Palaryn MCP wraps the Palaryn gateway as a Model Context Protocol server, giving Claude Code, Cursor, Windsurf, and any MCP-compatible client policy-enforced access to external APIs with zero code...

概览

Palaryn MCP wraps the Palaryn gateway as a Model Context Protocol server, giving Claude Code, Cursor, Windsurf, and any MCP-compatible client policy-enforced access to external APIs with zero code changes. Every HTTP request your AI agent makes flows through the Palaryn pipeline: Each tool accepts: url (required), headers, body, timeout_ms, purpose, labels. Done. All requests from Claude Code now route through Palaryn. You will be prompted to log in via OAuth on first use. Create .mcp.json in your project root (see .mcp.json.example): : Ensure palaryn-mcp is installed (e.g., via npm install palaryn-mcp) so npx can resolve it. Pass a custom policy via environment variable: Three pre-built policy packs are included:

README

以下为原文 README 节选,完整内容请查看原文。

Palaryn MCP Server

Agent I/O governance for every HTTP request your AI agent makes — exposed as an MCP server.

Palaryn MCP wraps the Palaryn gateway as a Model Context Protocol server, giving Claude Code, Cursor, Windsurf, and any MCP-compatible client policy-enforced access to external APIs with zero code changes.


What It Does

Every HTTP request your AI agent makes flows through the Palaryn pipeline:

Claude Code / Cursor / MCP Client
        |
        | stdio (JSON-RPC 2.0) or HTTP (/mcp)
        v
  Palaryn MCP Server
        |
        +---> Rate Limiting     (per-actor sliding window)
        +---> Anomaly Detection (statistical outlier flagging)
        +---> Policy Engine     (YAML rules: allow / deny / require approval)
        +---> DLP Scanner       (secrets, PII, 119 detection patterns)
        +---> Prompt Injection  (3-layer cascade: regex → DeBERTa → LLM)
        +---> Call Limits       (per-user / workspace daily & monthly caps)
        +---> HTTP Execution    (retries, backoff, SSRF protection)
        +---> Output DLP Scan   (response body scanning)
        +---> Audit Logging     (immutable append-only trace)
        |
        v
   External API

Three MCP tools exposed:

Tool Method Capability Description
http_request Any Inferred Execute any HTTP request (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)
http_get GET read GET request shorthand
http_post POST write POST request shorthand

Each tool accepts: url (required), headers, body, timeout_ms, purpose, labels.


Quick Start

Option 1: Hosted (requires a Palaryn account)

claude mcp add --transport http palaryn https://app.palaryn.com/mcp

Done. All requests from Claude Code now route through Palaryn. You will be prompted to log in via OAuth on first use.

Option 2: Project-level config

Create .mcp.json in your project root (see .mcp.json.example):

{
  "mcpServers": {
    "palaryn": {
      "type": "stdio",
      "command": "npx",
      "args": ["palaryn-mcp"],
      "env": {
        "POLICY_PACK_PATH": "./policy-packs/default.yaml"
      }
    }
  }
}

Note: Ensure palaryn-mcp is installed (e.g., via npm install palaryn-mcp) so npx can resolve it.


Configuration

Environment Variables

Variable Default Description
PALARYN_MCP_WORKSPACE ws-claude-code Workspace ID for tool calls
PALARYN_MCP_ACTOR claude-code Actor ID for audit trails
PALARYN_MCP_PLATFORM claude_code Platform identifier
POLICY_PACK_PATH ./policy-packs/default.yaml Path to the active policy pack

Custom Policy Pack

Pass a custom policy via environment variable:

claude mcp add palaryn \
  -e POLICY_PACK_PATH=./policy-packs/prod_strict.yaml \
  -- node bin/palaryn-mcp.js

Policy Packs

在 GitHub 查看完整 README

安装

npx palaryn-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "palaryn": { "type": "stdio", "command": "npx", "args": ["palaryn-mcp"], "env": { "POLICY_PACK_PATH": "./policy-packs/default.yaml" } } } }