-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi_wrapper.py
More file actions
35 lines (29 loc) · 955 Bytes
/
Copy pathapi_wrapper.py
File metadata and controls
35 lines (29 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Optional HTTP wrapper for Postman testing.
NOT part of standard MCP - just for debugging.
"""
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from src.tools.session_analyzer import analyze_forex_session
import uvicorn
app = FastAPI(title="Forex Session API (Debug Only)")
class AnalysisRequest(BaseModel):
pair: str
target_session: str = "auto"
@app.post("/analyze")
async def analyze(request: AnalysisRequest):
"""Analyze forex session - Postman compatible endpoint."""
try:
result = analyze_forex_session(
request.pair,
request.target_session
)
return result
except Exception as e:
raise HTTPException(status_code=400, detail=str(e))
@app.get("/health")
async def health():
"""Health check endpoint."""
return {"status": "ok", "service": "forex-session-mcp"}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)