openrpc-mpc-server icon indicating copy to clipboard operation
openrpc-mpc-server copied to clipboard

Documentation generation tooling?

Open geelen opened this issue 1 year ago • 0 comments

I've just learned about OpenRPC from the list of MCP servers and I'm wondering if it might make sense to adapt some of the stuff I've already built to be compliant with the OpenRPC spec.

For reference, I built the Cloudflare MCP Server which followed the standard MCP TS SDK, but then moved on to a more experimental project: https://github.com/geelen/workers-mcp-server

I'm interested in exposing Cloudflare Workers' new RPC functionality (https://blog.cloudflare.com/javascript-native-rpc/) to Claude and other MCP clients directly, which (until https://github.com/modelcontextprotocol/specification/pull/101 lands), requires a local MCP server to act as a proxy to the remote Worker. At the moment I've hacked something together but I thought it might make sense to standardise that transport, which is why I started looking at OpenRPC.

I'm still exploring so I'll have more questions later, but I wanted to see if I'd missed something re: documentation tooling. For my purposes, I wanted the Worker to be the source-of-truth of both documentation and implementation, then extract something JSON API-like out of it:

image

I went looking for something that could do this automatically but couldn't find anything, so ended up making my own generator based on JSDoc: https://github.com/geelen/workers-mcp-server/blob/main/scripts/generate-docs.ts

So my question is: do you know of any existing tooling like this? Specifically: it needs to export the structure of a JS class (methods & arguments) as an RPC schema. All the automatic schema generation I could find was geared around HTTP routes.

Second question: if this is something new, would turning my prototype into a full "OpenRPC Schema Generator" standalone tool be of interest? I need to break this out into a package, but as it stands it's awkwardly not quite specific to MCPs but also not quite generic enough to be JSON API/RPC tooling. Maybe OpenRPC is a better fit?

geelen avatar Dec 10 '24 06:12 geelen