@avidian/mcp-openapi 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// src/index.ts
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { realpathSync } from "node:fs";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
5
6
|
|
|
6
7
|
// src/config.ts
|
|
@@ -803,8 +804,16 @@ async function main() {
|
|
|
803
804
|
const transport = new StdioServerTransport;
|
|
804
805
|
await server.connect(transport);
|
|
805
806
|
}
|
|
806
|
-
|
|
807
|
-
if (
|
|
807
|
+
function isMainModule() {
|
|
808
|
+
if (process.argv[1] === undefined)
|
|
809
|
+
return false;
|
|
810
|
+
try {
|
|
811
|
+
return fileURLToPath(import.meta.url) === realpathSync(process.argv[1]);
|
|
812
|
+
} catch {
|
|
813
|
+
return false;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
if (isMainModule()) {
|
|
808
817
|
main().catch((error) => {
|
|
809
818
|
console.error(`mcp-openapi: ${errorMessage(error)}`);
|
|
810
819
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avidian/mcp-openapi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "MCP server for OpenAPI/Swagger — gives AI agents the ability to discover, search, and call any REST API described by an OpenAPI document.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|