C3 AI Documentation Home

C3 AI MCP Quickstart

This tutorial takes you from a fresh IDE to a working loop where your coding assistant writes a new method, generates tests, runs them, and fixes failures automatically. You connect to both MCP servers that C3 AI provides along the way.

By the end, you have:

  • C3 Central MCP Server connected so your assistant can answer C3 questions, generate Types, and apply coding standards.
  • Your application's MCP server with runTest and getC3TypeInformation enabled so the assistant can run tests and inspect Types on your live application.
  • A short feedback loop where the assistant writes code, writes tests, runs them, and iterates.

Before you start

Confirm the following before you begin:

  • IDE: VS Code 1.102 or later with GitHub Copilot, Cursor 1.2.1 or later, or Claude Code.
  • Node.js: installed and available on your PATH.
  • App Admin role: required on your application to generate tokens, enable tools, and publish prompts.
  • An application that depends on the mcpServer package: the package is included by default in 8.9 and later.

Step 1 - Connect to the C3 Central MCP Server

The Central MCP Server is hosted at https://mcp.c3.ai and shared across all C3 AI developers. It provides tools, prompts, and skills that help your assistant work with C3 Types, Transforms, and platform conventions.

  1. Go to https://mcp.c3.ai.

  2. Authenticate with your C3 AI Developer Portal credentials.

  3. On the configuration page, select Install for VS Code, Install for Cursor, or Install for Claude Code based on your IDE.

    C3 Central MCP Server configuration page

  4. For VS Code or Cursor, the editor launches and shows an install prompt. Select Install. For Claude Code, copy the displayed command and run it in your terminal:

    Command Line
    claude mcp add \
      --transport http \
      C3AI-MCP-Server \
      https://mcp.c3.ai/mcp/server \
      --header "Authorization: C3Bearer <your-token>"
  5. Verify the connection:

    • VS Code: open the Command Palette and search for MCP: Open User Configuration. Confirm C3AI-MCP appears.
    • Cursor: open the Command Palette and search for View: Open MCP Settings. Confirm tool and prompt counts appear.
    • Claude Code: run claude mcp list and confirm C3AI-MCP-Server is listed.

For the full setup reference and troubleshooting, see Connect to the C3 Central MCP Server.

Step 2 - Install the C3 instruction files

Instruction files give your assistant persistent context about C3 conventions, Type patterns, and file structure. Without them, generated code does not match C3 standards.

  1. Open a chat with your assistant.

  2. Enter: Update my instructions using C3 MCP.

  3. The assistant calls get_latest_instructions and installs the c3-mcp-cli command-line tool.

    Instruction setup check

  4. Wait for the setup script to finish. The script installs both C3 instruction files and skills (reusable workflows such as vault encryption, type generation, and test automation) into the folder that matches your IDE:

    • VS Code: .github/instructions/, .github/skills/ folders.
    • Cursor: .cursor/rules/, .cursor/skills folders.

With Central MCP connected and instruction files installed, your assistant can already generate C3 Types, create Python and JavaScript implementations, search C3 documentation, and use guided prompts for common tasks like writing tests and designing data models.

To verify the connection works, try a documentation search. Enter a prompt like:

Text
Search docs for how to train MlModels in C3 AI in version 8.9 using C3 AI MCP

Your assistant calls search_c3_documentation and returns relevant results from the C3 documentation:

Documentation search result from Central MCP

You can also confirm the CLI tool installed correctly by running the following in your terminal:

Command Line
c3-mcp-cli --help

This lists all available commands in the C3 MCP CLI:

c3-mcp-cli help output

For the full list of tools, prompts, skills, and extensions available through Central MCP, see Configure and Use C3 Central MCP Server.

Step 3 - Connect to your application's MCP server

Your application's MCP server gives your assistant live access to your application's Types and tests. This is required for the write-test-fix loop.

As a prerequisite, confirm your application includes the mcpServer package and is running. If not, add the package to your app and start it before proceeding.

To connect to your application's MCP server, access your application's mcp url via https://<cluster>/<env>/<app>/mcp.html.

This will take you to the app MCP instructions page where you can follow the instructions to connect your IDE to the app MCP server and then test your tool calls.

App MCP Connection Instructions

After following the instructions and connecting your IDE to the app MCP server, you should verify your connection by checking the tools available in your IDE. For example in VSCode, if you click Configure Tools in your GitHub Copilot settings, you'll see all the Central MCP tools and your app tools listed.

App MCP Listed Tools

  1. You go to your application console and run Pkg.upsertAllSeed() (this makes the seeded app MCP tools available for your agent).

  2. After the upsert seed completes, run Mcp.AppTools.enableAppTools(). This should enable the default tools coming from the mcp package.

Now that you have verified your App MCP connection and viewed your available tools, you can test them via your coding assistant. Below is an example of checking available tools and calling tools via GitHub Copilot in VS Code.

App MCP Tool Testing

Step 4 - Use both MCP Servers in Action

Your assistant now has Central MCP for C3 platform knowledge and App MCP for live application actions. This step brings both together. Here we show two use cases where these MCP servers help you do your work more efficiently with coding agents.

  1. Start with a quick data-query prompt to confirm the connection works. Enable entityDataRetriever from MCP > Tools, then enter a prompt like the following in your assistant's chat. Replace the Type name and property with ones from your application:

    Text
    Find the [YourType] with the highest [YourProperty] in my application.

    The following screenshot shows App MCP tools being used to find the item with the highest risk score in an example application:

    Data query example using App MCP

  2. You can also try the full write-test-fix loop. Replace the Type name and method description with something relevant to your application:

    Text
    Add a new method on [YourType] in my application that [describe what it should do]. 
    
    Write js tests for this method and run the tests on my application. 
    
    If any test fails, find the problem and iterate until they all pass.

    You describe a feature in plain language, and the assistant writes the implementation, generates tests, runs them on your application, and iterates until they pass. Your assistant picks the right tools from both MCP servers based on the task. A typical session includes:

    • Reading Type metadata from your application (App MCP) to understand the existing schema.
    • Using C3 documentation and code-generation tools (Central MCP) to draft the implementation following platform conventions.
    • Reading skills and prompts for writing tests (Central MCP) to generate test cases.
    • Editing files in your project directly.
    • Running tests on your live application (App MCP) and reading the results.
    • Fixing failures in the implementation or tests and re-running until the tests pass.

    The exact tools and order vary depending on the prompt, the model, and your application.

    Accept or reject each file change as the assistant proposes it.

    The loop continues until all tests pass. The assistant summarizes the final state.

What you now have

After finishing the tutorial, your environment is set up for the full agentic workflow:

  • Central MCP provides C3 platform knowledge, code generation, and reusable prompts.
  • App MCP runs tools on your live application: executing code, running tests, inspecting Types, and validating packages.
  • Your assistant can edit files, call tools from both servers, and iterate automatically.

From here, you can enable more default tools (such as entityDataRetriever and readPkgIssues), create custom tools for your business logic, publish reusable prompts, and install extensions to broaden what your assistant can do.

See also

Was this page helpful?