# Sloan Documentation – Python ## Included Files 1. sloan/data-collection-policy.mdx 2. sloan/demos.mdx 3. sloan/demos/context.mdx 4. sloan/demos/egress.mdx 5. sloan/demos/ingest.mdx 6. sloan/demos/mvs.mdx 7. sloan/getting-started.mdx 8. sloan/getting-started/claude.mdx 9. sloan/getting-started/cursor.mdx 10. sloan/getting-started/other-clients.mdx 11. sloan/getting-started/vs-code.mdx 12. sloan/getting-started/windsurf.mdx 13. sloan/guides.mdx 14. sloan/guides/clickhouse-chat.mdx 15. sloan/guides/clickhouse-proj.mdx 16. sloan/guides/from-template.mdx 17. sloan/index.mdx 18. sloan/reference/cli-reference.mdx 19. sloan/reference/mcp-json-reference.mdx 20. sloan/reference/tool-reference.mdx ## Data Collection Policy Source: sloan/data-collection-policy.mdx Data Collection Policy for Sloan # Sloan Data Collection Policy Sloan is in research preview. Accordingly, we collect usage data to improve the product. By default, we collect the most granular data on "ready to use" templates (`comprehensive` data collection), and we collect less information from the other templates (`standard` data collection). You can change the data you share with us by changing the following: ```ts filename="sloan.config.toml" enable_telemetry = "standard" ``` The available options are: - `standard` - collects tool usage and success or error status. - `comprehensive` - collects tool usage, success or error status, and parameters used by the tools. - `off` - disables telemetry. Example standard data collection: ```javascript filename="standard data collection" copy { distinctId: distinctIdForEvent, event: 'sloan_mcp_tool_usage', properties: { tool_name: toolName, success: !error, telemetry_level: 'standard', source: 'sloan_mcp_execution', timestamp: new Date().toISOString() } } ``` Example comprehensive data collection: ```javascript filename="comprehensive data collection" copy {distinctId: distinctIdForEvent, event: 'sloan_mcp_tool_usage', properties: { tool_name: toolName, success: !error, telemetry_level: 'comprehensive', source: 'sloan_mcp_execution', timestamp: new Date().toISOString(), parameters: args, // Full tool parameters error_message: error?.message, // Detailed error information error_stack: error?.stack, // Error stack trace machine_id: machineId, // Machine identifier os: process.platform, // Operating system arch: process.arch, // Architecture node_version: process.version // Node.js version } } ``` Our privacy policy is available [here](https://www.fiveonefour.com/legal/privacy.pdf). --- ## Sloan Demos Source: sloan/demos.mdx Templates and instructions for achieving common tasks with Sloan # Sloan Demos This page will provide a series of templates and instructions for achieving common tasks with Sloan. All demo flows will assume that you have already installed the Sloan CLI and Moose CLI. ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan,moose ``` --- ## Context Demo -- Aircraft Metrics Definition Source: sloan/demos/context.mdx Learn how to use Sloan's context management to build knowledge-driven data applications # Aircraft Metrics Definition ## Airspeed Metrics **Ground Speed vs True Airspeed**: Ground speed (`gs`) represents the aircraft's speed relative to the ground, while true airspeed (`tas`) accounts for air density and temperature conditions. True airspeed calculation requires outside air temperature (`oat`) and pressure altitude data not currently available in our model. **Indicated Airspeed (IAS)**: The airspeed reading from the aircraft's pitot-static system (`ias`), which differs from true airspeed based on altitude and atmospheric conditions. This metric requires direct airspeed sensor data not present in our current ADS-B feed. ## Climb/Descent Performance Metrics **Vertical Speed**: Calculated using `baro_rate` (barometric rate) and `geom_rate` (geometric rate) to determine climb or descent performance. Positive values indicate climb, negative values indicate descent. **Climb Efficiency**: Ratio of altitude gained to ground distance covered, calculated using altitude change (`alt_baro` or `alt_geom`) and position changes (`lat`, `lon`). ## Flight Phase Detection Metrics **Takeoff Phase**: Identified by rapid altitude gain (`alt_baro` increasing) combined with increasing ground speed (`gs`) and high climb rate (`baro_rate` > 500 ft/min). **Cruise Phase**: Characterized by stable altitude (minimal `baro_rate`), consistent ground speed (`gs`), and straight track (`track` changes < 5°). **Approach Phase**: Detected by decreasing altitude (`baro_rate` < -300 ft/min), decreasing ground speed, and altitude below typical cruise levels. **Landing Phase**: Final approach with very low altitude (`alt_baro` < 1000 ft), decreasing speed, and stable track toward runway. ## Signal Quality Metrics **Signal Strength**: Direct measurement using `rssi` (Received Signal Strength Indicator) to assess reception quality. **Data Freshness**: Calculated using `seen` (seconds since last message) and `seen_pos` (seconds since last position update) to determine data reliability. **Message Frequency**: Messages per minute calculated from `messages` count and time window to assess tracking consistency. ## Position Accuracy Metrics **Navigation Accuracy**: Composite score using `nic` (Navigation Integrity Category), `nac_p` (Navigation Accuracy Category - Position), and `nac_v` (Navigation Accuracy Category - Velocity) to determine positional reliability. **Surveillance Accuracy**: Assessment using `sil` (Surveillance Integrity Level) and `sda` (System Design Assurance) to evaluate overall tracking quality. ## Flight Efficiency Metrics **Great Circle Deviation**: Comparison of actual flight path (derived from sequential `lat`, `lon` coordinates) against the shortest great circle distance between origin and destination. **Altitude Optimization**: Analysis of altitude profile against optimal flight levels for given aircraft type and distance. **Speed Consistency**: Variance in ground speed (`gs`) throughout different flight phases to assess flight smoothness. **Fuel Efficiency**: Calculated using fuel flow rate (`fuel_flow`) and ground speed to determine nautical miles per gallon. Requires engine performance data not available in our current dataset. ## Environmental & Weather Metrics **Wind Speed & Direction**: Calculated by comparing true airspeed (`tas`) with ground speed (`gs`) and track changes. Requires true airspeed data and wind vector information (`wind_speed`, `wind_direction`) not present in our model. **Turbulence Detection**: Identified through rapid changes in altitude (`alt_baro`) and track (`track`) combined with accelerometer data (`vertical_g_force`, `lateral_g_force`) not available in ADS-B transmissions. **Weather Avoidance**: Analysis of flight path deviations around weather systems using onboard weather radar data (`weather_radar_returns`) and precipitation intensity (`precip_intensity`) not included in our current data model. ## Traffic Density & Separation Metrics **Aircraft Density**: Count of aircraft within defined geographical boundaries using `lat`, `lon` coordinates and configurable radius. **Separation Metrics**: Minimum distances between aircraft calculated using position data and altitude differences. **Airspace Utilization**: Percentage of available airspace occupied by tracked aircraft at different altitude bands. ## Operational Metrics **Emergency Detection**: Identification of emergency situations using `emergency` codes, `squawk` codes (7500, 7600, 7700), and `alert` flags. **Autopilot Usage**: Analysis of autopilot engagement using navigation modes (`nav_modes`) and flight path consistency. **Communication Quality**: Assessment based on transponder performance, message consistency, and data completeness across all available fields. --- ## Egress Demo Source: sloan/demos/egress.mdx Learn how to create data egress APIs using Sloan with a step-by-step TypeScript example # Data Egress ## Create analytics APIs to serve your data This demo will walk you through using Sloan tools to prompt your way to creating analytics APIs that serve the aircraft telemetry data you've ingested. [Skip to prompt](#prompt-the-llm-to-create-a-geolocation-api) if you started with the ads-b template. - **Sloan and Moose CLIs**: [Install them here](/sloan/getting-started/cursor) - **OS**: macOS or Linux (WSL supported for Windows) - **Docker Desktop/Engine**: [24.0.0+](https://docs.docker.com/get-started/get-docker/) - **Node**: [version 20+](https://nodejs.org/en/download) (LTS recommended) - **Anthropic API Key**: [Get one here](https://docs.anthropic.com/en/docs/initial-setup) - **Client**: [Cursor](https://www.cursor.com/) - **Completed**: [Ingest Demo](/sloan/demos/ingest) (or have data already in your system) ### Start with the ads-b template ```bash filename="Terminal" copy sloan init egress-demo ads-b ``` ```bash filename="Terminal" copy cd egress-demo npm install ``` ### Run the Moose Dev Server ```bash filename="Terminal" copy moose dev ``` ### Open the project in Cursor ### Initialize the Sloan MCP Navigate to `Cursor > Settings > Cursor Settings > Tools and Integrations` then toggle on the `Sloan MCP` tool. ### For best results, set the LLM to `claude-4-sonnet` Gemini 2.5 and o3 are also reasonably good, but claude-4-sonnet has the most consistent results. ### Prompt the LLM to create a geolocation API > Can you create an API that returns every aircraft within X miles of Y,Z coordinates. ### Action The LLM should now use sloan tools to: 1. create the analytics API endpoint that calculates distance and filters aircraft 2. test the API to ensure it's working correctly with the existing aircraft data You'll know it is succeeding if: 1. the LLM successfully tests the API 2. you can curl the API generated 3. you can see the generated openapi spec in `path/to/your/project/.moose/openapi.yaml` ### Continue this demo with: * [Creating Materialized Views](/sloan/demos/mvs) --- ## Ingest Demo Source: sloan/demos/ingest.mdx Learn how to ingest data using Sloan with a step-by-step TypeScript example # Ingest ## Ingest data periodically from an API This demo will walk you through using Sloan tools to prompt your way to ingesting a whole bunch of aircraft telemetry data from adsb.lol. [Skip to prompt](#prompt-the-llm-to-create-an-ingest) if you started with the ads-b template. - **Sloan and Moose CLIs**: [Install them here](/sloan/getting-started/cursor) - **OS**: macOS or Linux (WSL supported for Windows) - **Docker Desktop/Engine**: [24.0.0+](https://docs.docker.com/get-started/get-docker/) - **Node**: [version 20+](https://nodejs.org/en/download) (LTS recommended) - **Anthropic API Key**: [Get one here](https://docs.anthropic.com/en/docs/initial-setup) - **Client**: [Cursor](https://www.cursor.com/) ### Create and initialize a new typescript project ```bash filename="Terminal" copy sloan init ingest-demo typescript-empty ``` ```bash filename="Terminal" copy cd ingest-demo npm install ``` ### Open the project in Cursor ### Run the Moose Dev Servers ```bash filename="Terminal" copy moose dev ``` ### Initialize the Sloan MCP Navigate to `Cursor > Settings > Cursor Settings > Tools and Integrations` then toggle on the `Sloan MCP` tool. ### For best results, set the LLM to `claude-4-sonnet` Gemini 2.5 and o3 are also reasonably good, but claude-4-sonnet has the most consistent results. ### Prompt the LLM to create an ingest > I want to ingest data from the following aircraft transponder data api every 5 seconds for the purpose of creating a set of visualizations. > > API: @https://api.adsb.lol/v2/mil > > Docs: @https://api.adsb.lol/docs#/v2/v2_mil_v2_mil_get (note, I think the schema here is inaccurate, check out the data before you trust the docs). > > Can you execute on this? The LLM might do a planning step, in which case, you can ask it to execute on the plan. > Go for it! ### Action The LLM should now use sloan tools to: 1. get sample data from the API using a temporary script 2. use that sample to create a schema that's used to create an ingest pipeline (ingest API, Redpanda stream, ClickHouse table) 3. create a Moose managed temporal workflow to periodically ingest the data You'll know it is succeeding if you see dozens of events per second hit your Moose dev console. ### Continue this demo with: * [Creating Egress APIs](/sloan/demos/egress) * [Creating Materialized Views](/sloan/demos/mvs) --- ## Materialized Views Demo Source: sloan/demos/mvs.mdx Learn how to create materialized views using Sloan with a step-by-step TypeScript example # Materialized Views ## Create materialized views to pre-aggregate your data, based on your egress API This demo will walk you through using Sloan tools to prompt your way to creating materialized views that pre-aggregate the aircraft telemetry data you've ingested. [Skip to prompt](#prompt-the-llm-to-create-a-materialized-view) if you started with the ads-b template. - **Sloan and Moose CLIs**: [Install them here](/sloan/getting-started/cursor) - **OS**: macOS or Linux (WSL supported for Windows) - **Docker Desktop/Engine**: [24.0.0+](https://docs.docker.com/get-started/get-docker/) - **Node**: [version 20+](https://nodejs.org/en/download) (LTS recommended) - **Anthropic API Key**: [Get one here](https://docs.anthropic.com/en/docs/initial-setup) - **Client**: [Cursor](https://www.cursor.com/) - **Completed**: [Ingest Demo](/sloan/demos/ingest) (or have data already in your system) ### Start with the ads-b template ```bash filename="Terminal" copy sloan init mvs-demo ads-b ``` ```bash filename="Terminal" copy cd mvs-demo npm install ``` ### Run the Moose Dev Server ```bash filename="Terminal" copy moose dev ``` ### Open the project in Cursor ### Initialize the Sloan MCP Navigate to `Cursor > Settings > Cursor Settings > Tools and Integrations` then toggle on the `Sloan MCP` tool. ### For best results, set the LLM to `claude-4-sonnet` Gemini 2.5 and o3 are also reasonably good, but claude-4-sonnet has the most consistent results. ### Create an egress API You can skip this step if you've already completed the [Egress Demo](/sloan/demos/egress). > Can you create an API that returns every aircraft within X miles of Y,Z coordinates. If you prefer to implement the egress API manually, you can create the following analytics API: ```typescript filename="app/index.ts" ... export * from './apis/getAircraftWithinRadius'; ``` ```typescript filename="app/apis/getAircraftWithinRadius.ts" /** * Parameters for the getAircraftWithinRadius API */ interface AircraftRadiusParams { /** Latitude of the center point */ center_lat: number; /** Longitude of the center point */ center_lon: number; /** Radius in miles from the center point */ radius_miles: number; /** Maximum number of results to return (optional) */ limit?: number & tags.Type<"int64"> & tags.Minimum<1> & tags.Maximum<1000>; } /** * API to retrieve aircraft within a specified radius from given coordinates * Uses ClickHouse's geoDistance function to calculate great circle distance */ ) => { // Execute the query with proper parameter handling const result = await client.query.execute(sql` SELECT hex, flight, aircraft_type, lat, lon, alt_baro, gs, track, timestamp, round(geoDistance(lon, lat, ${params.center_lon}, ${params.center_lat}) * 0.000621371, 2) as distance_miles FROM AircraftTrackingProcessed WHERE geoDistance(lon, lat, ${params.center_lon}, ${params.center_lat}) * 0.000621371 <= ${params.radius_miles} ORDER BY distance_miles ASC LIMIT ${params.limit || 100} `); return result; }, { metadata: { description: "Returns all aircraft within a specified distance (in miles) from given coordinates" } } ); ``` ### Prompt the LLM to create a materialized view > Given the egress API, can you create a materialized view that improves the performance of the query? ### Action The LLM should now use sloan tools to: 1. analyze the Moose project and the egress API 2. create a Materialized View that pre-aggregates the data You'll know it is succeeding if: 1. the LLM successfully creates the materialized view 2. the LLM sees that the materialized view was created in the ClickHouse database ### Optional further prompts > Can you create a new egress API that leverages the materialized view to improve the performance of the query? > Can you test both APIs to see what the performance difference is? > I want to see the difference in speed, number of rows read, amount of data read, compute, and other vectors you think are pertinent. --- ## Getting Started Source: sloan/getting-started.mdx Getting started guide for Sloan CTACard, CTACards, ZoomImg, ChipButton, Columns, Column, FeatureCard, FeatureGrid, BulletPointsCard, QnABullets, CheckmarkBullets, Icons, } from "@/components"; ## Getting Started These guides will walk you through setting up Sloan MCP with your client of choice, using the CLI and using the MCP.JSON configuration file. --- ## Getting Started Source: sloan/getting-started/claude.mdx Getting started guide for Sloan CTACard, CTACards, ZoomImg, ChipButton, Columns, Column, FeatureCard, FeatureGrid, BulletPointsCard, QnABullets, CheckmarkBullets, Icons, } from "@/components"; ## Claude Desktop ### Install Claude Desktop [Install the Claude Desktop application here](https://claude.ai/download). Note, the Pro version appears to work much more stably with MCPs. ### Install Moose and Sloan CLI ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan,moose ``` ### Configure Sloan MCP Create a new project with Claude Desktop MCP preconfigured: ```bash filename="Terminal" copy sloan init --mcp claude-desktop ``` For other options, see [Sloan CLI docs](/sloan/getting-started/sloan-cli). ```json filename="~/Library/Application Support/Claude/claude_desktop_config.json" copy { "mcpServers": { "sloan": { "args": [ "@514labs/sloan-mcp@latest", "--moose-read-tools", "path/to/your/moose/project" ], "command": "npx", "env": { "ANTHROPIC_API_KEY": "", "MOOSE_PATH": "path/to/your/moose/installation", "NODE_PATH": "path/to/your/node/installation", "PYTHON_PATH": "path/to/your/python/installation" } } } } ``` ### Adding other toolsets For more information on available toolsets, see [Sloan MCP toolsets](/sloan/reference/tool-reference). For Claude Desktop, we recommend the following toolsets: * [Moose Read Tools](../sloan/reference/tool-reference#moose-read-tools): gives you chat access to your Moose project and the data within it (enabled by default) * [Remote ClickHouse Tools](../sloan/reference/tool-reference#remote-clickhouse) (read only): gives you chat access to your remote ClickHouse data ### Using the MCP 1. Open the Claude Desktop application (note, you often have to reload the application after adding a new MCP) 2. If you are using Moose tools, you will need to run your moose dev server ### Warnings / Peculiarities * You shouldn't use "write"/generative tools with Claude Desktop. * Every time you add an MCP or change its configuration, you will need to reload the application. * If you want to change the Moose Project that the Sloan MCP is referring to, manually edit the MCP.JSON file or run `sloan config focus` and select a new project. ### Common issues / troubleshooting * The MCP is running, but you aren't able to get your data? Look at the tool call response, it will tell you if your Moose dev server is running. If it is not, run `moose dev` in your Moose project directory. * The MCP is not running. Check your configuration and then restart the application. ## Reference --- ## Getting Started Source: sloan/getting-started/cursor.mdx Getting started guide for Sloan CTACard, CTACards, ZoomImg, ChipButton, Columns, Column, FeatureCard, FeatureGrid, BulletPointsCard, QnABullets, CheckmarkBullets, Icons, } from "@/components"; ## Cursor ### Install [Install Cursor here](https://www.cursor.com/). ### Install Moose and Sloan CLI ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan,moose ``` ### Configure Sloan MCP Create a new project with Cursor MCP preconfigured: ```bash filename="Terminal" copy sloan init --mcp cursor-project ``` If you want to use this as a global Cursor MCP, use `cursor-global` instead of `cursor-project`. For other options, see [Sloan CLI docs](/sloan/getting-started/sloan-cli). ```json filename="/path/to/your/project/.cursor/mcp.json" copy { "mcpServers": { "sloan": { "args": [ "@514labs/sloan-mcp@latest", "--moose-read-tools", "path/to/your/moose/project" ], "command": "npx", "env": { "ANTHROPIC_API_KEY": "", "MOOSE_PATH": "path/to/your/moose/installation", "NODE_PATH": "path/to/your/node/installation", "PYTHON_PATH": "path/to/your/python/installation" } } } } ``` ### Adding other toolsets For more information on available toolsets, see [Sloan MCP toolsets](/sloan/reference/tool-reference). All toolsets are available for Cursor. ### Using the MCP 1. Open Cursor 2. You will see a popup saying that an MCP is detected, and can be enabled. Our experience is that this is not always reliable, and the MCP is more stably launched if you go to `cursor > settings > cursor settings > tools and integrations` and enable the MCP there. 3. If you are using Moose tools, you will need to run your moose dev server with `moose dev`. ### Warnings / Peculiarities * Every time you add an MCP or change its configuration, you will need to reload the MCP. You can do this by going to `cursor > settings > cursor settings > tools and integrations` and toggling the MCP off and on. If this doesn't work, you can also restart the Cursor application. * If you have configured the MCP globally, and want to change the Moose Project that the Sloan MCP is referring to, manually edit the MCP.JSON file or run `sloan config focus` and select a new project. ### Common issues / troubleshooting * The MCP is running, but you aren't able to get your data? Look at the tool call response, it will tell you if your Moose dev server is running. If it is not, run `moose dev` in your Moose project directory. * The MCP is not running. Check your configuration and then restart the application. ## Reference --- ## Getting Started Source: sloan/getting-started/other-clients.mdx Getting started guide for Sloan CTACard, CTACards, ZoomImg, ChipButton, Columns, Column, FeatureCard, FeatureGrid, BulletPointsCard, QnABullets, CheckmarkBullets, Icons, } from "@/components"; ### Other clients We are working on adding MCP support for other clients. If you are interested in using other clients, please [contact us](mailto:sloan@fiveonefour.com). To try set up your client with Sloan MCP, use the MCP.JSON file within your client of choice. ### Configure Sloan MCP **Configuration Object Naming**: Different MCP clients use different naming conventions for the server configuration object: - **Cursor, Windsurf**: Uses `"mcpServers"` - **Claude Desktop, VS Code**: Use `"servers"` instead Make sure to check your specific client's documentation for the correct naming convention. ```json filename="MCP configuration" copy { "mcpServers": { "sloan": { "args": [ "@514labs/sloan-mcp@latest", "--moose-read-tools", "path/to/your/moose/project" ], "command": "npx", "env": { "ANTHROPIC_API_KEY": "", "MOOSE_PATH": "path/to/your/moose/installation", "NODE_PATH": "path/to/your/node/installation", "PYTHON_PATH": "path/to/your/python/installation" } } } } ``` ```json filename="MCP configuration" copy { "servers": { "sloan": { "args": [ "@514labs/sloan-mcp@latest", "--moose-read-tools", "path/to/your/moose/project" ], "command": "npx", "env": { "ANTHROPIC_API_KEY": "", "MOOSE_PATH": "path/to/your/moose/installation", "NODE_PATH": "path/to/your/node/installation", "PYTHON_PATH": "path/to/your/python/installation" } } } } ``` ### Adding other toolsets For more information on available toolsets, see [Sloan MCP toolsets](/sloan/reference/tool-reference). If the client you are using is a chat client, we recommend the following toolsets: * [Moose Read Tools](../sloan/reference/tool-reference#moose-read-tools): gives you chat access to your Moose project and the data within it (enabled by default) * [Remote ClickHouse Tools](../sloan/reference/tool-reference#remote-clickhouse) (read only): gives you chat access to your remote ClickHouse data If it is an IDE type client, all toolsets are available. ### Using the MCP 1. Open the Claude Desktop application (note, you often have to reload the application after adding a new MCP) 2. If you are using Moose tools, you will need to run your moose dev server ### Common issues / troubleshooting * The MCP is running, but you aren't able to get your data? Look at the tool call response, it will tell you if your Moose dev server is running. If it is not, run `moose dev` in your Moose project directory. * The MCP is not running. Check your configuration and then restart the application. ## Reference --- ## Getting Started Source: sloan/getting-started/vs-code.mdx Getting started guide for Sloan CTACard, CTACards, ZoomImg, ChipButton, Columns, Column, FeatureCard, FeatureGrid, BulletPointsCard, QnABullets, CheckmarkBullets, Icons, } from "@/components"; ## VS Code - **VS Code**: [Install VS Code here](https://code.visualstudio.com/). - **GitHub Copilot in VS Code**: [See VS Code docs](https://code.visualstudio.com/docs/copilot/setup) ### Install VS Code and enable MCPs [Install VS Code here](https://code.visualstudio.com/). [Enable MCPs](vscode://settings/chat.mcp.enabled) by toggling on the `chat.mcp.enabled` setting. ### Install Moose and Sloan CLI ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan,moose ``` ### Configure Sloan MCP Create a new project with Claude Desktop MCP preconfigured: ```bash filename="Terminal" copy sloan init --mcp vscode-project ``` If you want to use this as a global VS Code MCP, use `vscode-global` instead of `vscode-project`. For other options, see [Sloan CLI docs](/sloan/getting-started/sloan-cli). ```json filename="/path/to/your/project/.cursor/settings.json" copy { "mcp": { "input": [], "servers": { "sloan": { "args": [ "@514labs/sloan-mcp@latest", "--moose-read-tools", "path/to/your/moose/project" ], "command": "npx", "env": { "ANTHROPIC_API_KEY": "", "MOOSE_PATH": "path/to/your/moose/installation", "NODE_PATH": "path/to/your/node/installation", "PYTHON_PATH": "path/to/your/python/installation" } } } } } ``` ### Adding other toolsets For more information on available toolsets, see [Sloan MCP toolsets](/sloan/reference/tool-reference). All toolsets are available for Cursor. ### Using the MCP [ ] TODO: Add instructions for running the MCP server in VS Code ### Warnings / Peculiarities **Recommended Configuration Method**: While VS Code has a feature that allows you to use MCPs from other clients (like Claude Desktop), we strongly recommend using either the **Sloan CLI** or the **settings.json file** method shown above instead. These methods provide better reliability and configuration control specifically for VS Code environments. ### Common issues / troubleshooting * The MCP is running, but you aren't able to get your data? Look at the tool call response, it will tell you if your Moose dev server is running. If it is not, run `moose dev` in your Moose project directory. * The MCP is not running. Check your configuration and then restart the application. ## Reference --- ## Getting Started Source: sloan/getting-started/windsurf.mdx Getting started guide for Sloan CTACard, CTACards, ZoomImg, ChipButton, Columns, Column, FeatureCard, FeatureGrid, BulletPointsCard, QnABullets, CheckmarkBullets, Icons, } from "@/components"; ## Windsurf ### Install Windsurf [Install Windsurf here](https://windsurf.com/). ### Install Moose and Sloan CLI ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan,moose ``` ### Configure Sloan MCP Create a new project with Windsurf MCP preconfigured: ```bash filename="Terminal" copy sloan init --mcp windsurf-global ``` For other options, see [Sloan CLI docs](/sloan/getting-started/sloan-cli). ```json filename="~/.codeium/windsurf/mcp_config.json" copy { "mcpServers": { "sloan": { "args": [ "@514labs/sloan-mcp@latest", "--moose-read-tools", "path/to/your/moose/project" ], "command": "npx", "env": { "ANTHROPIC_API_KEY": "", "MOOSE_PATH": "path/to/your/moose/installation", "NODE_PATH": "path/to/your/node/installation", "PYTHON_PATH": "path/to/your/python/installation" } } } } ``` ### Adding other toolsets For more information on available toolsets, see [Sloan MCP toolsets](/sloan/reference/tool-reference). All toolsets are available for Windsurf. ### Using the MCP 1. Open Windsurf 2. Run the MCP by going to `windsurf > settings > windsurf settings > cascade > Model Context Protocol (MCP) Servers` and enable the MCP there. 3. If you are using Moose tools, you will need to run your moose dev server with `moose dev`. ### Warnings / Peculiarities * Every time you add an MCP or change its configuration, you will need to reload the MCP. You can do this by going to `windsurf > settings > windsurf settings > cascade > Model Context Protocol (MCP) Servers` and toggling the MCP off and on or refreshing the server. If this doesn't work, you can also restart the Windsurf application. * If you have configured the MCP globally, and want to change the Moose Project that the Sloan MCP is referring to, manually edit the MCP.JSON file or run `sloan config focus` and select a new project. ### Common issues / troubleshooting * The MCP is running, but you aren't able to get your data? Look at the tool call response, it will tell you if your Moose dev server is running. If it is not, run `moose dev` in your Moose project directory. * The MCP is not running. Check your configuration and then restart the application. ## Reference --- ## Quickstart Source: sloan/guides.mdx Quickstart guide for Sloan CTACard, CTACards, ZoomImg, ChipButton, Columns, Column, FeatureCard, FeatureGrid, BulletPointsCard, QnABullets, CheckmarkBullets, Icons, } from "@/components"; # Sloan Quickstart Guides Sloan exposes tools to your LLM client for reading, exploring, and building on ClickHouse data—locally or in production. Get started with one of our quickstart guides below: --- ## guides/clickhouse-chat Source: sloan/guides/clickhouse-chat.mdx ## Quickstart: AI Chat with ClickHouse *Use your LLM client to explore your ClickHouse with Sloan MCP tools.* This will walk you through using Sloan CLI to connect Sloan MCP tools to your ClickHouse database, allowing you to chat with your data in your client of choice. We'll use the ClickHouse Playground as our example database, but you can use any ClickHouse database. - **OS**: macOS or Linux (WSL supported for Windows) - **Node**: [version 20+](https://nodejs.org/en/download) (LTS recommended) - **Client**: [Cursor](https://www.cursor.com/) or [Claude Desktop](https://claude.ai/download) or [Windsurf](https://windsurf.ai/download). For this particular use-case, we recommend Claude Desktop. ### Install Sloan CLI ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan ``` ### Configure your Sloan MCP ```bash filename="Terminal" copy sloan connect clickhouse --connection-string "https://explorer:@play.clickhouse.com:443/?database=default" --mcp cursor-project ``` You need a ClickHouse connection URL. Format looks like this: ``` http://username:password@host:port/?database=database_name ``` Want to test without your own ClickHouse? Use the [ClickHouse Playground](https://clickhouse.com/docs/getting-started/playground) with the connection string above. It has sample datasets (read-only) you can experiment with. ```txt copy https://explorer:@play.clickhouse.com:443/?database=default ``` 1. Log into your [ClickHouse Cloud console](https://clickhouse.cloud/) 2. Go to your service details page 3. Find "Connect" or "Connection Details" section 4. Copy the HTTPS endpoint and your username/password - Check your ClickHouse config file (usually `/etc/clickhouse-server/config.xml`) - Look for `` (default: 8123) and `` (default: 8443) - Check users config in `/etc/clickhouse-server/users.xml` or users.d/ directory - Default user is often `default` with no password - Check your docker-compose.yml or docker run command for environment variables - Look for `CLICKHOUSE_USER`, `CLICKHOUSE_PASSWORD`, `CLICKHOUSE_DB` - Default is usually `http://default:@localhost:8123/?database=default` - **Can't connect?** Try `curl http://your-host:8123/ping` to test connectivity - **Authentication failed?** Verify username/password with `clickhouse-client --user=username --password=password` - **Database not found?** Run `SHOW DATABASES` to see available databases - **Permission denied?** Check user permissions with `SHOW GRANTS FOR username` **Still stuck?** Check the [ClickHouse documentation](https://clickhouse.com/docs/en/getting-started/install) for your specific deployment method. ### Chat Open your Claude Desktop client. We recommend starting the chat with a context setting question like "tell me about the data I have available to me in ClickHouse". You can check that the MCP is correctly configured by looking at `claude > settings > developer > sloan`. It should say "running". You can can also look at `search and tools` beneath the chat window, you should see `sloan` in the list of MCPs—if you click into it, you should see the tools that are enabled. ### What's next? Try [creating a Moose Project from your ClickHouse database](https://docs.fiveonefour.com/sloan/quickstart/clickhouse-proj). That way, you can use Sloan MCP tools to create new primitives, like ingestion paths, data models, egress APIs, and more! Or try [deploying your project to Boreal](https://www.fiveonefour.com/boreal), our hosting platform for Moose projects. ## Other Quickstart Guides --- ## guides/clickhouse-proj Source: sloan/guides/clickhouse-proj.mdx ## Quickstart: AI analytics engineering from your ClickHouse *Generate a local OLAP project from your ClickHouse deployment; Sloan MCP pre-configured for analytics engineering.* This will walk you through creating a new local Moose project reflecting the structure of your ClickHouse database. It will allow you to add data to your local dev environment from your remote ClickHouse database, and use Sloan MCP tools to enrich your project with metadata, or create new Moose primitives that you can use in your project (e.g.egress APIs). We'll use the ClickHouse Playground as our example database, but you can use any ClickHouse database. - **OS**: macOS or Linux (WSL supported for Windows) - **Docker Desktop/Engine**: [24.0.0+](https://docs.docker.com/get-started/get-docker/) - **Node**: [version 20+](https://nodejs.org/en/download) (LTS recommended) - **Anthropic API Key**: [Get one here](https://docs.anthropic.com/en/docs/initial-setup) - **Client**: [Cursor](https://www.cursor.com/) or [Claude Desktop](https://claude.ai/download) or [Windsurf](https://windsurf.ai/download). For this particular use-case, we recommend Claude Desktop. ### Install Moose and Sloan CLIs ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) moose,sloan ``` We'll be using generative MCP tools here, so make sure you add your Anthropic API key in install. If you installed without adding it, you can add it later with `sloan config keys anthropic `. If you need to create one, see: https://docs.anthropic.com/en/docs/initial-setup. ### Create a new Moose project from your ClickHouse database ```bash filename="Terminal" copy sloan init my_project_name --from-remote 'https://explorer:@play.clickhouse.com:443/?database=default' --language python --mcp cursor-project ``` Want to test without your own ClickHouse? Use the [ClickHouse Playground](https://clickhouse.com/docs/getting-started/playground) with the connection string above. It has sample datasets (read-only) you can experiment with. ```txt copy https://explorer:@play.clickhouse.com:443/?database=default ``` 1. Log into your [ClickHouse Cloud console](https://clickhouse.cloud/) 2. Go to your service details page 3. Find "Connect" or "Connection Details" section 4. Copy the HTTPS endpoint and your username/password - Check your ClickHouse config file (usually `/etc/clickhouse-server/config.xml`) - Look for `` (default: 8123) and `` (default: 8443) - Check users config in `/etc/clickhouse-server/users.xml` or users.d/ directory - Default user is often `default` with no password - Check your docker-compose.yml or docker run command for environment variables - Look for `CLICKHOUSE_USER`, `CLICKHOUSE_PASSWORD`, `CLICKHOUSE_DB` - Default is usually `http://default:@localhost:8123/?database=default` - **Can't connect?** Try `curl http://your-host:8123/ping` to test connectivity - **Authentication failed?** Verify username/password with `clickhouse-client --user=username --password=password` - **Database not found?** Run `SHOW DATABASES` to see available databases - **Permission denied?** Check user permissions with `SHOW GRANTS FOR username` **Still stuck?** Check the [ClickHouse documentation](https://clickhouse.com/docs/en/getting-started/install) for your specific deployment method. This will create a new Moose project from your ClickHouse database. [See Moose docs](https://docs.fiveonefour.com/moose) for more information about the project structure, and how it spins up your local development environment (including a local ClickHouse database). The new project is called "my_project_name" and is created in the current directory. the string after `--from-remote` is the connection string to your ClickHouse database, structured as `clickhouse://:@:/` (note, the ClickHouse Playground has no password). ### Install dependencies and run the dev server Before you can run Moose's local dev server, Docker Desktop must be running. Navigate into the project directory: ```bash filename="Terminal" copy cd my_project_name ``` Install the dependencies: ```bash filename="Terminal" copy npm i ``` Run the dev server: ```bash filename="Terminal" copy moose dev ``` ### Get sample data ```bash filename="Terminal" copy moose seed clickhouse --connection-string clickhouse://explorer:@play.clickhouse.com:9440/default --limit 100 ``` This will seed your local ClickHouse database with 100 rows of sample data from your remote ClickHouse database—here, the ClickHouse Playground. You can change the number of rows with the `--limit` flag. This will improve the context provided to Sloan's MCP tools, and make it easier to validate analytic engineering tasks. ### Set up your Client The `sloan init` command above configured Cursor to use Sloan MCP tools. You can check this by opening Cursor and looking at `cursor > settings > cursor settings > MCP` menu. You should see `sloan` in the list of MCPs, alongside a list of tools. You may need to enable the MCP. Once you do so, you should see a green 🟢 status indicator next to it. If you would like to use a different client, you can use the following command from within the project directory: ```bash filename="Terminal" copy sloan setup --mcp ``` ### Enrich project with metadata [coming soon] Since we have a Moose project with sample data and some metadata, we can use this to create more metadata! If we ask our client "Can you add a description to each Moose primitive in this project?", the LLM will use the `write_metadata` tool to add a description to each Moose primitive. ```TypeScript filename="my_project_name/index.ts" const acPipeline = new IngestPipeline( "AircraftTrackingProcessed", { table: true, stream: true, ingestApi: false, metadata: { description: "Pipeline for ingesting raw aircraft data" } // new description field! } ); ``` ### Chat with your data You can also now just chat with your client about your data! Try asking "Look at my MTA data in ClickHouse, tell me about the trains that ran in the last 24 hours." The client will use `read_moose_project`, `read_clickhouse_tables` and maybe `read_production_clickhouse` to answer your question. ### Create new Egress APIs with Sloan MCP tools If you find a thread that you find interesting enough to want to productionize, try asking the client "can you create an egress API to furnish that data?" The client will use `create_egress_api` and `test_egress_api` to create an egress API primitives in Moose, that will automatically deploy in your local dev environment when you save. ### What's next? Try adding new [ingestion scripts, data models, or materialized views to your project using Sloan's experimental tools](https://docs.fiveonefour.com/sloan/reference/tool-reference#experimental-moose-tools)! ## Other Quickstart Guides --- ## guides/from-template Source: sloan/guides/from-template.mdx ## Quickstart: AI powered OLAP templates *Bootstrap a complete OLAP pipeline with a Moose template; with Sloan's AI tools already set up for you.* This will get you started with a Moose data engineering project ingesting Aircraft Transponder data that you can use to learn about Sloan's Analytics Engineering MCP toolset. - **OS**: macOS or Linux (WSL supported for Windows) - **Docker Desktop/Engine**: [24.0.0+](https://docs.docker.com/get-started/get-docker/) - **Node**: [version 20+](https://nodejs.org/en/download) (LTS recommended) - **Anthropic API Key**: [Get one here](https://docs.anthropic.com/en/docs/initial-setup) - **Client**: [Cursor](https://www.cursor.com/) or [Claude Desktop](https://claude.ai/download) or [Windsurf](https://windsurf.ai/download). For this particular use-case, we recommend Claude Desktop. ### Install Sloan and Moose CLIs ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan,moose ``` We'll be using generative MCP tools here, so make sure you add your Anthropic API key in install. If you installed without adding it, you can add it later with `sloan config keys anthropic `. If you need to create one, see: https://docs.anthropic.com/en/docs/initial-setup. ### Create a new Moose project from the ADS-B template ```bash filename="Terminal" copy sloan init ads-b ``` This will create a new Moose project using the ADS-B template to gather ADS-B (aircraft transponder) data that you can use to explore Sloan's MCP offerings. By default, it will create the project configured for use with Cursor (by creating `~/.cursor/mcp.config`), but if you would like to use Claude Desktop, append `--mcp claude-desktop`. If you want to create an empty project, and build your own Data Models and ingestion, try `sloan init typescript-empty` or `sloan init python-empty` ### Install dependencies and run the dev server Navigate into the created project directory: ```bash filename="Terminal" copy cd ``` Install the dependencies: ```bash filename="Terminal" copy npm i ``` Run the dev server: ```bash filename="Terminal" copy moose dev ``` ### Set up your client: open Cursor and Enable the MCPs Then open your code editor (e.g. by `cursor .`). Cursor should prompt you to enable the MCP. If it doesn't, go to `cursor > settings > cursor settings > MCP` and enable the MCP called "sloan". Note, the tools will not all work until the dev server is run locally! Note, you might need to refresh the MCP until its status indicator shows 🟢. ### Start Ingesting Data Run the command to start ingesting data with the configured ingest scripts: `moose workflow run military_aircraft_tracking` You should start to see hundreds of live datapoints ingesting instantly! ### Enrich project with metadata [coming soon] Since we have a Moose project with sample data and some metadata, we can use this to create more metadata! If we ask our client "Can you add a description to each Moose primitive in this project?", the LLM will use the `write_metadata` tool to add a description to each Moose primitive. ```TypeScript filename="my_project_name/index.ts" const acPipeline = new IngestPipeline( "AircraftTrackingProcessed", { table: true, stream: true, ingestApi: false, metadata: { description: "Pipeline for ingesting raw aircraft data" } // new description field! } ); ``` ### Chat with your data You can also now just chat with your client about your data! Try asking "What aircraft are listed in the data I have available." The client will use `read_moose_project`, `read_clickhouse_tables` and maybe `read_production_clickhouse` to answer your question. ### Create new Egress APIs with Sloan MCP tools If you find a thread that you find interesting enough to want to productionize, try asking the client "can you create an egress API to furnish that data?" The client will use `create_egress_api` and `test_egress_api` to create an egress API primitives in Moose, that will automatically deploy in your local dev environment when you save. ## Other Quickstart Guides --- ## Sloan - Automated Data Engineering Source: sloan/index.mdx AI-powered tools and agents exposed through an easy to configure MCP server for data engineering and infrastructure # Welcome to Sloan Install [Sloan](/sloan/reference/cli-reference) and [Moose](/moose/reference/cli-reference) CLIs: ``` bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan,moose ```
Quick Start → Start from ClickHouse See Examples Tools Reference
## What is Sloan? Sloan is a set of tools to make your chat, copilot or BI fluent in data engineering. Use the CLI to set up MCPs with the tools you need in the clients you use. Create new data engineering projects with a moose-managed ClickHouse based infrastructure or use these agents with your existing data infrastructure. ## Quickstart Guides ## Core features Sloan offers a comprehensive suite of MCP tools and agents designed to streamline data engineering workflows, enabling faster and more efficient deployment and management.
  • 3 steps in CLI to chat with ClickHouse
  • 5 minutes to build a full stack OLAP project
  • Template based new projects for building your own infrastructure
  • } variant="sloan" />
  • Data engineering in your IDE
  • Data analytics and analytics engineering in your chat client
  • BI in your BI tool of choice
  • } variant="sloan" />
  • Opinionated OLAP deployments with Moose: Optimized ClickHouse development and deployment
  • Direct integration with your architecture: DuckDB, Snowflake, Databricks
  • Integration with your enterprise: metadata, CICD, logging and more
  • } variant="sloan" />
  • Full-stack context: code, logs, data, docs
  • Self-improving feedback loops
  • Embedded metadata for continuity
  • } variant="sloan" />
  • Each agent: context gathering → implementation → testing → doc workflows
  • Governance defaults, easily configurable: SDLC, data quality, reporting, privacy and security default practices
  • Learns your policies with minimal context, enforces them automatically
  • } variant="sloan" /> ## Why Sloan exists ### The DIY Approach ### The Sloan Approach ## What jobs can you do with Sloan?

    Ad hoc analytics

    Give your LLM client a way to chat with your data, in ClickHouse, Databricks, Snowflake, or wherever it lives

    Analytics Engineering

    Agents that can build new data products, materialized views and egress methods

    Data Engineering

    Have agents build and test end to end data pipelines

    Data Wrangling

    Agents that interact with your data systems like DuckDB, Databricks, Snowflake and more to create scripts, clean data, and prepare data for use

    Data Migration

    Automated creation of data pipelines to migrate data from legacy systems to a modern data backend

    Data quality, governance and reporting

    Agents that can help you enforce data quality, governance and reporting during development and in run time

    ## Getting Involved / Giving Feedback / Community --- ## CLI Reference Source: sloan/reference/cli-reference.mdx CLI Reference for Sloan # CLI Reference The Sloan CLI is a tool we created to facilitate the easy setup of Sloan MCPs. It is not required, and we hope that LLM clients will eventually support all these features natively, so that we can remove the CLI. It allows you to: - set up your Sloan MCP with a variety of clients - manage multiple projects - manage multiple toolsets - update multiple MCP configurations at once ## Install CLI ```bash filename="Terminal" copy bash -i <(curl -fsSL https://fiveonefour.com/install.sh) sloan ``` ## Commands ### init Creates a data engineering project with Moose, with Sloan MCP preconfigured. ```bash filename="Terminal" copy sloan init <--mcp > <--location > ``` ", required: true, description: "Name of your application (this will be the ).", examples: ["e.g. my-app"] }, { name: "--mcp ", description: "Choice of which MCP host to use.", examples: ["default: cursor-project", "other options: cursor-global", "claude-desktop", "windsurf-global"] }, { name: "--location ", description: "Location of your app or service. The default is the name of the project.", examples: ["e.g. my-app"] }, { name: "--no-fail-already-exists", description: "By default, the init command fails if `location` exists, to prevent accidental reruns. This flag disables the check." } ]} /> ", required: true, description: "The template you are basing your application on.", examples: ["typescript-empty", "typescript", "ads-b"] } ]} /> ", required: true, description: "The connection string to your ClickHouse database.", examples: ["e.g. clickhouse://user:pass@host:port/db"] }, { name: "--language ", required: true, description: "The language of your application.", examples: ["typescript", "python"] } ]} /> ### connect Connects to an existing data source. Currently only `clickhouse` is supported. ```bash filename="Terminal" copy sloan connect clickhouse <--connection-string > <--mcp > ``` ", required: true, description: "The connection string to your ClickHouse database.", examples: ["e.g. clickhouse://user:pass@host:port/db"] }, { name: "--mcp ", description: "Choice of which MCP host to use.", examples: ["default: cursor-project", "other options: cursor-global", "claude-desktop", "windsurf-global"] } ]} /> ### setup Takes an existing data engineering project build with Moose and configures Sloan MCP for it. ```bash filename="Terminal" copy sloan setup [path] <--mcp > ``` ", description: "Choice of which MCP host to use. If flag is not provided, the default is `cursor-project`.", examples: ["default: cursor-project", "other options: claude-desktop", "cursor-global", "cursor-project", "windsurf-global"] }, { name: "--", description: "Setup Sloan MCP to already have access to Moose read tools", examples: ["--moose-read-tools", "--moose-write-tools", "--remote-clickhouse-tools"] } ]} /> ### config Configure Sloan settings #### config focus Sloan allows you to configure project level MCPs (e.g. for Cursor) and global MCPs (e.g. for Claude Desktop). To configure which Sloan project is being used with the Global MCPS, use `sloan config focus`. ```bash filename="Terminal" copy sloan config focus ``` #### config keys Updates all MCP files for projects listed in ~/.sloan/sloan-config.toml to use updated API key. ```bash filename="Terminal" copy sloan config keys ``` #### config tools Toggles availability of experimental MCP tools. See [Tools Reference](/sloan/reference/tool-reference). ```bash filename="Terminal" copy sloan config tools ``` Note: if you select `remote-clickhouse`, you will need to add your ClickHouse Cloud / Boreal credentials to `mcp.json`. --- ## Getting Started Source: sloan/reference/mcp-json-reference.mdx Getting started guide for Sloan CTACard, CTACards, ZoomImg, ChipButton, Columns, Column, FeatureCard, FeatureGrid, BulletPointsCard, QnABullets, CheckmarkBullets, Icons, } from "@/components"; ## Configuring Sloan MCP with MCP.JSON - **Node**: [version 20+](https://nodejs.org/en/download) (LTS recommended) - **Anthropic API key**: [Get your API key from Anthropic](https://docs.anthropic.com/en/docs/initial-setup). This is required for using Sloan's generative MCP tools. - **Moose CLI** and Moose Project required for "write" tools. ### Where is your MCP.JSON file? Your MCP.JSON file is located in a different location depending on your client of choice. The below is a list of default locations for the MCP.JSON file for our supported clients. * [Claude Desktop](https://modelcontextprotocol.io/quickstart/user): `~/Library/Application Support/Claude/claude_desktop_config.json` (note, you can create this by going to `claude > settings > Developer > Edit Config`) * [Cursor (global MCP)](https://docs.cursor.com/context/model-context-protocol#configuration-locations): `~/.cursor/settings/mcp.json` * [Cursor (project MCP)](https://docs.cursor.com/context/model-context-protocol#configuration-locations): `/path/to/your/project/.cursor/mcp.json` * [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp#configuring-mcp-tools): `~/.codeium/windsurf/mcp_config.json` For other clients, look to their documentation for where their MCP.JSON file is located. ### Adding Sloan MCP to your MCP.JSON file **Configuration Object Naming**: Different MCP clients use different naming conventions for the server configuration object: - **Cursor, Windsurf**: Uses `"mcpServers"` - **Claude Desktop, VS Code**: Use `"servers"` instead Make sure to check your specific client's documentation for the correct naming convention. ```json filename="MCP configuration" copy { "mcpServers": { "sloan": { "args": [ "@514labs/sloan-mcp@latest", "--moose-read-tools", "path/to/your/moose/project" ], "command": "npx", "env": { "ANTHROPIC_API_KEY": "", "MOOSE_PATH": "path/to/your/moose/installation", "NODE_PATH": "path/to/your/node/installation", "PYTHON_PATH": "path/to/your/python/installation" } } } } ``` ```json filename="MCP configuration" copy { "servers": { "sloan": { "args": [ "@514labs/sloan-mcp@latest", "--moose-read-tools", "path/to/your/moose/project" ], "command": "npx", "env": { "ANTHROPIC_API_KEY": "", "MOOSE_PATH": "path/to/your/moose/installation", "NODE_PATH": "path/to/your/node/installation", "PYTHON_PATH": "path/to/your/python/installation" } } } } ``` ### Arguments / Environment Variables ### Adding tool sets to your MCP.JSON file In general, we recommend using read-only tool-sets (`moose-read-tools` and `remote-clickhouse`) with chat type clients (like Claude Desktop) For information about toolsets, see [tools reference](../sloan/reference/tool-reference). ```json filename="MCP.JSON" copy "args": [ ... "--moose-read-tools", ] ``` [Moose read tools documentation](../sloan/reference/tool-reference#moose-read-tools) ```json filename="MCP.JSON" copy "args": [ ... "--moose-read-tools", "--moose-write-tools", ] ``` [Moose write tools documentation](../sloan/reference/tool-reference#moose-write-tools) ```json filename="MCP.JSON" copy "args": [ ... "--remote-clickhouse", ... ] "env": { ... "BOREAL_CLICKHOUSE_HOST": "...", "BOREAL_CLICKHOUSE_PORT": "...", "BOREAL_CLICKHOUSE_USER": "...", "BOREAL_CLICKHOUSE_PASSWORD": "...", "BOREAL_CLICKHOUSE_DATABASE": "...", } ``` [Remote Clickhouse read tools documentation](../sloan/reference/tool-reference#remote-clickhouse) --- ## Tool Reference Source: sloan/reference/tool-reference.mdx MCP tools and external tools for Sloan FeatureCard, FeatureGrid, Icons, ToggleBlock, } from "@/components"; # Tool Reference Sloan CLI can allow you to use various Sloan MCP tool-sets, as well as install and configure certain external tools. See [CLI reference](../cli-reference.mdx) for more information. You can also configure the toolsets available in your Sloan MCP by manually editing your MCP.json file. See [MCP.json reference](../mcp-json-reference.mdx) for more information. Tools are grouped by their purpose into toolsets. The fewer tools you enable, the higher performance the agent using the tool set will have, especially with respect to tool selection. ## Toolsets ## Read Only Moose tools Tools needed to read the Moose project and its associated infrastructure. ### Activate this toolset These tools are enabled by default. To enable them explicitly: Run the following command: ```bash filename="Terminal" copy sloan config tools ``` and enable `moose-read-tools`. e.g.: ```txt filename="Terminal" copy ? Select tools to enable (no selection defaults to moose-read-tools): [x] moose-read-tools - Enable moose read tools for data inspection [ ] moose-write-tools - Enable moose write tools for full functionality (requires API key, auto-enables read tools) [ ] remote-clickhouse-tools - Enable Remote Clickhouse integration ``` If you are managing the Sloan MCP with `mcp.json`, you can enable this toolset by adding the following to your `mcp.json`: ```json filename="MCP.json" copy "args": [ ... "--moose-read-tools", ... ] ``` ### When is this toolset useful? When you need to understand what data exists in your Moose project and how it's structured. **Sample prompts:** - *"Tell me about the data in my Moose project"* - *"Tell me about the data in my analytics table"* - *"Tell me about the data streams in my Moose project"* - *"Describe my DLQ topic"* - *"Tell me about the data in my enrichment data stream"* **Tools used:** `read_moose_project`, `read_clickhouse_tables`, `read_redpanda_topic` When you need to verify data flow and check if your data transformations are working correctly. *(Also requires `write-moose-tools`)* **Sample prompts:** - *"Did data land in my analytics table?"* - *"Did the data in my analytics table change?"* - *"Did my materialized view update?"* - *"Show me recent data in my user_events stream"* **Tools used:** `read_clickhouse_tables`, `read_redpanda_topic`, `read_moose_project` When you need to check the health and status of your local Moose development environment. **Sample prompts:** - *"Is my Moose development server running?"* - *"Is my Moose development server healthy?"* - *"Did my new workflow kill my local dev server?"* - *"What's the status of my Moose infrastructure?"* **Tools used:** `check_moose_status`, `read_moose_project` ### Tools #### `read_moose_project` Retrieves an infrastructure map from the local Moose development server. Retrieves a list of all primitives in the project (e.g. Data Models, Workflows, Streaming Functions, Materialized Views, APIs), as well as their associated infrastructure (e.g. ClickHouse tables, Redpanda topics, etc.). #### `read_clickhouse_tables` Queries local ClickHouse. #### `read_redpanda_topic` Reads from local Redpanda. #### `check_moose_status` Checks the status of the Moose project. Useful for debugging. ## Write Moose tools Tools needed to create and test Moose primitives. These are used to ingest data, transform data and create egress patterns for data in your project. ### Activate this toolset These tools are enabled by default (except for in Claude Desktop, where these tools aren't recommended). These tools require that the `read-only-moose-tools` toolset is enabled. To enable them explicitly: Run the following command: ```bash filename="Terminal" copy sloan config tools ``` and enable `moose-write-tools`. e.g.: ```txt filename="Terminal" copy ? Select tools to enable (no selection defaults to moose-read-tools): [ ] moose-read-tools - Enable moose read tools for data inspection [x] moose-write-tools - Enable moose write tools for full functionality (requires API key, auto-enables read tools) [ ] remote-clickhouse-tools - Enable Remote Clickhouse integration ``` If you are managing the Sloan MCP with `mcp.json`, you can enable this toolset by adding the following to your `mcp.json`: ```json filename="MCP.json" copy "args": [ ... "--moose-write-tools", ... ] ``` ### Usage tips Consider the flow of data through your Moose project when creating new primitives. For example, if you want to create a streaming function, the `write_stream_function` tool will have a much better chance of success if there is a data sample, a source and a destination data model in place. See [Moose Docs](../../moose) for best practices. Many of the tools have testing corollaries (and for the ones that don't, there are general purpose tools that can allow the agent to test the created primitive, like `read_moose_project`, `read_clickhouse_tables`, `read_redpanda_topic`). Use those testing tools to ensure that the agent is doing what you intend it to do. Step by step prompting (e.g. "Get sample data from X API", "Create an ingest data model", "Create a workflow to periodically grab data from the API", ...) has a higher success rate than trying to one-shot the entire project creation flow. ### When is this toolset useful? When you need to build the core components of your data infrastructure. **Sample prompts:** - *"Create a new data model for the following API source: [API docs/schema]"* - *"Create a new workflow to ingest data from this API source every 5 minutes"* - *"Create a streaming function to enrich data from my user_events stream with user profile data"* - *"Create a materialized view that will improve the performance of the aircraft API"* **Tools used:** `write_ingestion_pipeline`, `write_workflow`, `write_stream_function`, `write_materialized_view` When you want to build a complete data product from ingestion to analytics. **Sample prompts:** - *"Create a new Moose project that ingests GitHub star data, enriches it with repository metadata, and creates APIs for analytics dashboards"* - *"Build a real-time analytics system for aircraft tracking data with location-based queries"* - *"Create a data pipeline that processes IoT sensor data and provides aggregated insights via REST APIs"* **Tools used:** `write_spec`, `write_ingestion_pipeline`, `write_workflow`, `write_stream_function`, `write_materialized_view`, `create_egress_api` When you want to create optimized data products for specific use cases. **Sample prompts:** - *"Create a data product for visualizing user engagement metrics with real-time updates"* - *"Build materialized views that improve query performance for my analytics dashboard"* - *"Create analytics APIs that support my frontend application's data needs"* **Tools used:** `write_materialized_view`, `create_egress_api`, `test_egress_api` When you need to fix data issues or improve data processing reliability. **Sample prompts:** - *"Look at my DLQ topic and create a streaming function to fix the data format issues"* - *"Create a data validation workflow that checks data quality before processing"* - *"Build error handling for my data ingestion pipeline"* **Tools used:** `read_redpanda_topic`, `write_stream_function`, `write_workflow` When you want to improve the speed and efficiency of your data products. **Sample prompts:** - *"Create materialized views that will improve the performance of my user analytics APIs"* - *"Analyze query patterns and optimize my data model for better performance"* - *"Create pre-computed aggregations for my most common dashboard queries"* **Tools used:** `write_materialized_view`, `create_egress_api`, `test_egress_api` ### Tools #### `write_spec` Generates a plan for an end to end Moose project (from ingest, through transformation and egress). Files created: * *Creates a .md file in the current directory with the plan.* ```txt filename="/project/app/specs/specification.md" copy # Technical Specification: ASD-B Aircraft Data Ingestion and Visualization ## 1. Overview This specification outlines the implementation of a system to ... ``` #### `write_and_run_temp_script` Creates and runs a temporary script, usually either for sampling or for API inspection. Files created: * *Creates a temporary script in the /project/.moose/sloan directory, and runs it, usually creating a sample data file in the same directory.* ```js filename="/project/.moose/sloan-scratch/script.js" copy const ADSB_API_URL = 'https://api.adsb.lol/v2/mil'; const INGEST_URL = 'http://localhost:4000/ingest/AircraftTransponder'; const FETCH_INTERVAL = 5000; // 5 seconds const MAX_RUNTIME = 30000; // 30 seconds async function fetchAndIngestData() { const startTime = Date.now(); const processedAircraft = []; while (Date.now() - startTime < MAX_RUNTIME) { try { // Fetch data from ADSB API const response = await fetch(ADSB_API_URL); const data = await response.json(); if (data && data.ac && Array.isArray(data.ac)) { // Process each aircraft for (const aircraft of data.ac) { // Ingest aircraft data const ingestResponse = await fetch(INGEST_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(aircraft) }); if (ingestResponse.ok) { processedAircraft.push({ icao: aircraft.hex, timestamp: new Date().toISOString(), status: 'ingested' }); } } } } catch (error) { // Let errors crash the script throw error; } // Wait for the next interval if we haven't exceeded MAX_RUNTIME if (Date.now() - startTime + FETCH_INTERVAL < MAX_RUNTIME) { await new Promise(resolve => setTimeout(resolve, FETCH_INTERVAL)); } else { break; } } return { totalProcessed: processedAircraft.length, processedAircraft, startTime: new Date(startTime).toISOString(), endTime: new Date().toISOString() }; } // Run the script and write results to output.json const result = await fetchAndIngestData(); await fs.writeFile('output.json', JSON.stringify(result, null, 2)); ``` ```json filename="/project/.moose/sloan-scratch/output.json" copy { "ac": [ { "hex": "ae63c1", "type": "tisb_icao", ...remaining fields }, ] } ``` #### `write_workflow` Creates a Moose Workflow, typically run on a schedule, typically used to ingest data. [Moose documentation](../../moose/building/workflows.mdx). Files created: * *Creates a script in the project directory with the workflow, and imports it into `index.ts` or `main.py`.* Infrastructure created: * *Creates a Moose managed temporal script, orchestrating the workflow that was created.* ```ts filename="/project/app/scripts/script.ts" copy /** * Task to fetch and ingest aircraft transponder data */ , TaskResult>("FetchAndIngestAircraftTransponder", { run: async () => { // Fetch data from external API and ingest into Moose // ... see full code above ... }, retries: 3, timeout: "1h" }); /** * Workflow to ingest aircraft transponder data */ ); /** * Default export function that returns the workflow instance * Required by the Moose runtime */ return ingestAircraftTransponderWorkflow; } ``` ```ts filename="/project/app/index.ts" copy export { ingestAircraftTransponderWorkflow } from "./scripts/IngestAircraftTransponder/IngestAircraftTransponder"; ``` #### `run_workflow` Runs a Moose workflow. Used as part of the `write_workflow` flow. [Moose documentation](../../moose/building/workflows.mdx). #### `write_ingestion_pipeline` Creates a Moose data model, typically used to define the schema of the data in your Moose project. [Moose documentation](../../moose/building/data-models.mdx). Files created: * *Creates a data model in the project directory, and imports it into `index.ts` or `main.py`.* Infrastructure created: * *Depending on the configuration, creates a ClickHouse table, a Redpanda topic, and/or an ingest API.* ```ts filename="/project/app/datamodels/.ts" copy // Define aircraft tracking data interface export interface AircraftTrackingData { hex: string; // Unique aircraft identifier flight: string; // Flight number // ... other fields } // Define ingest pipelines ); ``` ```ts filename="/project/app/index.ts" copy export * from "./datamodels/models"; ``` #### `write_stream_function` Creates a Moose stream processing function. Runs on a per row basis as data is ingested into the stream. [Moose documentation](../../moose/building/streaming-functions.mdx). Files created: * *Creates a stream function in the project directory, and imports it into `index.ts` or `main.py`.* Infrastructure created: * *Creates a streaming function.* ```ts filename="/project/app/functions/.ts" copy // Transform raw aircraft data to processed format function transformAircraft(record: AircraftTrackingData): AircraftTrackingProcessed { const zorderCoordinate = calculateZOrder(record.lat, record.lon); const navFlags = parseNavModes(record.nav_modes); return { ...record, zorderCoordinate, ...navFlags, timestamp: new Date(record.timestamp), }; } // Connect the data pipeline AircraftTrackingDataPipeline.stream!.addTransform( AircraftTrackingProcessedPipeline.stream!, transformAircraft ); ``` ```ts filename="/project/app/index.ts" copy export * from "./functions/process_aircraft"; ``` #### `write_materialized_view` Creates a Moose materialized view. [Moose documentation](../../moose/building/materialized-views.mdx). Files created: * *Creates a materialized view in the project directory, and imports it into `index.ts` or `main.py`.* Infrastructure created: * *Creates a materialized view in ClickHouse.* ```ts filename="/project/app/views/.ts" copy // Define schema for aggregated aircraft data near San Francisco interface AircraftTrackingProcessed_NearbySFSchema { hex: string; last_seen: string & Aggregated<"max", [Date]>; count: string & Aggregated<"count", []>; avg_lat: string & Aggregated<"avg", [number]>; avg_lon: string & Aggregated<"avg", [number]>; } // SQL query to find aircraft within 50 miles of San Francisco const query = sql` // SQL Query Here `; // Create materialized view for efficient querying ); ``` ```ts filename="/project/app/index.ts" copy export * from './views/AircraftTrackingProcessed_NearbySF'; ``` #### `create_egress_api` Creates an egress API from Moose ClickHouse. Can utilize type safe parameters. [Moose documentation](../../moose/building/egress-apis.mdx). Files created: * *Creates an egress API in the project directory, and imports it into `index.ts` or `main.py`.* Infrastructure created: * *Creates an egress API.* ```ts filename="/project/app/apis/.ts" copy interface AircraftRadiusParams { lat: number; // Center latitude lon: number; // Center longitude radius: number; // Search radius in miles } ) => { // Execute the query using the Haversine formula to calculate distances const result = await client.query.execute(sql` // SQL Query Here `); return result; }, { metadata: { description: "Returns all aircraft within a given radius (in miles) of a specified latitude and longitude" } } ); ``` ```ts filename="/project/app/index.ts" copy export * from './apis/getAircraftWithinRadius'; ``` #### `test_egress_api` Tests the specified APIs. Used as part of the `create_egress_api` flow. ## Experimental: Remote ClickHouse Tools (Alpha) Tools for reading data in your external ClickHouse database (e.g. those hosted in Boreal or ClickHouse Cloud). These are useful for iterating off a production project, for debugging production issues or for local testing of changes to production data. For an abundance of caution, we suggest using read-only credentials for this toolset. [ClickHouse documentation](https://clickhouse.com/docs/operations/access-rights). If you want to modify your ClickHouse database, we suggest using Moose to do so. ### Activate this toolset These tools are **not** enabled by default. To enable them explicitly: Run the following command: ```bash filename="Terminal" copy sloan config tools ``` and enable `remote-clickhouse-tools`. e.g.: ```txt filename="Terminal" copy ? Select tools to enable (no selection defaults to moose-read-tools): [ ] moose-read-tools - Enable moose read tools for data inspection [ ] moose-write-tools - Enable moose write tools for full functionality (requires API key, auto-enables read tools) [x] remote-clickhouse-tools - Enable Remote Clickhouse integration ``` If you are managing the Sloan MCP with `mcp.json` file, you can enable this toolset by adding the following to your `mcp.json` file: ```json filename="MCP.json" copy "args": [ ... "--remote-clickhouse-tools", ... ] "env": { ... "BOREAL_CLICKHOUSE_HOST": "...", "BOREAL_CLICKHOUSE_PORT": "...", "BOREAL_CLICKHOUSE_USER": "...", "BOREAL_CLICKHOUSE_PASSWORD": "...", "BOREAL_CLICKHOUSE_DATABASE": "...", } ``` ## Other Experimental Tools These tools are in research preview, [let us know if you are interested in using them](mailto:sloan@fiveonefour.com). ### Experimental: Context management tools (Research Preview) Tools for managing context related to your Moose project. Useful for: - testing your data infrastructure against policy (e.g. data quality, data security, data governance) - ensuring metrics definition standardization for ad hoc queries of your data If you are interested in using these tools, please contact us at [support@moose.ai](mailto:sloan@fiveonefour.com). ### Experimental: External tools (Research Preview) Tools for interacting with external data systems. Current supported external data systems: - DuckDB - Databricks If you are interested in using these tools, or any other external data tools, please contact us at [support@moose.ai](mailto:sloan@fiveonefour.com).