removed mcp
This commit is contained in:
@@ -2,28 +2,31 @@ from pathlib import Path
|
||||
import json
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
MCP_ROOT = Path(__file__).resolve().parent / "mcp"
|
||||
MCP_ROOT = Path("mcp")
|
||||
|
||||
mcp = FastMCP("aetoskia-mail-intake-docs")
|
||||
|
||||
def read_json(path: Path):
|
||||
if not path.exists():
|
||||
return {"error": "not_found", "path": str(path)}
|
||||
return json.loads(path.read_text())
|
||||
|
||||
@mcp.resource("docs://index")
|
||||
def index():
|
||||
return json.loads((MCP_ROOT / "index.json").read_text())
|
||||
|
||||
return read_json(MCP_ROOT / "index.json")
|
||||
|
||||
@mcp.resource("docs://nav")
|
||||
def nav():
|
||||
return json.loads((MCP_ROOT / "nav.json").read_text())
|
||||
return read_json(MCP_ROOT / "nav.json")
|
||||
|
||||
|
||||
@mcp.resource("docs://module/{module}")
|
||||
@mcp.resource("docs://{module}")
|
||||
def module(module: str):
|
||||
path = MCP_ROOT / "modules" / f"{module}.json"
|
||||
if not path.exists():
|
||||
raise FileNotFoundError(module)
|
||||
return json.loads(path.read_text())
|
||||
return read_json(MCP_ROOT / "modules" / f"{module}.json")
|
||||
|
||||
@mcp.tool()
|
||||
def ping() -> str:
|
||||
return "Pong! (fake tool executed)"
|
||||
|
||||
if __name__ == "__main__":
|
||||
mcp.run()
|
||||
# FastMCP owns the HTTP server
|
||||
mcp.run(transport="streamable-http")
|
||||
|
||||
Reference in New Issue
Block a user