Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for the authenticator arg #9

Open
dwiso opened this issue Feb 11, 2025 · 8 comments
Open

add support for the authenticator arg #9

dwiso opened this issue Feb 11, 2025 · 8 comments

Comments

@dwiso
Copy link

dwiso commented Feb 11, 2025

Thanks for creating this MCP.

It would be great it you could add support for the authenticator arg to be passed in the config without a password. My org does not allow password Auth.

@FabrizioMFE
Copy link

+1 to authenticator argument, I can only use Okta SSO and not passwords

@isaacwasserman
Copy link
Owner

Hi @dwiso and @FabrizioMFE , I'd be happy to work on this. However, I don't personally have access to a 3rd party authenticator, so I will need some help testing it. My current plan is to support all of the arguments listed here. Does that sound sufficient for your use case?

@FabrizioMFE
Copy link

@isaacwasserman Yes! At least for me that would be great! I'm happy to test, I'm trying to use the MCP server in Cursor (for some more context), Smithery has an easy to use command generator.

@isaacwasserman
Copy link
Owner

@FabrizioMFE the latest commit (a64e093) should be able to accept the authenticator argument. Before I publish, could you clone and test with your SSO?

@FabrizioMFE
Copy link

FabrizioMFE commented Feb 12, 2025

@isaacwasserman I can get it to work in a terminal with this command "uv --directory "C:/path/to/mcp-snowflake-server/src" run mcp_snowflake_server --account "PXA00000" --warehouse "EXAMPLE_WH" --user "[email protected]" --authenticator "externalbrowser" --role "USER_ROLE" --database "EXAMPLE_DB" --schema "EXAMPLE_SCHEMA"" but in Cursor it just says there's no tools available 🤔 when I try to add it, it like quickly flashes a terminal before closing it and I'm not sure where to find logs for this?

Of note, when I run it in a terminal, it auto opens the default browser to the SSO login page, and won't move until I finish logging in. Not sure if Cursor maybe tries to kill the terminal too fast? not that it would be an issue with your code though if that were the case

@isaacwasserman
Copy link
Owner

@FabrizioMFE It's possible that Cursor's terminal doesn't allow programs to open browser windows. Have you used any other servers where this type of login flow works?

@FabrizioMFE
Copy link

FabrizioMFE commented Feb 12, 2025

@isaacwasserman Sadly no sorry, I haven't ☹ this is the first MCP server I've felt I actually have a use for so I have not tested other MCP servers much less ones with this type of login flow

Note that it's also completely feasible that my command is not correct. I think I got it right but like I mentioned, this is the first MCP server I've tried on Cursor so I don't have a ton of knowledge on it.

@pempey
Copy link

pempey commented Feb 13, 2025

@isaacwasserman I have cloned the repo, set up the local config, and gotten the server to initialize. When I open Claude, a browser window opens and I am able to properly authenticate. There are some error messages that pop up but I think they are related to handling all of the response. I have included part of the log file where I opened the app, got warning/errors and then closed the app. Despite the errors I am able to use the tools and Claude is able to respond to prompts with queries to the database.

Let me know if there is anything else from the logs you could use or if more testing is needed.

"snowflake_prod": {
        "command": "/<local path>/uv",
        "args": [
            "--directory",
            "/<path>/mcp-snowflake-server",
            "run",
            "mcp_snowflake_server",
            "--account",
            "<our account>",
            "--warehouse",
            "<our warehouse>",
            "--user",
            "<my user>",
            "--authenticator",
            "externalbrowser",
            "--role",
            "<target role>",
            "--database",
            "<our database>",
            "--schema",
            "<our schema>"
        ]
    }

2025-02-13T17:54:27.821Z [snowflake_prod] [info] Initializing server...
2025-02-13T17:54:27.840Z [snowflake_prod] [info] Server started and connected successfully
2025-02-13T17:54:27.842Z [snowflake_prod] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
2025-02-13 10:54:30,701 - mcp_snowflake_server - INFO - Starting Snowflake MCP Server
2025-02-13 10:54:30,701 - mcp_snowflake_server - INFO - Allow write operations: False
2025-02-13 10:54:30,701 - mcp_snowflake_server - INFO - Prefetch table descriptions: True
2025-02-13 10:54:30,701 - mcp_snowflake_server - INFO - Excluded tools: []
2025-02-13 10:54:30,702 - mcp_snowflake_server - INFO - Prefetching table descriptions
2025-02-13 10:54:30,703 - snowflake.connector.connection - INFO - Snowflake Connector for Python Version: 3.13.2, Python Version: 3.10.3, Platform: macOS-15.3-x86_64-i386-64bit
2025-02-13 10:54:30,703 - snowflake.connector.connection - INFO - Connecting to GLOBAL Snowflake domain
2025-02-13 10:54:30,703 - snowflake.connector.connection - INFO - This connection is in OCSP Fail Open Mode. TLS Certificates would be checked for validity and revocation status. Any other Certificate Revocation related exceptions or OCSP Responder failures would be disregarded in favor of connectivity.
2025-02-13 10:54:35,620 - snowflake.snowpark.session - INFO - Snowpark Session information: 
"version" : 1.27.0,
"python.version" : 3.10.3,
"python.connector.version" : 3.13.2,
"python.connector.session.id" : 44655395881490,
"os.name" : Darwin

2025-02-13 10:54:39,807 - mcp_snowflake_server - INFO - Allowed tools: ['read_query', 'append_insight']
2025-02-13 10:54:39,812 - mcp_snowflake_server - INFO - Server running with stdio transport
2025-02-13T17:54:39.816Z [snowflake_prod] [error] Unexpected token 'I', "Initiating"... is not valid JSON {"context":"connection","stack":"SyntaxError: Unexpected token 'I', \"Initiating\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at I0e (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:56:189)\n    at R0e.readMessage (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:56:115)\n    at k0e.processReadBuffer (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:57:1842)\n    at Socket.<anonymous> (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:57:1523)\n    at Socket.emit (node:events:518:28)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)"}
2025-02-13T17:54:39.817Z [snowflake_prod] [error] Unexpected token 'G', "Going to o"... is not valid JSON {"context":"connection","stack":"SyntaxError: Unexpected token 'G', \"Going to o\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at I0e (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:56:189)\n    at R0e.readMessage (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:56:115)\n    at k0e.processReadBuffer (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:57:1842)\n    at Socket.<anonymous> (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:57:1523)\n    at Socket.emit (node:events:518:28)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)"}
2025-02-13T17:54:39.818Z [snowflake_prod] [info] Message from server: {"jsonrpc":"2.0","id":0,"result":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"prompts":{"listChanged":false},"resources":{"subscribe":false,"listChanged":false},"tools":{"listChanged":false}},"serverInfo":{"name":"snowflake","version":"0.4.0"}}}
2025-02-13T17:54:39.819Z [snowflake_prod] [info] Message from client: {"method":"notifications/initialized","jsonrpc":"2.0"}
2025-02-13T17:54:39.832Z [snowflake_prod] [info] Message from client: {"method":"resources/list","params":{},"jsonrpc":"2.0","id":1}
2025-02-13 10:54:39,832 - mcp.server.lowlevel.server - INFO - Processing request of type ListResourcesRequest
2025-02-13T17:54:39.832Z [snowflake_prod] [info] Message from client: {"method":"tools/list","params":{},"jsonrpc":"2.0","id":2}
2025-02-13 10:54:39,841 - mcp.server.lowlevel.server - INFO - Processing request of type ListToolsRequest
2025-02-13 10:54:39,841 - mcp_snowflake_server - INFO - Listing tools
2025-02-13 10:54:39,841 - mcp_snowflake_server - ERROR - Allowed tools: [Tool(name='read_query', description='Execute a SELECT query.', input_schema={'type': 'object', 'properties': {'query': {'type': 'string', 'description': 'SELECT SQL query to execute'}}, 'required': ['query']}, handler=<function handle_read_query at 0x10d773e20>, tags=[]), Tool(name='append_insight', description='Add a data insight to the memo', input_schema={'type': 'object', 'properties': {'insight': {'type': 'string', 'description': 'Data insight discovered from analysis'}}, 'required': ['insight']}, handler=<function handle_append_insight at 0x10d773eb0>, tags=['resource_based'])]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants