feat: add MCP server with all tools registered
This commit is contained in:
26
src/grist_mcp/main.py
Normal file
26
src/grist_mcp/main.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""Main entry point for the MCP server."""
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
|
||||
from mcp.server.stdio import stdio_server
|
||||
|
||||
from grist_mcp.server import create_server
|
||||
|
||||
|
||||
async def main():
|
||||
config_path = os.environ.get("CONFIG_PATH", "/app/config.yaml")
|
||||
|
||||
if not os.path.exists(config_path):
|
||||
print(f"Error: Config file not found at {config_path}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
server = create_server(config_path)
|
||||
|
||||
async with stdio_server() as (read_stream, write_stream):
|
||||
await server.run(read_stream, write_stream, server.create_initialization_options())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user