mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
ifcmcp: sse,streamable-http transports and --help
This commit is contained in:
@@ -1,10 +1,36 @@
|
|||||||
# This file was generated with the assistance of an AI coding tool.
|
# This file was generated with the assistance of an AI coding tool.
|
||||||
from ifcmcp.server import build_server
|
import argparse
|
||||||
|
|
||||||
|
from ifcmcp import __version__
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
prog="python3 -m ifcmcp",
|
||||||
|
description=(
|
||||||
|
"ifcmcp — MCP server for IFC building models.\n\n"
|
||||||
|
"Runs a Model Context Protocol server over stdio so that MCP clients\n"
|
||||||
|
"can query and edit IFC files without writing them to disk between\n"
|
||||||
|
"operations.\n\n"
|
||||||
|
"Add to .mcp.json to configure:\n"
|
||||||
|
' {"mcpServers": {"ifc": {"type": "stdio", "command": "python3", "args": ["-m", "ifcmcp"]}}}'
|
||||||
|
),
|
||||||
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||||
|
)
|
||||||
|
parser.add_argument("--version", action="version", version=f"ifcmcp {__version__}")
|
||||||
|
parser.add_argument(
|
||||||
|
"--transport",
|
||||||
|
choices=["stdio", "sse", "streamable-http"],
|
||||||
|
default="stdio",
|
||||||
|
help="MCP transport to use (default: stdio)",
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
from ifcmcp.server import build_server
|
||||||
|
|
||||||
server = build_server()
|
server = build_server()
|
||||||
server.run(transport="stdio")
|
server.run(transport=args.transport)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user