From be8be95d8b4e3238e9b4c691c03be5e0e1db6ccd Mon Sep 17 00:00:00 2001 From: Jarian Cottingham Date: Tue, 3 Feb 2026 22:04:34 +0000 Subject: [PATCH] Fix OpenAPI endpoint to properly serve openapi.json file --- app.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app.py b/app.py index 9e96a34..badaa3a 100755 --- a/app.py +++ b/app.py @@ -196,6 +196,11 @@ def get_capabilities(): "path": "/capabilities", "method": "GET", "description": "MCP capabilities endpoint" + }, + { + "path": "/openapi.json", + "method": "GET", + "description": "OpenAPI specification" } ], "features": [ @@ -207,6 +212,18 @@ def get_capabilities(): ] }) +@app.route('/openapi.json', methods=['GET']) +def get_openapi(): + """Serve the OpenAPI specification file""" + try: + # Read the openapi.json file from the filesystem + with open('openapi.json', 'r') as f: + import json + spec = json.load(f) + return jsonify(spec) + except Exception as e: + return jsonify({"error": "OpenAPI specification not found"}), 404 + if __name__ == '__main__': # Fix the port issue by using a different port app.run(host='0.0.0.0', port=4096, debug=True)