MCP Server Integration
Set up OGuardAI as an MCP server for Claude Desktop, Claude Code, and other MCP-compatible clients
OGuardAI provides an MCP (Model Context Protocol) server for use with Claude Desktop, Claude Code, and other MCP-compatible clients.
Install
npm install -g @oguardai/mcp-server
# or
pnpm add -g @oguardai/mcp-serverClaude Desktop Configuration
Add OGuardAI to your Claude Desktop MCP configuration file.
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"guardai": {
"command": "guardai-mcp",
"args": [],
"env": {
"GUARDAI_URL": "http://localhost:3000",
"GUARDAI_API_KEY": "your-api-key"
}
}
}
}Or run the server directly with npx:
{
"mcpServers": {
"guardai": {
"command": "npx",
"args": ["@oguardai/mcp-server"],
"env": {
"GUARDAI_URL": "http://localhost:3000"
}
}
}
}Claude Code Configuration
Add to your .claude/settings.json or project-level MCP config:
{
"mcpServers": {
"guardai": {
"command": "npx",
"args": ["@oguardai/mcp-server"],
"env": {
"GUARDAI_URL": "http://localhost:3000"
}
}
}
}Available Tools
Once configured, Claude has access to these tools:
guardai_transform
Protect sensitive data in text by replacing PII with semantic tokens.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text that may contain sensitive data |
policy | string | No | Policy to apply (default: server default) |
language | string | No | ISO 639-1 language hint |
Example interaction:
User: "Please draft a reply to this customer email:
From: Julia Schneider <julia@firma.de>
Subject: Order complaint ORD-2026-4892"
Claude: [calls guardai_transform with the email text]
-> Gets safe text with `{{person:p_001}}`, `{{email:e_001}}`, `{{order:o_001}}`
-> Drafts reply using tokens
-> [calls guardai_rehydrate to restore real values]
-> Returns personalized replyguardai_rehydrate
Restore real values in text that contains OGuardAI semantic tokens.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text containing {{type:id}} tokens |
session_state | string | Yes | Encrypted session state blob from a prior transform call |
output_channel | string | No | Output channel (customer_email, internal_summary, etc.) |
guardai_detect
Detect entities in text without transforming. Useful for auditing and understanding what PII exists in content.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to analyze |
language | string | No | ISO 639-1 language hint |
guardai_health
Check the OGuardAI server health status.
guardai_evaluate_policy
Evaluate what a policy would do to detected entities without actually transforming.
Usage Examples
Protecting Customer Data in Conversations
User: "Summarize this customer complaint. Make sure to protect
their personal data:
My name is Marcus Weber, email m.weber@techcorp.de.
Order Q-2026-0847 was delivered damaged."
Claude will:
1. Call guardai_transform to tokenize the PII
2. Process the safe text to generate a summary
3. Call guardai_rehydrate to restore values for the appropriate audienceAuditing Text for PII
User: "Check this document for any PII before I send it to the
external analytics team."
Claude will:
1. Call guardai_detect to find all entities
2. Report what was found (types, confidence scores)
3. Suggest which policy to applyEnvironment Variables
| Variable | Default | Description |
|---|---|---|
GUARDAI_URL | http://localhost:3000 | OGuardAI server URL |
GUARDAI_API_KEY | (none) | API key for authentication |