Hejdar

Created By
ARKALDA2 months ago
Runtime policy enforcement for AI agents. Evaluate every agent action against your organization's policies before execution. Define policies once in the Hejdar dashboard, enforce everywhere via MCP. Supports observe mode (shadow/audit) and enforce mode (real-time blocking).
Overview

hejdar-mcp

MCP server for Hejdar — runtime policy enforcement for AI agents.

This server exposes hejdar_evaluate as an MCP tool. Any MCP-compatible agent (Claude, ChatGPT, Cursor, custom) can call it to check whether an action is permitted by organizational policy before executing it.

The MCP server is a thin wrapper around the Hejdar API (POST /v1/evaluate). It contains no policy logic — all decisions come from your Hejdar organization's configured policies.

Quick Start

1. Install

pip install hejdar-mcp

Or run directly with uvx:

uvx hejdar-mcp

2. Get your API key

Sign up at app.hejdar.com and create an API key in Settings → API Keys.

3. Configure your MCP client

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "hejdar": {
      "command": "uvx",
      "args": ["hejdar-mcp"],
      "env": {
        "HEJDAR_API_KEY": "hejdar_sk_your_key_here"
      }
    }
  }
}

Claude Code

Add to your Claude Code MCP settings:

{
  "mcpServers": {
    "hejdar": {
      "command": "uvx",
      "args": ["hejdar-mcp"],
      "env": {
        "HEJDAR_API_KEY": "hejdar_sk_your_key_here"
      }
    }
  }
}

Direct (stdio)

export HEJDAR_API_KEY=hejdar_sk_your_key_here
hejdar-mcp

Getting Started

  1. Install: pip install hejdar-mcp or uvx hejdar-mcp
  2. Get an API key — contact us at hello@hejdar.com or visit hejdar.com
  3. Configure your MCP client (see configuration example above)

Tool: hejdar_evaluate

Evaluate an agent action against your organization's security policies.

Input:

ParameterTypeRequiredDescription
action_typestringYesREAD, WRITE, DELETE, TRANSFER, or EXECUTE
resourcestringYesTarget resource, e.g. customer_database
agent_namestringNoName of the calling agent, e.g. hr-assistant
contextobjectNoFree-form metadata (department, user_id, reason, etc.)

Output:

{
  "decision": "DENY",
  "policy_id": "pol_abc123",
  "reason": "Deletion of customer data requires manager approval",
  "risk_level": "HIGH"
}

decision is one of: ALLOW, DENY, WOULD_DENY.

System Prompt Pattern

For best results, add this to your agent's system prompt:

You have access to the hejdar_evaluate tool. Before performing any action
that reads, writes, deletes, transfers data, or executes commands on
external systems, you MUST call hejdar_evaluate first.

If hejdar_evaluate returns DENY or WOULD_DENY, do NOT proceed with the
action. Instead, inform the user that the action was blocked by policy
and include the reason provided.

Environment Variables

VariableRequiredDefaultDescription
HEJDAR_API_KEYYesYour Hejdar API key
HEJDAR_API_URLNohttps://api.hejdar.comAPI base URL (for self-hosted)

Security

  • API key is read from environment variables only — never hardcoded or exposed in tool I/O
  • All inputs are validated and sanitized before forwarding to the API
  • Error responses never leak internal details, API keys, or stack traces
  • All API calls enforce TLS

Development

git clone https://github.com/ARKALDA/hejdar-mcp.git
cd hejdar-mcp
pip install -e ".[dev]"
pytest

License

MIT

Server Config

{
  "mcpServers": {
    "hejdar": {
      "command": "uvx",
      "args": [
        "hejdar-mcp"
      ],
      "env": {
        "HEJDAR_API_KEY": "your-api-key",
        "HEJDAR_API_URL": "https://api.hejdar.com"
      }
    }
  }
}
Project Info
Created At
2 months ago
Updated At
2 months ago
Author Name
ARKALDA
Star
-
Language
-
License
-
Category

Recommend Servers

View All
Docwand

14 hours ago
//beforeyouship — LLM Cost Modeling From Your Editor
@Indiegoing

Query realistic LLM cost models without leaving your editor. beforeyouship models the **true monthly cost** of an LLM app architecture — retries, prompt caching, batch discounts, infra overhead, and 3×/10× growth — across GPT-5.x, Claude, Gemini, DeepSeek, and more. Not a token calculator: a planning tool for the design phase, before you commit to a stack. **No API key needed to try it** — demo mode covers the six free-tier models. A Pro key from [beforeyouship.dev](https://beforeyouship.dev) unlocks the full 18-model catalog. ## What you can ask - "How much will a RAG chatbot cost at 10,000 requests/day?" - "Compare Claude Haiku vs Gemini Flash pricing for my workload" - "What's the cheapest model for a multi-step agent at scale?" - "Show me current per-token prices for Anthropic models" ## Tools ### `estimate_cost` Full cost model for an architecture at a given usage level. Returns Naive / Realistic / Worst Case monthly cost per model, 3×/10× growth scenarios, and an opinionated recommendation with reasoning. ### `get_model_prices` Current per-1M-token pricing — input, output, cached input, batch — with context windows and staleness metadata. ### `list_archetypes` Seven preset architecture patterns (simple chatbot, chatbot with history, RAG pipeline, multi-model router, coding assistant, document processor, multi-step agent) used as starting points for estimates. ## Setup **Claude Code:** ​```bash claude mcp add --transport http beforeyouship https://beforeyouship.dev/api/mcp ​``` **Cursor / other clients** — add a remote server: ​```json { "mcpServers": { "beforeyouship": { "type": "streamable-http", "url": "https://beforeyouship.dev/api/mcp" } } } ​``` Add an `Authorization: Bearer bys_...` header with a Pro key for the full catalog. ## Try it > Estimate the monthly cost of a RAG pipeline at 10,000 requests/day

14 hours ago