AI Integration

AI Integration

Starting with version 1.16.4, you can now add a connection from the Veracity Learning LRS to an Artificial Intelligence (AI) agent. With this connection, you can ask the AI agent questions about learning data in the LRS.

The connection is an access key, an HTTP Basic Authentication key/secret pair, like you used to get xAPI into the LRS. However, this is a separate key only for Model Context Protocol (MCP) service. With the MCP service key (and a little configuration), an AI agent can read and interpret the learning activity data in your LRS.

How to Get an MCP Server Key

To connect an AI agent to your LRS you must set-up an MCP server key:
  1. Log-in to your LRS as the administrator.

  2. From the left menu, select the Management > All Management Tools option.

  3. Scroll-down to the Integration and Extensions section and click the AI integration button.



  4. In the MCP Integration page, click the Create API Key button.


 
This generates the key/secret pair you need for the AI agent to use your LRS as an MCP server. The page also shows an example of how to configure the AI agent and a tip on how to manage its access in the LRS.

How to Configure the AI Agent

To set-up an AI agent to work with your LRS via MCP, you must edit the configuration of its code-generation and knowledge application. The configuration is almost always the same, but the location is not:
  1. Claude Codeclaude_desktop_config.json (app), .mcp.json (project), or ~/.claude.json (user)
  2. Google Antigravity~/.gemini/config/mcp_config.json (app)
  3. Microsoft VS Code.vscode/mcp.json (app)
  4. OpenAI Codex~/.codex/config.toml (app), or .codex/config.toml (project) 
Notes
You must set-up the MCP Service in the code-generating application of the AI agent suite. The agent uses this application to generate the custom code it needs to answer your LRS questions. For example, to ask Microsoft CoPilot a question about your LRS, you must configure the MCP Service in the Code app in Visual Studio; to ask Gemini an LRS question, use Antigravity; etc.
To edit the MCP Service configuration of an AI Agent:
  1. Find and open the configuration JSON file.

  2. Within the configuration file, find the mcpServers object.

  3. Add a veracity-lrs entry.

  4. Set the serviceUrl to the address of the MCP key in your LRS: e.g., https://your-lrs-name.lrs.io/api/mcp.

  5. Add headers for the secret (password) for the key UUID and the Content-Type (application/json).

  6. Save and close the file.
This is an example of the MCP server configuration for a typical AI agent:
"mcpServers": {
"veracity-lrs": {
"serverUrl": "https://your-lrs-name.lrs.io/api/mcp",
"headers": {
"x-veracity-api-key": "your-mcp-key-uuid",
"Content-Type": "application/json"
}
}
}
Now, you can ask the AI agent specific questions about learning activity recorded in your LRS and ask it to analyze it.
Claude Code MCP Configuration
These directions help you if you want to connect an MCP to a Claude Code project. You must create a file called .mcp.json in your project directory (a “project directory” is just any folder on your computer where you want to work with Claude Code). Here's how to set it up:
  1. Create a folder for your work (if you don't have one already)

    bash (macOS/Linux):
    mkdir ~/my-lrs-project
    cd ~/my-lrs-project
    PowerShell (Windows)
    mkdir C:\Users\your-name\my-lrs-project
    cd C:\Users\your-name\my-lrs-project
  2. Create the .mcp.json file in that folder. If you run Claude from that directory, then it should load this configuration file automatically.

    bash:
    cat > .mcp.json << 'EOF'
    {
      "mcpServers": {
        "veracity-lrs": {
          "type": "http",
          "url": "https://your-lrs-name.lrs.io/api/mcp",
          "headers": {
            "x-veracity-api-key": "your-mcp-key-uuid"
          }
        }
      }
    }
    EOF
    Or just create the file manually with your text editor and paste the JSON:
    {
      "mcpServers": {
        "veracity-lrs": {
          "type": "http",
          "url": "https://your-lrs-name.lrs.io/api/mcp",
          "headers": {
            "x-veracity-api-key": "your-mcp-key-uuid"
          }
        }
      }
    }
  3. Start Claude Code from that folder

    bash:
    claude
When Claude Code starts, it loads your Veracity MCP server from the .mcp.json file in that directory.

Notes
Every time you run Claude Code, make sure you're in the folder with the .mcp.json file. Claude Code reads the configuration file in your current working directory.
Google Antigravity MCP Configuration
To connect the Google Gemini Antigravity application to your LRS:
  1. In Windows, navigate to the folder in C:\Users\your-name\.gemini\config, and open the mcp_config.json file in a text editor.

  2. Add the following code:
{
"mcpServers": {
"veracity-lrs": {
"serverUrl": "https://your-lrs-name.lrs.io/api/mcp",
"headers": {
"x-veracity-api-key": "your-mcp-key-uuid",
"Content-Type": "application/json"
}
}
}
}
  1. Save the file.

  2. Open the Antigravity app and click the Settings button in the lower-left.

  3. In the Settings pop-up, in the left menu, select the Customizations option. 

  4. Make sure the Veracity LRS MCP Server is enabled.



  5. Close the pop-up.
In a conversation, when you first ask a question about xAPI data in your LRS, mention the LRS by name. The Antigravity agent will take a few minutes finding its best way to navigate the LRS (usually using PowerShell). The agent may ask several times for permission for access to various applications. 

After this period, the rest of your LRS-related questions should take only a few seconds to answer! 
OpenAI Codex MCP Configuration
Setting-up the LRS Model Context Protocol (MCP) server in OpenAI Codex connects your AI query environment to our data service. You can configure it by editing the MCP configuration settings directly, in the TOML text file, or indirectly, in the Codex app.

Text Editor
The most explicit way to manage MCP servers in Codex is by directly editing the config.toml file located at ~/.codex/config.toml (or inside a project-scoped .codex/directory).
[mcp_servers.veracity-lrs]
args = ["https://your-lrs-name.lrs.io/api/mcp"]
env = { x-veracity-api-key = "your-mcp-key-uuid", Content-Type = "application/json" }

Codex App
For a more user-friendly approach, you can manage MCP servers from within the Codex application.
  1. Open the app and navigate to Settings > MCP Servers.

  2. In the IDE Extension, open the gear menu and select Open config.toml.

  3. Click the Add button to input the LRS MCP server name, arguments, and environment variables.

  4. Click the Save button.



    • Related Articles

    • LMS Integration

      The Veracity Learning LRS offers frictionless integration with your LMS to let teachers and students access the services of the LRS without leaving the LMS. We do this using the Learning Tools Interoperability (LTI) technical standard. LTI is a ...
    • SQL Integration

      Only the Enterprise version of the LRS supports SQL Integration. The Veracity LRS can send xAPI statements to a SQL database in real time. The LRS opens a connection to your SQL server, and synchs statements every 300 milliseconds. The LRS won’t ...
    • Elasticsearch Integration

      Overview The LRS can accelerate its dashboard and statement viewer by leveraging Elasticsearch in addition to MongoDB. When configured with the optional Elasticsearch connection, the LRS will synchronize xAPI statements in real time between these two ...
    • Power BI Integration

      How to get LRS data into Power BI You can easily connect the Veracity LRS to Microsoft Power BI. In the LRS, save a Statement Viewer report and create an API key. In Power BI, configure and activate a data download channel with this information. In ...
    • Single Sign On (SSO) Integration

      Veracity can integrate with your single sign on provider using OpenID Connect or Security Assertion Markup Language (SAML). This integration allows your enterprise users to log into the LRS user interface without providing a password. Integrating a ...