> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusys.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Trusys MCP

Trusys MCP (Model Context Protocol) is a server that connects your AI coding assistant to the Trusys platform. It enables your assistant to manage applications, prompt libraries, and run evaluations directly from your IDE.

#### Remote MCP Endpoint

**Hosted by Trusys:**

* Default: `https://mcp.trusys.ai/mcp`
* SSE-compatible (for Antigravity): `https://mcp.trusys.ai/sse`

***

## What is Trusys MCP?

Trusys MCP allows your AI assistant to:

* **Manage Applications** - Create and configure AI applications and LLM models
* **Manage Prompt Libraries** - Create, edit, and organize prompt libraries with assertions
* **Run Functional Evaluations** - Test application quality using prompt libraries
* **Run Security Evaluations** - Perform red-team testing and security audits
* **Enable Monitoring** - Set up OpenLIT traces and Pulse monitoring for production applications
* **Configure Guardrails** - Add validators and TruGuard for input/output safety

The MCP server runs remotely (hosted by Trusys) or locally, and your IDE communicates with it via HTTP.

***

## Integration with Your IDE

* [Claude](/mcp/claude)
* [Cusrsor](/mcp/cursor)
* [Google Anti-Gravity](/mcp/anti-gravity)

***

## Using Trusys MCP

After connecting your IDE to Trusys MCP, you can ask your assistant to perform various tasks.

### 1. Functional Evaluation (Quality Testing)

Test your application's quality using prompt libraries and assertions:

**Ask your assistant:**

* "Run an evaluation on my app"
* "Test my application with Trusys"
* "Create a prompt library and evaluate localhost:3000"

**Workflow:**

1. Create or select an application
2. Create a prompt library with assertions
3. Run evaluation via CLI

### 2. Security Evaluation (Red-Team Testing)

Run security and red-team tests on your application:

**Ask your assistant:**

* "Run a security eval on my app"
* "Red-team test the chatbot application"
* "Create a security config with prompt-injection tests"

**Workflow:**

1. Specify your application
2. Reuse existing security configuration or create a new one
3. Define vulnerable categories and test plugins
4. Run security evaluation via CLI

**Notes:**

* If a security configuration already exists for your app, the assistant reuses it
* Specify "new security configuration" to create a fresh config

### 3. Pulse Monitoring

Set up production monitoring for your application:

**Ask your assistant:**

* "Enable Pulse monitoring on my app"
* "Generate traces for my project"
* "Set up OpenLIT for Trusys"

**Workflow:**

1. Create or select an application
2. Enable monitoring with sampling configuration
3. Define functional and security metrics to monitor
4. Initialize OpenLIT in your application code
5. Restart your app and generate traffic
6. View traces in Trusys Monitoring dashboard

**Environment Configuration:**

```bash theme={null}
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.trusys.ai
export OTEL_SERVICE_NAME=<your-application-id>
```

**Code Setup:**

```python theme={null}
import openlit
openlit.init()
```

### 4. Guardrails (TruGuard)

Add input and output validators to protect your application:

**Ask your assistant:**

* "Add guardrails to my app"
* "Enable TruGuard with prompt injection and PII checks"

**Workflow:**

1. Create or select an application
2. Configure input validators (before model processing)
3. Configure output validators (before returning to user)
4. Set enforcement actions (fail, mask, encrypt, fix)
5. Initialize TruGuard in your application code
6. Restart your app

**Environment Configuration:**

```bash theme={null}
export TRUSYS_APPLICATION_ID=<your-application-id>
export TRUSYS_API_KEY=<your-api-key>
```

**Code Setup:**

```python theme={null}
from trusys import truguard
truguard.init()
```

#### Test Connectivity

Start by verifying the connection:

```
"Check my Trusys API connection"
```

The assistant will use the `trusys_ping` tool to verify connectivity.

***

## Troubleshooting

### 401 Unauthorized

**Issue:** Authentication failed

**Solution:**

* Verify your API key is correct
* Ensure you're passing `x-api-key` or `Authorization: Bearer` header
* Check that `TRUSYS_API_KEY` is set on the MCP server if using `prefer_header`

### 400 Bad Request on x-trusys-base-url

**Issue:** Invalid custom API URL

**Solution:**

* Verify the URL uses proper format (http\:// or https\://)
* Ensure the URL is valid with no extra userinfo
* Check that the host is reachable

### 403 Forbidden with x-trusys-base-url

**Issue:** Server doesn't allow custom base URLs

**Solution:**

* Omit the `x-trusys-base-url` header and use the default
* Use a different MCP deployment for your organization
* Contact your Trusys administrator

### Pulse Monitoring Enabled but No Traces

**Issue:** Monitoring is configured but traces don't appear

**Solution:**

* Verify `metrics[]` is properly configured
* Check that security config has a valid `purpose` if security evaluation is enabled
* Ensure OpenLIT is initialized in your application
* Confirm OTEL environment variables are set correctly
* Restart your application after configuration changes

### Guardrails Show Disabled

**Issue:** Validators are saved but Application shows Disabled status

**Solution:**

* Ensure `enable_guard_rails: true` was sent with the `guardRails` configuration
* Both fields must be sent together in the same create/update request
* Restart your application after configuration changes

### General Health Check

Check the MCP server health:

```bash theme={null}
curl https://mcp.trusys.ai/health
```

Should return `ok` without requiring an API key.

***

## Related Documentation

* [Applications](/product/applications) - How to connect and configure AI applications
* [Prompt Library](/product/prompt-library) - Creating and managing prompt libraries
* [Functional Evaluations](/product/evaluations) - Running quality tests
* [Security Evaluations](/product/security-evaluations) - Red-team testing
* [Monitoring](/product/monitoring) - OpenLIT and Pulse monitoring setup
* [Guardrails](/product/guardrails) - Configuring TruGuard validators
