# Cortex Code MCP server for live trend data

TrendsAGI is a hosted, read-only Model Context Protocol server at https://api.trendsagi.com/mcp.
Snowflake Cortex Code (CoCo) can call it through Streamable HTTP with OAuth 2.1.

There is no public Cortex Code MCP directory. A server reaches CoCo because a
user adds it, a plugin declares it, or an administrator registers it. Nothing
needs an application.

## Add the server

    cortex mcp add trendsagi https://api.trendsagi.com/mcp --type http

Then connect and check:

    cortex mcp list     # trendsagi is listed as http
    cortex mcp start    # connects and reports the tool count
    /mcp                # inside a session: trendsagi, connected, 13 tools

The first tool call returns 401 with a resource-metadata pointer. Cortex Code
registers itself through dynamic client registration, opens a browser and you
approve the connection on the TrendsAGI consent page. No API key is required.

## Install the plugin instead

    cortex plugin install github:TrendsAGI/TrendsAGI/plugins/trendsagi

The plugin declares the same hosted server and adds a skill that explains when to
use trend data. Plugin-declared servers never overwrite a server you configured
yourself.

## Configuration file

Cortex Code reads MCP servers from ~/.snowflake/cortex/mcp.json:

    {
      "mcpServers": {
        "trendsagi": {
          "type": "http",
          "url": "https://api.trendsagi.com/mcp"
        }
      }
    }

Cortex Code expands ${VAR} in every field and migrates credentials into the OS
keychain on first connection. If the browser flow is blocked, add an explicit
oauth block with client_name, redirect_port 8585 and scope trends:read.

## Tools

All read-only, namespaced as mcp__trendsagi__<tool>:

- list_trends: trending topics with measured volume, velocity and growth
- search_trend_insights: find trends by theme and see why they move
- get_trend_analytics: volume over 24h, 7d or 30d
- get_trend_ai_insights: summary, themes, sentiment, audience, marketing angles
- list_recommendations: prioritised, evidence-backed recommendations
- list_crisis_events: reputation risks on monitored topics
- list_watchlist, get_trend, list_trend_categories, get_api_usage
- read_data_schema, execute_sql: read-only SQL over your TrendsAGI data
- find_capability: whether TrendsAGI can do a task and which tool does it

Tools a plan does not include are omitted from tools/list, so the agent does not
call them and fail.

## Limits

- Read-only. No account changes, no campaign edits, no spend.
- Every tool call counts as one API request against the plan's daily limit.
- Cortex Code caps a tool result at 50 KB. TrendsAGI caps lists at 25 trends,
  10 recommendations and 200 SQL rows.
- TrendsAGI measures trend volume, velocity and growth. It does not report ad
  spend, conversions or attribution.

## For Snowflake administrators

- The curated AI Gateway Tools catalog is a partnership channel; TrendsAGI is not
  listed in it.
- Any ACCOUNTADMIN can add a custom MCP server by URL under AI & ML > AI Gateway
  > MCP & Tools.
- areUserMcpServersAllowed=false disables ~/.snowflake/cortex/mcp.json and
  plugin-declared servers, so the custom-server route is the only path in those
  accounts.
- URL allowlists are applied after configuration is merged. A disallowed URL is
  removed silently.
- Snowflake's snow:// skill_catalog sharing is account-scoped; cross-account
  sharing is not supported.

## Plans

An MCP connection uses the same plan as the rest of the API. Starter includes 100
API calls a day and one API key; Advantage adds insight search; Scale adds crisis
events; Enterprise is custom.

Full setup guide, all MCP clients and FAQ: https://trendsagi.com/mcp
