Skip to content

Commit a585342

Browse files
committed
Document library usage and git installs
1 parent f86b311 commit a585342

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@ OpenAPI 3.x to MCP server bridge in TypeScript.
5353
npm install
5454
```
5555

56+
Consume as a library from GitHub:
57+
58+
```bash
59+
npm install github:haasonsaas/mcp-openapi
60+
```
61+
62+
## Library Usage
63+
64+
```ts
65+
import { parseSpec, generateToolsWithTags } from "mcp-openapi";
66+
67+
const normalized = await parseSpec("./openapi.yaml");
68+
const generated = generateToolsWithTags(normalized, { prefix: "github" });
69+
70+
console.log(generated.tools[0]?.name);
71+
```
72+
73+
The library entrypoint exports:
74+
75+
- `parseSpec`
76+
- `generateTools`
77+
- `generateToolsWithTags`
78+
- `NormalizedSpec`
79+
5680
## Run
5781

5882
### stdio

0 commit comments

Comments
 (0)