mastyf.ai — Claude Code MCP server: features and installation
A local gateway that checks MCP tool calls against security policies. Use it to control agent actions and keep an auditable execution record.
claude mcp add --env MASTYF_AI_DB_PATH=<MASTYF_AI_DB_PATH> --env ALERT_WEBHOOK_URL=<ALERT_WEBHOOK_URL> --env METRICS_ENABLED=<METRICS_ENABLED> --transport stdio mastyfai -- npx -y @mastyf_ai/serverWhat mastyf.ai does
mastyf.ai sits between an AI agent and MCP tools. It evaluates proposed calls against policy and blocks actions that are not allowed. The listed threats include malicious tool arguments, attempts to reach secrets, shell attacks, and runaway token use.
On first launch, the gateway finds local MCP servers and tools, then asks you to describe intended permissions in plain English. You can stage a policy, inspect its difference from the active one, and activate it. The execution ledger can be checked with mastyf audit verify.
The Python gateway setup uses Git and installs the package from the repository. The MCP server can also run through npx -y @mastyf_ai/server; its Claude Code setup command requires ALERT_WEBHOOK_URL.
What it helps with
- intercept MCP tool calls before execution
- block access to secrets and dangerous shell commands
- define permitted actions in plain English
- verify the execution receipt ledger
Example prompts for the agent
- Block attempts to delete files or make HTTP requests.
- Check MCP tool calls for attempts to read secrets.
- Show the staged policy and compare it with the active one.
How to install mastyf.ai
Platform CLI
claude mcp add --env MASTYF_AI_DB_PATH=<MASTYF_AI_DB_PATH> --env ALERT_WEBHOOK_URL=<ALERT_WEBHOOK_URL> --env METRICS_ENABLED=<METRICS_ENABLED> --transport stdio mastyfai -- npx -y @mastyf_ai/serverReplace <…> with your own values
Platform CLI
codex mcp add mastyfai --env MASTYF_AI_DB_PATH=<MASTYF_AI_DB_PATH> --env ALERT_WEBHOOK_URL=<ALERT_WEBHOOK_URL> --env METRICS_ENABLED=<METRICS_ENABLED> -- npx -y @mastyf_ai/serverReplace <…> with your own values
Config file
{
"mcpServers": {
"mastyfai": {
"command": "npx",
"args": [
"-y",
"@mastyf_ai/server"
],
"env": {
"MASTYF_AI_DB_PATH": "<MASTYF_AI_DB_PATH>",
"ALERT_WEBHOOK_URL": "<ALERT_WEBHOOK_URL>",
"METRICS_ENABLED": "<METRICS_ENABLED>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mastyfai": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mastyf_ai/server"
],
"env": {
"MASTYF_AI_DB_PATH": "<MASTYF_AI_DB_PATH>",
"ALERT_WEBHOOK_URL": "<ALERT_WEBHOOK_URL>",
"METRICS_ENABLED": "<METRICS_ENABLED>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e MASTYF_AI_DB_PATH=<MASTYF_AI_DB_PATH> -e ALERT_WEBHOOK_URL=<ALERT_WEBHOOK_URL> -e METRICS_ENABLED=<METRICS_ENABLED> mastyfai npx -y @mastyf_ai/serverReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mastyf.ai
How do I install mastyf.ai in Claude Code?
Run claude mcp add mastyf-ai -e ALERT_WEBHOOK_URL=<ALERT_WEBHOOK_URL> -- npx -y @mastyf_ai/server. Replace the placeholder with an alert webhook URL.
What does mastyf.ai do?
It checks MCP tool calls against security policies and blocks disallowed actions. It also keeps an execution ledger that can be verified.
How does mastyf.ai set permissions on first launch?
It discovers local MCP servers and tools, asks you to describe intended permissions in plain English, and presents the proposed policy changes before activation.