30 lines
645 B
Python
30 lines
645 B
Python
from pathlib import Path
|
|
import json
|
|
from mcp.server.fastmcp import FastMCP
|
|
|
|
MCP_ROOT = Path(__file__).resolve().parent / "mcp"
|
|
|
|
mcp = FastMCP("aetoskia-mail-intake-docs")
|
|
|
|
|
|
@mcp.resource("docs://index")
|
|
def index():
|
|
return json.loads((MCP_ROOT / "index.json").read_text())
|
|
|
|
|
|
@mcp.resource("docs://nav")
|
|
def nav():
|
|
return json.loads((MCP_ROOT / "nav.json").read_text())
|
|
|
|
|
|
@mcp.resource("docs://module/{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())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
mcp.run()
|