Initial commit: Python MCP server (Streamable HTTP, API key, return documents)

This commit is contained in:
2026-06-13 06:02:13 +00:00
commit 269f3b9757
7 changed files with 1855 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
from __future__ import annotations
import os
from typing import List
def list_templates(templates_dir: str) -> dict:
if not os.path.isdir(templates_dir):
return {"templates": []}
templates: List[str] = []
for entry in os.listdir(templates_dir):
path = os.path.join(templates_dir, entry)
if os.path.isfile(path) and entry.lower().endswith(".docx"):
templates.append(entry)
templates.sort()
return {"templates": templates}
def open_template_path(templates_dir: str, name: str) -> str:
path = os.path.join(templates_dir, name)
if not os.path.isfile(path):
raise ValueError(f"Template not found: {name}")
return path