Blekline MCP Server
Provides AI ingress governance by masking prompts, classifying risk, and enforcing tool policies before agent calls reach model providers or sandboxes.
README
<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/Blekline/blekline-oss/raw/main/assets/images/blekline-logo-dark.svg" /> <source media="(prefers-color-scheme: light)" srcset="https://github.com/Blekline/blekline-oss/raw/main/assets/images/blekline-logo-light.svg" /> <img alt="Blekline — mark and wordmark" src="https://github.com/Blekline/blekline-oss/raw/main/assets/images/blekline-logo-light.svg" width="46%" /> </picture> </div>
<h3 align="center"> Run secure AI agents and code. <br /> <sub>AI ingress control plane — mask prompts, enforce MCP tool policy, and audit every agent call before models and sandboxes.</sub> </h3>
<p align="center"> <a href="docs/introduction/quick-start.md">Documentation</a> · <a href="https://github.com/Blekline/blekline-oss/issues">Report Bug</a> · <a href="https://github.com/Blekline/blekline-oss/issues">Request Feature</a> · <a href="SECURITY.md">Security</a> · <a href="https://app.blekline.com">app.blekline.com</a> </p>
<p align="center"> <a href="LICENSE"><img src="https://img.shields.io/badge/License-AGPL%20v3-blue.svg" alt="License: AGPL v3" /></a> <a href="LICENSE-APACHE"><img src="https://img.shields.io/badge/Contracts%20%26%20SDK-Apache%202.0-green.svg" alt="Apache-2.0 SDK" /></a> <a href="https://www.npmjs.com/package/@blekline/mcp-server"><img src="https://img.shields.io/npm/v/@blekline/mcp-server?label=npm" alt="npm @blekline/mcp-server" /></a> </p>
Blekline is the ingress governance layer for enterprise AI adoption. Agents in Cursor, Claude Desktop, and Codex call Blekline to redact sensitive data, classify risk, and enforce workspace MCP tool policy before traffic reaches LLM providers or Daytona sandboxes.
The open-source packages in this repository cover local enforcement, MCP tools, SDK clients, and an optional Docker ingress sidecar. The managed control plane at app.blekline.com adds Azure-backed PII masking, fleet policy, investigations, and billing.
Features
| Area | Capabilities |
|---|---|
| Ingress | OpenAI/Anthropic-compatible proxy paths, regional edge sidecar (Helm) |
| MCP | blekline_mask_prompt, blekline_classify_risk, blekline_evaluate_tool_call, blekline_emit_event |
| MCP proxy | Intercept downstream tool calls → allow / mask / block → forward to Daytona or other MCP |
| SDK | TypeScript (@blekline/client) and Python (blekline-client) |
| Local | Secret scan + tool policy in @blekline/contracts (no cloud required for dev) |
| Audit | Metadata-oriented events; client surface labels (cursor, claude-desktop, codex) |
Platform comparison
| Capability | OSS (this repo) | Cloud (app.blekline.com) |
|---|---|---|
| MCP server / proxy | Yes | Yes |
| Local tool enforce | Yes | Yes |
| Azure authoritative PII | — | Yes |
| Workspace fleet policy (SSE) | — | Yes |
| Investigations / billing | — | Yes |
| Browser extension wedge | — | Yes (proprietary) |
Architecture
[ Cursor | Claude Desktop | Codex ]
│ MCP (stdio / SSE)
▼
[ @blekline/mcp-server | @blekline/mcp-proxy ]
│ HTTPS (optional)
▼
[ Blekline control plane — mask · enforce · audit ]
├──────────────► [ Model providers ]
└──────────────► [ Daytona sandbox — approved tools only ]
Details: docs/introduction/architecture.md · Daytona stack
Packages
Runnable packages live under packages/:
| Package | npm / PyPI | License |
|---|---|---|
@blekline/contracts |
(workspace) | Apache-2.0 |
@blekline/client |
@blekline/client |
Apache-2.0 |
blekline-client |
PyPI (optional) | Apache-2.0 |
@blekline/mcp-server |
@blekline/mcp-server |
AGPL-3.0 |
@blekline/mcp-proxy |
@blekline/mcp-proxy |
AGPL-3.0 |
ingress-proxy |
Docker image | AGPL-3.0 |
OpenAPI spec: packages/contracts/openapi.yaml
Client libraries
TypeScript
npm install @blekline/client @blekline/mcp-server
import { BleklineClient } from "@blekline/client";
const blekline = new BleklineClient({
workspaceToken: process.env.BLEKLINE_WORKSPACE_TOKEN!,
metadata: { clientSurface: "sdk" },
});
const { maskedText, decision } = await blekline.mask({
text: "Contact alice@corp.com — key AKIAIOSFODNN7EXAMPLE",
platform: "MyAgent",
});
const tool = await blekline.enforceToolCall({
toolName: "run_shell",
arguments: { cmd: "curl https://api.internal/deploy" },
});
Python
pip install blekline-client
import os
from blekline_client import BleklineClient
client = BleklineClient(workspace_token=os.environ["BLEKLINE_WORKSPACE_TOKEN"])
print(client.mask(text="alice@corp.com")["maskedText"])
MCP (Cursor, Claude, Codex)
npx -y @blekline/mcp-server
Generate example configs:
cp .env.example .env
pnpm install && pnpm build:packages
node scripts/generate-mcp-configs.mjs
See docs/mcp/cursor.md, docs/mcp/claude-desktop.md, docs/mcp/codex.md.
Local-only (no API token)
import { enforceToolCallLocally, scanTextForSecrets } from "@blekline/contracts";
scanTextForSecrets("export AWS_KEY=AKIAIOSFODNN7EXAMPLE");
enforceToolCallLocally({
toolName: "run_shell",
arguments: { cmd: "export AWS_KEY=AKIAIOSFODNN7EXAMPLE" },
requestId: "local-1",
});
Deployments
| Mode | Description |
|---|---|
| Cloud | app.blekline.com — workspace tokens, Azure mask, audit |
| OSS MCP | npx @blekline/mcp-server with BLEKLINE_WORKSPACE_TOKEN |
| Edge sidecar | packages/ingress-proxy Docker + Helm — docs |
| Daytona stack | Proxy → Daytona MCP — docs/integrations/daytona-stack.md |
pnpm build:packages
docker build -t blekline-ingress -f packages/ingress-proxy/Dockerfile .
Quick start
-
Create a workspace API token at app.blekline.com (scopes:
mask:write,events:write). -
Set env:
export BLEKLINE_WORKSPACE_TOKEN=blw_... export BLEKLINE_API_URL=https://app.blekline.com -
Install MCP in Cursor (
.cursor/mcp.json):{ "mcpServers": { "blekline": { "command": "npx", "args": ["-y", "@blekline/mcp-server"], "env": { "BLEKLINE_WORKSPACE_TOKEN": "blw_...", "BLEKLINE_CLIENT_SURFACE": "cursor" } } } } -
In the agent: "Use blekline_mask_prompt on: Contact John at john@acme.com"
REST
curl -s https://app.blekline.com/api/mask \
-H "Content-Type: application/json" \
-H "x-blekline-workspace-token: $BLEKLINE_WORKSPACE_TOKEN" \
-d '{"text":"Contact john@acme.com","platform":"CLI"}'
Development
git clone https://github.com/Blekline/blekline-oss.git
cd blekline-oss
pnpm install
pnpm build:packages
pnpm demo:mcp-smoke
pnpm --filter @blekline/mcp-proxy test
Benchmark local enforce latency:
pnpm demo:latency
Documentation
| Doc | Topic |
|---|---|
| Quick start | Tokens, first mask |
| Architecture | Ingress vs runtime |
| Latency SLO | p99 enforce, fast mask |
| MCP server | Tools reference |
| MCP proxy | Daytona downstream |
| TypeScript SDK | @blekline/client |
| Python SDK | blekline-client |
Contributing
Blekline OSS is open source under AGPL-3.0 (server/proxy) and Apache-2.0 (contracts/SDK). See CONTRIBUTING.md, CODE_OF_CONDUCT.md, and COPYRIGHT.
Note: Blekline OSS uses a multi-license layout. GitHub shows AGPL-3.0 as the repository default (LICENSE). Apache-2.0 components are under LICENSE-APACHE — see NOTICE.
License
| Component | License |
|---|---|
packages/mcp-server, packages/mcp-proxy, packages/ingress-proxy |
GNU AGPL v3 |
packages/contracts, packages/client, packages/client-python |
Apache 2.0 |
Managed SaaS at app.blekline.com is not licensed under this repository.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.