snowflake.snowpark.mcp.MCPServer¶
- class snowflake.snowpark.mcp.MCPServer(name: str, tools: Iterable[Tool] = ())[source]¶
Bases:
objectA Snowflake-managed MCP server defined in Python.
The definition is independent of where it is deployed: pass
database,schemaandsuffixto each method to work with, for example, a dev and a prod copy of the same server.databaseandschemadefault to the session’s current ones. Passdatabase,schemaandsuffixthe same way todeploy,grant_usage,call_toolanddrop: each call targets the copy they name.- Parameters:
name – The server name, an unquoted identifier.
tools – The server’s tools.
Methods
add(*tools)Adds tools.
call_tool(session, tool_name[, arguments, ...])Calls a deployed tool over
sessionwith tool-callarguments, by name, and returns its result.deploy(session, *[, database, schema, ...])Creates or replaces the server and the procedures and UDFs of its Python tools.
drop(session, *[, database, schema, suffix, ...])Drops the server and, with
include_tools=True, the procedures and UDFs it created, which the session's role owns.endpoint_url(session, *[, database, schema, ...])Returns the URL MCP clients connect to.
grant_usage(session, role, *[, database, ...])Grants
rolewhat it needs to connect to the server and call each of its tools: usage on the database, schema and server, usage on every tool's procedure, UDF, agent or search service and its database and schema, select on semantic views, and usage on every warehouse set on a tool.to_spec([session, database, schema, suffix])Returns the server's specification as a dict.
to_yaml([session, database, schema, suffix])Returns the server's specification as YAML, as
CREATE MCP SERVERtakes it.tool(name)Returns the tool with this name.