Provides access to Snowflake Cortex AI features including Cortex Search for querying unstructured data in RAG applications, Cortex Analyst for querying structured data via semantic modeling, and Cortex Agent for agentic orchestration across structured and unstructured data retrieval
Snowflake Cortex AI Model Context Protocol (MCP) Server
This Snowflake MCP server provides tooling for Snowflake Cortex AI features, bringing these capabilities to the MCP ecosystem. When connected to an MCP Client (e.g. Claude for Desktop, fast-agent, Agentic Orchestration Framework), users can leverage these Cortex AI features.
The MCP server currently supports the below Cortex AI capabilities:
- Cortex Search: Query unstructured data in Snowflake as commonly used in Retrieval Augmented Generation (RAG) applications.
- Cortex Analyst: Query structured data in Snowflake via rich semantic modeling.
- Cortex Agent: Agentic orchestrator across structured and unstructured data retrieval
RUN:
MCP servers are not the same thing as a Next.js API backend:
- MCP server
- Next.js API route
So putting MCP directly inside Next.js **doesn’t make sense** (MCP clients won’t connect to a Next.js API route).
Getting Started
Connecting to Snowflake
The MCP server uses the Snowflake Cortex / REST API for all authentication and connection methods. Please refer to the official Snowflake documentation for comprehensive authentication options and best practices.
Connection parameters can be passed as environment variables. The server supports Programmtic Access Token to make all API calls.
Payload Builder: Dynamically Creating Agent Requests
The MCP server provides a Payload Builder utility to dynamically construct requests for Cortex Agents. This eliminates hardcoding tool definitions, resources, or queries, making your integrations flexible and maintainable.
How It Works
- Query: The user’s natural language input.
- Tool Definitions: Each tool’s
name
,type
, and optionalresources
. - Tool Resources: Keyed by tool name (snake_case), includes semantic models, search indexes, etc.
- MCP Server: Consumes the payload and orchestrates the tools.
- Response: Streamed via SSE, parsed using
processSSEResponse
.
Example Usage
Key Points
- Exact Matching:
tool_spec.name
must match the snake_case key intool_resources
. - Environment Variables: Use
.env
for dynamic configuration of semantic views, search services, etc. - Streaming Response: MCP returns streamed data; always use
processSSEResponse()
to parse it safely. - Extending Tools: Add new tools to
toolDefinitions
and the builder automatically includes them in the payload.
This section will help developers quickly understand how to generate payloads programmatically and avoid common errors like mismatched tool_resources
.
Using with MCP Clients
The MCP server is client-agnostic and will work with most MCP Clients that support basic functionality for MCP tools and (optionally) resources. Below are some examples.
Claude Desktop
To integrate this server with Claude Desktop as the MCP Client, add the following to your app's server configuration. By default, this is located at
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
Set the path to the service configuration file and configure your connection method.
Add the MCP server as context in the chat.
Microsoft Visual Studio Code + GitHub Copilot
For prerequisites, environment setup, step-by-step guide and instructions, please refer to this blog.
Troubleshooting
Running MCP Inspector
The MCP Inspector is suggested for troubleshooting the MCP server. Run the below to launch the inspector.
Read More: INSPECTOR.md
FAQs
How do I connect to Snowflake?
- Using Programmatic Access Token (PAT). Set as environment variable SNOWFLAKE_PAT.
How do I try this?
- The MCP server is intended to be used as one part of the MCP ecosystem. Think of it as a collection of tools. You'll need an MCP Client to act as an orchestrator. See the MCP Introduction for more information.
Where is this deployed? Is this in Snowpark Container Services?
- All tools in this MCP server are managed services, accessible via REST API. No separate remote service deployment is necessary. Instead, the current version of the server is intended to be started by the MCP client, such as Claude Desktop, Cursor, fast-agent, etc. By configuring these MCP client with the server, the application will spin up the server service for you. Future versions of the MCP server may be deployed as a remote service in the future.
I'm receiving permission errors from my tool calls.
- If using a Programmatic Access Tokens, note that they do not evaluate secondary roles. When creating them, please select a single role that has access to all services and their underlying objects OR select any role. A new PAT will need to be created to alter this property.
How many Cortex Search or Cortex Analysts can I add?
- You may add multiple instances of both services. The MCP Client will determine the appropriate one(s) to use based on the user's prompt.
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables users to query both structured and unstructured data in Snowflake using Cortex AI features including Cortex Search for RAG applications, Cortex Analyst for semantic modeling, and Cortex Agent for agentic orchestration across data types.
Related MCP Servers
- -securityAlicense-qualitySnowflake integration implementing read and (optional) write operations as well as insight trackingLast updated -161GPL 3.0
- AsecurityAlicenseAqualityAI assistants to query and analyze Azure Data Explorer databases through standardized interfaces.Last updated -446MIT License
- AsecurityFlicenseAqualityEnables AI systems to perform full-text and semantic search operations over structured/unstructured data in Azure Cognitive Search, with capabilities for document indexing and management through natural language.Last updated -32943
- -securityAlicense-qualityProvides search capabilities for Cloudflare AutoRAG instances, enabling AI assistants like Claude to directly search and query knowledge bases using three distinct search methods: basic search, rewrite search, and AI search.Last updated -11MIT License