fix: implement token-based authentication at server startup

- Server now authenticates from GRIST_MCP_TOKEN env var or token parameter
- Removed unused code (_set_agent, nonlocal check)
- Added AuthError handling in main.py
- Updated test to pass token explicitly
This commit is contained in:
2025-12-03 15:07:06 -05:00
parent 1ed5554944
commit f716e5d37e
3 changed files with 27 additions and 17 deletions

View File

@@ -21,7 +21,7 @@ tokens:
permissions: [read, write, schema]
""")
server = create_server(str(config_file))
server = create_server(str(config_file), token="test-token")
# Server should have tools registered
assert server is not None