最新资讯
dev.to 精简 MCP server 工具数量:更少工具、更小影响面,双重收益 dev.to 为什么 git checkout 无法撤销 AI 编码 agent 的改动? wechat AI短剧门槛降降降!实测即梦短剧工作室:剧本分镜预演一条龙,伙伴计划长期护航 dev.to 让模型改写文档前,先量化事实保真度 dev.to 回放 153 个 Claude Code 与 Codex 会话,审计 Agent 的生产影响范围 dev.to 银行 77 意图分类最便宜 LLM:GPT-6.1 Terra 每次成功任务 $0.000727 theinformation.com Chesky的副业:Airbnb向CEO新设AI实验室出售IP theverge.com OpenAI 宣布数据中心项目不再与公职人员签署保密协议 dev.to NVIDIA 发布四个开放 Cosmos 3 仿真模型 dev.to 真实 MCP 客户端击穿我们服务器的五种方式 theverge.com Airbnb 正在开发 AI 旅行 agent,计划 2027 年上半年推出 wechat 这可能是美国AI最魔幻的一天。
多元动态
登录 注册
行业动态 dev.to · @Shashwat Gupta

从 OpenAPI 规范自动生成原生 Go MCP 服务器(Streamable HTTP 与可组合插件)

原文 我的收藏

文章介绍 Karada.ai 将 OpenAPI/Swagger 规范和 Postman 集合直接编译为原生、独立的 Go MCP(Model Context Protocol)服务器,以避免手写 TypeScript 胶水代码。作者称早期 MCP 服务器多用 TypeScript 或 Python,在编排引擎单次请求查询数十个工具的生产环境中存在内存开销(约 50MB+/进程)、冷启动延迟和依赖管理问题;编译为 Go 二进制后可获得零运行时依赖、单静态二进制内嵌 schema 和 goroutine 并发。文章还说明可组合插件层的设计。内容为项目方自述,未提供具体性能基准。

AI推荐理由 介绍 Karada.ai 将 OpenAPI/Swagger 规范与 Postman 集合编译为原生 Go MCP 服务器,并说明选择 Go + Streamable HTTP 的理由(单静态二进制、无运行时依赖、goroutine 并发)与可组合插件层,对 Agent 工具接入与 MCP 生态有实际工程价值;但为项目方自述,性能与内存对比数据未给出具体基准。

66

正文

Connecting software APIs to AI agents shouldn't require hand-writing brittle TypeScript boilerplate or maintaining complex glue code. We built Karada.ai to compile OpenAPI / Swagger specs and Postman collections directly into native, standalone Go MCP servers using the Model Context Protocol. Here is a breakdown of the architecture, why we standardized on Go + Streamable HTTP, and how the composable plugin layer works. 1. Why Compile to Go for Model Context Protocol? Most early MCP servers were built with TypeScript or Python. In production agent environments where an orchestration engine might query dozens of tools per request, Node/Python runtimes introduce: Heavy memory overhead (~50MB+ per server process vs <10MB in Go). Startup latency overhead on cold boots. Complex dependency management when shipping tools across environments. By compiling API schemas into Go binaries: Zero runtime dependencies—a single static binary with embedded schemas. Concurrency-ready: Goroutines handle parallel tool executions effortlessly. Memory footprint is ultra-low (<10MB RSS). 2. 2026 Stateless Streamable HTTP Transport Instead of relying solely on standard input/output (stdio) or legacy Server-Sent Events (/sse), Karada.ai standardizes on the modern Streamable HTTP transport (StreamableHTTPServerTransport) over POST /mcp + stdio. How it works: Schema Parsing: Ingest your OpenAPI spec URL, YAML/JSON file, or Postman collection. AST Code Generation: Karada's Go engine parses the endpoints, query parameters, auth headers, and schemas, synthesizing typed Go structs and MCP tool definitions. Transport Binding: Tools are automatically exposed over StreamableHTTPServerTransport with bidirectional streaming capabilities and protocol versioning (2026-07-28). 3. Composable 1-Click Plugins A raw API wrapper is rarely enough in production. You need observability, secrets management, and security boundaries. Karada.ai provides modular plugins that attach directly to the compiled Go MCP pipeline: Sentry Error Tracing: Capture agent tool failures with full stack traces. GA4 / PostHog Telemetry: Track tool invocation frequency and latency. Slack Alert Webhooks: Immediate notification when tool calls return 4xx/5xx status codes. Zero-Trust Secret Vaults: Keep upstream API tokens in an encrypted vault; agents never see raw API keys. AI Firewalls & Rate Limiters: Protect backend endpoints against agent loops or prompt injections. 4. Ingestion Workflow Supported ingestion sources: OpenAPI 3.0 / 3.1 / Swagger 2.0: Link a live URL or upload a file. Postman Collections (v2.1): Link your export JSON. Existing Streamable HTTP Servers: Attach Karada.ai's plugin layer and observability to already deployed MCP servers. Check out the live engine and test your OpenAPI specs at Karada.ai. Would love feedback from the developer community on transport design, plugin ideas, and code generation patterns!

来源报道 · 1 篇 · 以下链接均前往原始媒体

← 返回精选动态 原文

更多内容