Add MCP capabilities endpoint to make API MCP compliant
This commit is contained in:
parent
d3ba5cc082
commit
71a3dcc4ee
43
app.py
43
app.py
@ -164,6 +164,49 @@ def get_version():
|
|||||||
"""Get API version"""
|
"""Get API version"""
|
||||||
return jsonify({'version': '1.0.0'})
|
return jsonify({'version': '1.0.0'})
|
||||||
|
|
||||||
|
@app.route('/capabilities', methods=['GET'])
|
||||||
|
def get_capabilities():
|
||||||
|
"""MCP capabilities endpoint"""
|
||||||
|
return jsonify({
|
||||||
|
"name": "YouTube CLI API",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "YouTube CLI API for searching and downloading videos",
|
||||||
|
"endpoints": [
|
||||||
|
{
|
||||||
|
"path": "/search",
|
||||||
|
"method": "GET",
|
||||||
|
"description": "Search YouTube videos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/download",
|
||||||
|
"method": "POST",
|
||||||
|
"description": "Download a video by URL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/health",
|
||||||
|
"method": "GET",
|
||||||
|
"description": "Health check endpoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/version",
|
||||||
|
"method": "GET",
|
||||||
|
"description": "Get API version"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/capabilities",
|
||||||
|
"method": "GET",
|
||||||
|
"description": "MCP capabilities endpoint"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"Video search",
|
||||||
|
"Video download",
|
||||||
|
"Health monitoring",
|
||||||
|
"Version information",
|
||||||
|
"MCP compliance"
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Fix the port issue by using a different port
|
# Fix the port issue by using a different port
|
||||||
app.run(host='0.0.0.0', port=4096, debug=True)
|
app.run(host='0.0.0.0', port=4096, debug=True)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user