feat: add MCP server with all tools registered

This commit is contained in:
2025-12-03 15:00:48 -05:00
parent 9b759cfe76
commit 1ed5554944
3 changed files with 362 additions and 0 deletions

26
src/grist_mcp/main.py Normal file
View 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())