Skip to main content
Glama

Skillz MCP Server

by pwntato
main.py1.54 kB
from fastapi import FastAPI, HTTPException import os import frontmatter from pathlib import Path from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/") def read_root(): return RedirectResponse(url="/docs") @app.get("/skills") def list_skills(): skills_dir = Path(os.getenv("SKILLZ_DIR", "/skillz")) if not skills_dir.is_dir(): return {"error": "skillz directory not found"} skills = [] for skill_dir in skills_dir.iterdir(): if skill_dir.is_dir(): skill_file_path = skill_dir / "SKILL.md" if skill_file_path.is_file(): try: post = frontmatter.load(skill_file_path) skills.append({ "name": post.get("name"), "description": post.get("description"), "skill_id": skill_dir.name }) except Exception as e: # Ignore files that don't have valid frontmatter pass return {"skills": skills} @app.get("/skills/{skill_id}/{file_path:path}") def get_skill_file(skill_id: str, file_path: str): skill_dir = Path(os.getenv("SKILLZ_DIR", "/skillz")) / skill_id if not skill_dir.is_dir(): raise HTTPException(status_code=404, detail="Skill not found") file = skill_dir / file_path if not file.is_file(): raise HTTPException(status_code=404, detail="File not found") with open(file, "r") as f: return {"content": f.read()}

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pwntato/skillz_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server