@mcp-com-ai/hapi
v1.3.1
Published
HAPI CLI — the core executable. Thin shell that discovers first-party and third-party plugins, routes commands, and provides a consistent UX across the HAPI stack.
Readme
HAPI CLI 
@mcp-com-ai/hapi provides the hapi command. Install it with the document
plugin(s) you plan to use; HAPI detects whether --specs points to an OpenAPI
or Arazzo document and starts the matching installed plugin.
Install and run
bun add -g \
@mcp-com-ai/[email protected] \
@mcp-com-ai/[email protected] \
@mcp-com-ai/[email protected]Note: The
--headlessflag runs the MCP server with a backend up and running (Brownfield) without the need to code (and duplicate) the business logic.
hapi serve --specs ./my-api.yaml --headless --port 3000Scaffolding and serving a new project (Greenfield development)
# scaffolding a new project (new code/Greenfield) - ONLY if you want to implement the API code from scratch
hapi init --specs ./my-api.yaml
# Serve the API, both as MCP and RESTful API
hapi serve --specs ./my-api.yaml --mcp --port 3000On Windows, --specs accepts drive-absolute paths such as
C:\\Users\\x-user\\contracts\\my-api.yaml, paths relative to the current
directory such as .\\contracts\\my-api.yaml, UNC paths, and Windows file:
or path: URLs. Quote paths containing spaces. Drive-relative forms such as
C:my-api.yaml are rejected because their resolution is process-dependent.
The MCP endpoint is http://localhost:3000/mcp.
# Test the MCP, list available tools
curl http://localhost:3000/mcp \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \ \
--header 'User-Agent: hapi' \
--data '{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {},
"id": 123
}'
# Test a traditional RESTful endpoint (in your OAS/Swagger document)
curl http://localhost:3000/my-rest-endpoint \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'User-Agent: hapi' \
--data '{
"key": "value"
}'Choose a plugin
| You want to serve | Install | Start it |
| ------------------------------------------ | ------------------------------- | -------------------------------------------------------------- |
| An OpenAPI API | @mcp-com-ai/plugin-openapi | hapi serve --specs ./openapi.yaml --headless --url http://my-api.server.com |
| An Arazzo workflow | @mcp-com-ai/plugin-arazzo | hapi serve --specs ./workflow.yaml --headless --url http://my-api.server.com |
| Either document type on Cloudflare Workers | @mcp-com-ai/plugin-cloudflare | hapi cloudflare deploy --specs https://example.com/spec.yaml --headless --url http://my-api.server.com |
hapi openapi serve, hapi arazzo serve, and hapi workflows serve are also
available when their corresponding plugin is installed. workflows and
arazzo are aliases.
How the packages fit together
The CLI discovers installed plugins and presents one command experience. It
installs its engine dependencies automatically; you normally do not install
@mcp-com-ai/core, @mcp-com-ai/shared-utils, or @mcp-com-ai/plugin-sdk
yourself. Keep the CLI and selected plugins on the same HAPI release version.
hapi plugins list
hapi doctorUse hapi plugins list to confirm the capabilities available to this command.
For a full quick start and security guidance, see the
HAPI MCP README.
