Skip to content

feat: add protoc-gen-connect-openapi to codegen pipeline#88

Merged
haasonsaas merged 2 commits intomainfrom
add-connect-openapi-codegen
Apr 16, 2026
Merged

feat: add protoc-gen-connect-openapi to codegen pipeline#88
haasonsaas merged 2 commits intomainfrom
add-connect-openapi-codegen

Conversation

@haasonsaas
Copy link
Copy Markdown
Contributor

Summary

  • Adds sudorandom/protoc-gen-connect-openapi (269 stars, actively maintained) as a buf remote plugin
  • Generates OpenAPI v3.1 specs from proto definitions into gen/openapi/
  • Specs match the Connect-RPC wire format, consumable by mcp-openapi for MCP tool generation

Why

Currently only 8 of 22 proto packages have hand-written OpenAPI specs in platform/openapi/. The 14 missing services — including governance, approvals, objectives, prompts, traces, skills — are invisible to agents through MCP.

With this plugin, buf generate auto-produces OpenAPI for all 22 packages. No more manual spec authoring.

Follow-up

  • After merge, run buf generate and verify output in gen/openapi/
  • Wire gen/openapi/ specs into agent-mcp's mcp-openapi pipeline (may require a base template for auth/server info)
  • The hand-written specs in platform/openapi/ can be gradually retired as the generated ones are validated
  • Future: add protovalidate constraints to proto files — the plugin emits them as OpenAPI minimum, pattern, format: uuid etc.

Related issues

🤖 Generated with Claude Code

Adds the sudorandom/protoc-gen-connect-openapi buf plugin to generate
OpenAPI v3.1 specs from proto definitions. Specs land in gen/openapi/
and match the Connect-RPC wire format, so mcp-openapi can consume them
directly to produce MCP tool definitions.

This unblocks evalops/platform#56 by auto-generating OpenAPI for all 22
proto packages — currently only 8 have hand-written specs. The 14 missing
services (governance, approvals, objectives, prompts, traces, skills, etc.)
become agent-visible through MCP without manual spec authoring.

Ref: https://github.com/sudorandom/protoc-gen-connect-openapi

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 16, 2026

PR Summary

Low Risk
Primarily adds a codegen plugin and checked-in generated OpenAPI artifacts; no runtime/business logic changes, but reviewers should watch for repo bloat and regeneration drift.

Overview
Adds community/sudorandom-connect-openapi to buf.gen.yaml so buf generate now emits Connect-RPC wire-format OpenAPI v3.1 specs into gen/openapi/.

Commits the generated OpenAPI YAML outputs (e.g., agents.v1, approvals.v1, attribution.v1, audit.v1, compliance.v1, config.v1, connectors.v1), enabling downstream tooling (like MCP tool generation) to consume service definitions without hand-written specs.

Reviewed by Cursor Bugbot for commit 3ed6af8. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread buf.gen.yaml
- remote: buf.build/community/sudorandom-connect-openapi:v0.19.1
out: gen/openapi
opt:
- path=
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty path= option likely causes generation failure

High Severity

The opt for the OpenAPI plugin sets path= to an empty string. The path option in protoc-gen-connect-openapi specifies a single output filename (e.g., path=openapi.yaml). An empty value will either cause the plugin to attempt writing to an empty-named file (failing generation) or be a silent no-op, making the entire opt: block unnecessary dead configuration. If the intent was per-file output, the opt: section can be removed entirely. If a single merged file was intended, a filename is needed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1fedf36. Configure here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugbot Autofix determined this is a false positive.

The pinned protoc-gen-connect-openapi version treats path= as an empty Path, so buf generate succeeds and falls back to per-proto-file output.

You can send follow-ups to the cloud agent here.

Generated by `buf generate` with the newly added
sudorandom-connect-openapi plugin. Produces OpenAPI v3.1 specs for
all 22 proto packages in gen/openapi/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@haasonsaas haasonsaas merged commit a061523 into main Apr 16, 2026
9 checks passed
@haasonsaas haasonsaas deleted the add-connect-openapi-codegen branch April 16, 2026 01:08
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 3ed6af8. Configure here.

application/json:
schema:
$ref: '#/components/schemas/audit.v1.QueryEventsResponse'
/audit.v1.AuditService/ExportEvents: {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Streaming RPC produces empty path item in OpenAPI

Medium Severity

The server-streaming RPC ExportEvents (defined as returns (stream ExportEventsResponse) in the proto) generates an empty path item {} with no HTTP operations. While technically valid per OpenAPI 3.1, this means mcp-openapi will silently skip this endpoint when generating MCP tool definitions — the audit export functionality becomes invisible to agents. This is the only streaming RPC in the proto definitions, and the empty path item could also confuse or break some OpenAPI tooling that doesn't expect operation-less paths.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3ed6af8. Configure here.

@cursor cursor bot restored the add-connect-openapi-codegen branch April 16, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant