Works with the AI Agents you already use
RelayShield AI SDK: Mandatory MCP Server Gate
* - 'flagged' / 'blocked': Returns "denied", tool does not run.
$19
RelayShield AI SDK: Mandatory MCP Server Gate
Example session with this skill installed
Add a security gate to my connectMcp tool using RelayShield to prevent access to malicious servers.
- Read your context and instructions
- Compiled the relayshield ai sdk
I have integrated the relayshieldMcpGate into your Vercel AI SDK configuration. This ensures that any attempt to use the connectMcp tool is intercepted and validated against RelayShield's threat intelligence before the connection is established.
Implementation details
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { z } from 'zod';
import { relayshieldMcpGate } from 'ai-sdk-relayshield';
const result = await generateText({
model: openai('gpt-4o'),
tools: {
connectMcp: {
description: 'Connect to an MCP server',
parameters: z.object({ serverUrl: z.string() }),
execute: async ({ serverUrl }) => {
// This only runs if relayshieldMcpGate returns undefined
return { connected: true, serverUrl };
},
},
},
toolApproval: relayshieldMcpGate({
apiKey: process.env.RELAYSHIELD_API_KEY,
}),
prompt: 'Connect to the MCP server at https://mcp.example.com/mcp',
});
/**
* Gate Verdict Logic:
* - 'no_flags_found': Tool execution proceeds.
* - 'flagged' / 'blocked': Returns "denied", tool does not run.
* - Internal Error: Defaults to "denied" (fail-closed).
*/
Connects securely to your tools. The creator never sees your data.
About this skill
I have integrated the relayshieldMcpGate into your Vercel AI SDK configuration. This ensures that any attempt to use the connectMcp tool is intercepted and validated against RelayShield's threat intelligence before the connection is established.
Implementation details
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { z } from 'zod';
import { relayshieldMcpGate } from 'ai-sdk-relayshield';
const result = await generateText({
model: openai('gpt-4o'),
tools: {
connectMcp: {
description: 'Connect to an MCP server',
parameters: z.object({ serverUrl: z.string() }),
execute: async ({ serverUrl }) => {
// This only runs if relayshieldMcpGate returns undefined
return { connected: true, serverUrl };
},
},
},
toolApproval: relayshieldMcpGate({
apiKey: process.env.RELAYSHIELD_API_KEY,
}),
prompt: 'Connect to the MCP server at https://mcp.example.com/mcp',
});
/**
* Gate Verdict Logic:
* - 'no_flags_found': Tool execution proceeds.
* - 'flagged' / 'blocked': Returns "denied", tool does not run.
* - Internal Error: Defaults to "denied" (fail-closed).
*/
Next steps
- Ensure
RELAYSHIELD_API_KEYis set in your environment variables. - Test the gate with a known test URL to confirm the "denied" workflow triggers correctly.
- Add the
checkPromptInjectionBreachtool if your agent handles sensitive operator sessions.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.
Requires Vercel AI SDK v7 and a RelayShield API key. Does not monitor post-connection behavior. Auth or malformed response errors trigger immediate denial.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 10 days ago
- Accounts
RelayShield API key
- Software
Node.js 18+Vercel AI SDK v7
RelayShield has a free tier.
Permissions
Allowed Hosts
Network Access is required to call the RelayShield API at api.relayshield.net for the threat-intelligence checks. Environment Variables is required for the RELAYSHIELD_API_KEY, or the key can be passed as a call argument instead. No file access is needed.