Token导航 LogoToken导航TokenDH.com
yas MCP logo
运维云端未说明官方级别未说明来源级核验

yas MCP

MCP Server

将OpenAPI规范转换为MCP服务器,支持AI助手调用和A2A协议通信,内置认证、指标和缓存功能。

工具数

0

提示词数

0

GitHub Stars

1

资源数

0
API转换RustAPI集成OAuth认证

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

allen-munsch

提供方

allen-munsch

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

在30秒内将任何REST API转化为人工智能工具。

将yas-mcp指向OpenAPI规范,它将成为您的AI助手可以调用的mcp服务器。它还讲述了用于代理到代理通信的A2A协议。内置了身份验证、指标和缓存。

# 1. Point at an OpenAPI spec
yas-mcp --swagger-file https://petstore3.swagger.io/api/v3/openapi.json --mode http

# 2. That's it. Your AI can now call:
#    • tools/list  → "What can you do?"
#    • tools/call  → "List all pets, create an order, update user..."

______________________________________________________________________

✨ 它的作用

你有yas mcp给你的
OpenAPI/Swagger文件带有键入工具的MCP服务器
OIDC提供程序URL自动发现的OAuth2保护
多个API一个代理为所有API提供服务
需要聊天的AI代理A2A协议用于代理到代理的委托
生产要求指标、速率限制、断路器、缓存
   OpenAPI Spec                yas-mcp                   AI Assistant
  ┌──────────────┐         ┌──────────────┐         ┌──────────────┐
  │  GET /pets   │────────▶│  listPets()  │────────▶│  "List all    │
  │  POST /pets  │         │  createPet() │         │   available  │
  │  GET /store  │         │  getOrders() │         │   pets"      │
  │  ...         │         │  ...         │         └──────────────┘
  └──────────────┘         └──────┬───────┘
                                  │
                        ┌─────────┼─────────┐
                        │         │         │
                  ┌─────▼────┐ ┌─▼──────┐ ┌─▼──────────┐
                  │  Dex     │ │  A2A   │ │ Prometheus │
                  │  (OIDC)  │ │ Agents │ │  /metrics  │
                  └──────────┘ └────────┘ └────────────┘

______________________________________________________________________

🚀 快速入门

选项1:Docker Compose(推荐-包括所有内容)

git clone https://github.com/allen-munsch/yas-mcp.git
cd yas-mcp

# Start with the built-in Todo API example
docker compose up -d

# Verify it's alive
curl http://localhost:3000/health
# → OK

# List available tools
curl -s -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | jq

# Run the flying probe to verify everything
make probe

选项2:从源代码构建

cargo build --release
./target/release/yas-mcp \
  --swagger-file examples/petstore.yaml \
  --mode http \
  --port 3000

选项3:使用您自己的API

docker compose up -d
# Edit the mounted config to point at your API
# Or:
export SWAGGER_FILE_PATH=~/my-api/openapi.yaml
docker compose up -d

______________________________________________________________________

🧪 飞针

与电路板测试仪一样,飞行探针系统地验证了yas-mcp部署的每个表面:

# Local probe
bash scripts/flying-probe.sh

# Docker probe
docker compose --profile probe run --rm flying-probe

# Kubernetes — runs continuously as a sidecar + CronJob
kubectl apply -k deploy/minikube/base

测试了7块板: 健康与探索→ MCP协议→ 工具调用→ A2A生命周期→ 身份验证中间件→ 速率限制→ 信号质量。看 scripts/flying-probe.sh.

______________________________________________________________________

📋 配置

一切顺利 config.yaml。这是完整的菜单:

server:
  mode: http          # stdio | http
  port: 3000
  host: 0.0.0.0

# Give it an OpenAPI spec — yas-mcp does the rest
swagger_file: "examples/todo-app/openapi.yaml"

# Auto-discover OIDC — just paste the issuer URL
oauth:
  enabled: true
  provider: oidc
  issuer_url: "https://dex.example.com"
  client_id: "${OIDC_CLIENT_ID}"
  client_secret: "env://OIDC_CLIENT_SECRET"  # ← secret refs!

# A2A protocol for agent-to-agent delegation
a2a:
  enabled: true
  agent_card_name: "My API Agent"

# Production safeguards
cache:
  enabled: true
  default_ttl_secs: 60

# Auth middleware — chain multiple providers
auth:
  middleware_chain:
    - type: bearer_token
      route_filter: "/api/**"
      config:
        token: "env://API_TOKEN"

秘密参考

永远不要在配置中放置原始秘密。请改用引用:

参考来源
env://MY_VAR环境变量
file:///run/secrets/tokenDocker/K8s秘密文件
literal://value明确的字面意思(为清楚起见)

______________________________________________________________________

🏗️ 建筑

src/
├── internal/
│   ├── a2a/           A2A protocol (agent card, task store, SSE streaming)
│   ├── auth/          OIDC discovery, JWKS validation, OAuth2 providers
│   ├── catalog/       AI Catalog auto-generation
│   ├── config/        Layered config (YAML + env + CLI)
│   ├── control/       Rate limiting, circuit breakers, response caching
│   ├── mcp/           MCP processor, tool registry, protocol types
│   ├── parser/        OpenAPI 3.x parser (YAML/JSON)
│   ├── requester/     HTTP client, route executors
│   ├── secrets/       Secret resolution (env://, file://, custom backends)
│   ├── server/        HTTP server, tool handler, auth middleware
│   ├── telemetry/     Prometheus metrics
│   └── transport/     STDIO transport, mock transport, runner

______________________________________________________________________

🔧 发展

make build          # cargo build --release
make test-unit      # 214 unit tests
make lint           # clippy --all-targets
make fmt            # cargo fmt

make probe          # flying probe against local server
make test-e2e       # docker compose integration tests
make test-a2a       # A2A protocol tests
make test-full      # full stack: Dex OIDC + MCP + A2A
make test-all       # everything

______________________________________________________________________

📊 端点

端点方法什么
/healthGET健康检查
/metricsGETPrometheus指标(计数器、直方图、仪表)
/mcpPOSTMCP JSON-RPC(工具/列表、工具/调用、初始化、ping)
/.well-known/agent-card.json获取A2A代理卡(发现)
/a2a/tasks/sendPOST提交A2A任务
/a2a/tasks/sendSubscribePOST提交+SSE流媒体更新
/a2a/tasks/getGET获取任务状态
/a2a/tasks/cancelPOST取消任务
/.well-known/ai-catalog.jsonGETAI目录(跨协议发现)

______________________________________________________________________

🛡️ 生产特点

  • ✅ Prometheus指标,包括每个工具的计数器、直方图、错误率
  • ✅ 速率限制——每个客户端的令牌桶,可配置的突发/重新填充
  • ✅ 断路器——根据上游故障检测,半开探测
  • ✅ 响应缓存——基于TTL、按路由覆盖、无效
  • ✅ 优雅关机——SIGTERM排水,飞行中请求完成
  • ✅ Auth中间件链-承载令牌,API密钥,自定义提供商
  • ✅ OIDC发现-- issuer_url → 自动配置的身份验证端点
  • ✅ JWKS验证——带密钥轮换的JWT签名验证
  • ✅ 秘密参考-- env://, file://,永远不要硬编码秘密
  • ✅ 飞行探针——连续系统健康验证

______________________________________________________________________

📚 更多文档

______________________________________________________________________

📄 许可证

Apache 2.0——请参阅 许可证 了解详情。

目录标签

目录标签

API转换RustAPI集成OAuth认证本地部署AI工具MCP服务器A2A协议OpenAPI

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

oauth

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明oauth部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP