Skip to main content
Glama
by JessiP23
main.py1.2 kB
import argparse import sys from pathlib import Path from typing import Optional from findkeyword import mcp from helpers.manual_search import run_manual_search _project_root = Path(__file__).resolve().parent if str(_project_root) not in sys.path: sys.path.insert(0, str(_project_root)) def run_server(transport: Optional[str] = "stdio") -> None: print(f"Starting MCP server (transport={transport})", file=sys.stderr) try: mcp.run(transport=transport) except Exception as exc: print(f"MCP server exited with error: {exc}", file=sys.stderr) raise def main(argv: Optional[list[str]] = None) -> None: argv = argv if argv is not None else sys.argv[1:] parser = argparse.ArgumentParser(description="Start MCP server or run manual search") parser.add_argument("--manual", action="store_true", help="Run manual terminal search and exit (no MCP server)") parser.add_argument("--transport", default="stdio", help="Transport to use for the MCP server (default: stdio)") args = parser.parse_args(argv) if args.manual: run_manual_search() return run_server(transport=args.transport) if __name__ == "__main__": main()

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/JessiP23/mcp'

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