{"id":50212875,"url":"https://github.com/annettedorothea/api2ai","last_synced_at":"2026-05-26T07:00:37.848Z","repository":{"id":357203652,"uuid":"1233146657","full_name":"annettedorothea/api2ai","owner":"annettedorothea","description":"api2ai is a PoC for turning existing OpenAPI descriptions into small, curated AI tools","archived":false,"fork":false,"pushed_at":"2026-05-19T07:00:51.000Z","size":1354,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T08:54:54.254Z","etag":null,"topics":["dsl","langium","mcp","openapi"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annettedorothea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-08T16:34:10.000Z","updated_at":"2026-05-19T07:00:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/annettedorothea/api2ai","commit_stats":null,"previous_names":["annettedorothea/api2ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/annettedorothea/api2ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annettedorothea%2Fapi2ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annettedorothea%2Fapi2ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annettedorothea%2Fapi2ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annettedorothea%2Fapi2ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annettedorothea","download_url":"https://codeload.github.com/annettedorothea/api2ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annettedorothea%2Fapi2ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33508317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T03:12:49.672Z","status":"ssl_error","status_checked_at":"2026-05-26T03:12:47.976Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dsl","langium","mcp","openapi"],"created_at":"2026-05-26T07:00:23.643Z","updated_at":"2026-05-26T07:00:37.843Z","avatar_url":"https://github.com/annettedorothea.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# api2ai\n\n**api2ai** curates OpenAPI operations into MCP tools: an **`.api2ai` DSL** selects endpoints and adds AI-facing metadata (intent, examples, tool names, optional auth). A **code generator** (CLI + extension on save) emits tool modules and a stdio MCP host. The language stack is built with **[Langium](https://langium.org/)** (grammar, validation, completion).\n\nSibling project: [db2ai](https://github.com/annettedorothea/db2ai) (PostgreSQL → MCP).\n\nKeywords: **DSL** · **OpenAPI** · **code generator** · **MCP** · **Langium**\n\n## DSL at a glance\n\nFrom [`./packages/extension/demos/spaceflight-news.api2ai`](./packages/extension/demos/spaceflight-news.api2ai) — OpenAPI path, then per operation a block with tool metadata:\n\n```txt\nopenapi \"./openapi/spaceflight-news.openapi.yaml\"\n\nGET \"/v4/articles/{id}/\" {\n    toolName: \"getSpaceflightArticleById\"\n    intent: \"get one spaceflight article by id\"\n    example: \"Get article with id 1\"\n}\n```\n\n`toolName` and `intent` are required; `example`, `summary`, and `description` are optional. Base URL and API keys are **not** in the DSL — configure them in the MCP host (`mcp.json` / env). More demos: [`./packages/extension/demos/`](./packages/extension/demos/).\n\n## MCP demos\n\nBundled demos and walkthrough: **[`./packages/extension/demos/`](./packages/extension/demos/)** — see **[`./packages/extension/demos/README.md`](./packages/extension/demos/README.md)**.\n\n**Without cloning the repo:** install the VSIX, then Command Palette → **api2ai: Create demo workspace (MCP examples)**. Details: [`./packages/extension/README.md`](./packages/extension/README.md).\n\n## Getting started (DSL / monorepo)\n\nPrerequisite: **Node.js 20+**.\n\n- Clone the repo\n- Repository root: `npm install` → `npm run langium:generate` → `npm run build`\n- Open the **`api2ai`** repository root in Cursor/VS Code\n- Edit or create a `.api2ai` file (e.g. under `./packages/extension/demos/`)\n- **Extension dev:** Run and Debug → **Run api2ai Extension** (opens `packages/extension/demos/` in an Extension Development Host; save regenerates tools)\n- **CLI only:** `node ./packages/cli/bin/cli.js generate \u003cfile.api2ai\u003e \u003cout-tools.ts\u003e` then `npm run build` if needed\n\nDetails for MCP demos: **[`./packages/extension/demos/README.md`](./packages/extension/demos/README.md)**.\n\n## Project layout\n\n| Path                        | Role                                                                |\n| --------------------------- | ------------------------------------------------------------------- |\n| `packages/language`         | Langium grammar, validation, OpenAPI linking                        |\n| `packages/cli`              | `generate`, smoke tests, MCP bundle                                 |\n| `packages/extension`        | VS Code / Cursor extension (VSIX); includes **`demos/`**            |\n| `packages/extension/demos/` | Sample `.api2ai`, OpenAPI, `.cursor/mcp.json`, `generate:*` scripts |\n\nPackage notes: [`./packages/language/README.md`](./packages/language/README.md) · [`./packages/cli/README.md`](./packages/cli/README.md)\n\n## npm scripts (repository root)\n\n| Script                | Purpose                                                      |\n| --------------------- | ------------------------------------------------------------ |\n| `langium:generate`    | Regenerate Langium AST/grammar from `packages/language`      |\n| `langium:watch`       | Watch grammar and regenerate on change                       |\n| `build`               | TypeScript build (workspaces) + `bundle:mcp-runtime`         |\n| `build:clean`         | `clean` then `build`                                         |\n| `watch`               | TypeScript watch on the monorepo build graph                 |\n| `clean`               | Clean all workspace build outputs                            |\n| `bundle:mcp-runtime`  | Bundle standalone `mcp-serve` into `packages/cli/resources/` |\n| `test`                | All automated tests, including mock API MCP stdio smoke      |\n| `test:smoke`          | Smoke-call one generated Open-Meteo tool                     |\n| `test:smoke:tmdb`     | Smoke TMDB search (needs env/token)                          |\n| `test:smoke:mock-api` | Smoke mock-api `listCustomerOrders`                          |\n| `test:mcp`            | Start MCP server manually (Open-Meteo)                       |\n| `test:mcp:mock-api`   | Smoke mock API through generated MCP stdio host              |\n\nExample tool regeneration: `npm run generate:*` or `npm run generate:all` inside **[`./packages/extension/demos/`](./packages/extension/demos/)**.\n\n## Launch configurations ([`./.vscode/launch.json`](./.vscode/launch.json))\n\n| Configuration                             | What it does                                                                                                   |\n| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------- |\n| **Run api2ai Extension**                  | Extension Development Host with workspace `packages/extension/demos/`. Pre-launch task **Build api-2-ai-dsl**. |\n| **api2ai: completion debug log**          | Same host; sets `API2AI_DSL_DEBUG_COMPLETION=1` for completion tracing.                                        |\n| **Attach: api2ai Language Server (6009)** | Attach debugger to the language server (port 6009).                                                            |\n\nPre-launch task **Build api-2-ai-dsl** in [`./.vscode/tasks.json`](./.vscode/tasks.json) (`langium:generate` + `build`).\n\n## Extension (VSIX)\n\nBuild (maintainers), in **`packages/extension/`**:\n\n```bash\nnpm run extension:vsix\n```\n\n→ `./packages/extension/vscode-api2ai-\u003cversion\u003e.vsix` (**version** from [`./packages/extension/package.json`](./packages/extension/package.json); gitignored via `*.vsix`).\n\nFrom repo root: `npm run extension:vsix -w packages/extension`\n\n### Install in Cursor / VS Code (test)\n\n1. `Cmd+Shift+P` → **`Install from VSIX`** or **`vsix`**\n2. **`Extensions: Install from VSIX`**\n3. Select `./packages/extension/vscode-api2ai-\u003cversion\u003e.vsix`\n4. **`Developer: Reload Window`**\n\nAlternatively drag the `.vsix` into the Extensions panel, or:\n\n```bash\ncursor --install-extension \"/absolute/path/to/api2ai/packages/extension/vscode-api2ai-0.0.1.vsix\"\n```\n\nExtension details: [`./packages/extension/README.md`](./packages/extension/README.md) (includes icon in VSIX).\n\n## License\n\nBUSL-1.1 - see [`./LICENSE`](./LICENSE).\n\n---\n\n_Created with gratitude to Jesus Christ._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannettedorothea%2Fapi2ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannettedorothea%2Fapi2ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannettedorothea%2Fapi2ai/lists"}