
Altr Mcp Server
io.github.altrsoftware由 GitHub 帳號 altrsoftware 發布v0.9.0更新於 Nov 3, 2026
用於ALTR資料安全的MCP伺服器:資料庫、標籤、策略、分類、存取、審計
AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。
原文描述
MCP server for ALTR data security: databases, tags, policies, classification, access, audits
概覽
Altr 的本機 MCP 服務;無需登入;STDIO。
暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Altr Mcp Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
ALTR MCP Server
[PyPI] [Python] [License: GPL v3] [CI] [Security]
ALTR provides tag-based data masking, access governance, and classification for Snowflake, Databricks, and OLTP databases. This MCP server enables AI assistants (Claude, Cursor, and other MCP clients) to manage data security on the ALTR platform, covering database connections, tag masking, policies, classification, access management, audits, telemetry, and sidecar configuration.
New to ALTR? See the ALTR documentation for an overview of the platform, concepts, and supported data sources.
All tools return structured {success, data, error} responses and can run over stdio, SSE, or streamable-http transports.
Table of Contents
- Quick Start
- Getting Credentials
- Configuration
- Setup
- CLI
- Tools
- Data Source Support
- Troubleshooting
- Development
- License
Quick Start
-
Install from PyPI:
Or run directly with uvx (no install required):
uvxis part of the uv Python package manager. Install it withpip install uvor see the uv installation guide. -
Set the three required environment variables (see Getting Credentials for where to find each in the ALTR console):
-
Wire it into your AI client — see Setup for Claude Desktop, Claude Code, Cursor, VS Code, and Windsurf. The same three env vars go into the client's
envblock. -
Verify by asking your AI assistant to run a read-only tool:
- "List my ALTR databases" → calls
get_databases - "Show me the tags connected to ALTR" → calls
get_tags - "List the ALTR roles in my org" → calls
get_roles
If these return data, your setup is working.
- "List my ALTR databases" → calls
Getting Credentials
You need three values from the ALTR platform to configure this server. See Manage API keys for the full reference.
Configuration
Set the following environment variables before starting the server:
MAX_RETRIES counts total attempts, not retries on top of the first, so 1
disables retrying without disabling the retry path. Backoff is exponential with
jitter; a Retry-After response header overrides it, clamped to
MAX_RETRY_AFTER so a server cannot park a call indefinitely.
What gets logged
Every tool call is logged to stderr at INFO with its arguments, which is what
makes a session traceable. An argument is redacted when its value is a
credential or user-supplied free text — values, text, comment,
comments, attestation, justification, statement_text_contains,
filters, filter_tree, content, content_base64, connection_string,
connection_properties, the bare credential names (password, secret,
credentials, passphrase, private_key, api_key, auth_token,
access_key), and anything ending _password, _secret, _credential,
_credentials, _private_key or _passphrase. Identifiers, enums and
pagination cursors are logged in full.
An argument can also reach a log by travelling in a request URL, which
redaction keyed on argument names cannot see. httpx's per-request line is
therefore held at WARNING, so it does not appear at the default INFO.
Dictionary keys survive, so a line reads
values={'ssn': '<redacted>', 'email': '<redacted>'}: you keep which fields
were sent and lose the data. Tokens are not redacted — a token exists to be
handled freely, and ALTR's own Shield audit log is keyed by token.
Redaction covers the invocation line, tracebacks, and the argument-coercion error returned to the caller.
LOG_FORMAT applies to dependency output as well as this server's own — under
json, every line on the stream is a JSON object, and dependency lines carry
the correlation_id of the tool call they occurred inside. See
Logging.
Upgrading from 0.6.0 or earlier? Arguments were not redacted before 0.7.0. Treat any credential passed as a tool argument as exposed in your logs and rotate it — in practice
database_passwordandconnection_string. Those logs may also hold plaintext passed to the tokenize tools, so review who can read them and how long they are kept. Log output also changed shape; see the 0.7.0 entry in the CHANGELOG.
Endpoint overrides
Every ALTR service endpoint can be pointed elsewhere, which is useful against a non-production ALTR environment. All are optional — leave them unset in normal use.
The eight per-service endpoints are derived from your ORG_ID as
https://<ORG_ID>.<service>.live.altr.com, five of them with a path appended
(a version, or /v1/dam-alerting). An override replaces the whole value, so it
must include that path where the default has one — see the table.
Restricting Tools
Use RESTRICTED_TOOLS to hide specific tools from MCP clients. Restricted tools are removed from the tool list and blocked if called directly.
Names must match the registered tool name exactly. An entry that matches nothing restricts nothing, and is logged as a warning the first time a client lists tools. Note that 11 tools were renamed from delete_* to disconnect_* in 0.4.0.
For example, to give a team read-only access without any destructive operations:
Or in the Claude Desktop config:
This is an operator-level safety net — it prevents accidental or unwanted tool usage but is not a substitute for proper API key permissions.
Running over HTTP
With the default stdio transport, your AI client starts the server as its own subprocess, so nothing else can reach it. With MCP_TRANSPORT=sse or streamable-http, the server listens on a port, and every tool call runs with your organization's API key. So:
- The default address is loopback.
MCP_HOSTdefaults to127.0.0.1, so only clients on the same machine can connect, and no token is needed. Without a token, the server also rejects any request whoseHostorOriginheader is not a loopback name (localhost,127.0.0.1or[::1]), so a web page open in a local browser cannot use it. Pages served from this machine are trusted, whatever their port, so local tools such as the MCP Inspector keep working. - Any other address needs a token. To accept connections from other machines, set
MCP_HOST(for example0.0.0.0) andMCP_AUTH_TOKEN. The server refuses to start with a non-loopbackMCP_HOSTand no token. Clients send the token asAuthorization: Bearer <token>, and a request without it gets401. The token may contain only letters, digits and-._~+/, with=only at the end. A reverse proxy on the same machine should also use a token, since it sends its ownHostheader. - Use TLS. The server speaks plain HTTP, and a bearer token sent in the clear can be read on the network. Put it behind a reverse proxy or gateway that terminates TLS.
- Or let a gateway authenticate. If a gateway in front of the server checks every request itself, for example with your identity provider, set
MCP_ALLOW_UNAUTHENTICATED=trueinstead of a token. This also turns off theHostandOrigincheck on a loopback address, so a gateway on the same machine that passes those headers through keeps working. The server logs a warning at startup, since it then accepts any request that reaches it.
Generate a token with:
For example, in a container that a gateway reaches over the network:
The token is a shared secret: anyone who has it can call every tool the server exposes. Treat it like the API key, and combine it with RESTRICTED_TOOLS to limit what a client can do.
Setup
Claude Desktop
Add the following to your claude_desktop_config.json (Settings > Developer > Edit Config):
Claude Code (CLI)
This writes the config to .mcp.json which can be committed to share with your team.
Cursor
Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-scoped):
VS Code (GitHub Copilot)
Open User Settings JSON (Ctrl+Shift+P → "Preferences: Open User Settings (JSON)") and add:
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
Running from Local Source
To run from a local clone instead of the published PyPI package:
Claude Code:
Claude Desktop:
CLI (Optional)
This section is for building a standalone CLI binary from the MCP server. If you just want to use the server with Claude Desktop or Claude Code, skip to Tools.
A standalone CLI lets you call ALTR tools directly from the terminal without an MCP client. It's built with mcporter, an open-source tool that compiles MCP servers into native CLI binaries. See the mcporter docs for the full set of options.
Prerequisites
mcporter itself does not need to be installed separately — npx downloads and runs it on demand.
Building
From the repo root:
This generates a compiled binary at ./altr-cli.
Usage
Set your credentials as environment variables, then run any tool:
The CLI runs the MCP server locally via uv run and requires the repo to be present at the working directory. All environment variables from the Configuration section apply.
Tools
For a full breakdown of every tool with parameters, behavior, and examples, see docs/index.md.
Critical callouts
A few things are easy to miss and worth surfacing here:
Snowflake tags vs Databricks tags. A Snowflake tag is a first-class ALTR object — you register it with connect_tag, it gets a tag_group_id, and shows up in get_tags, get_tag_details*, update_tag, and disconnect_tag*. A Databricks tag is the opposite: not an ALTR object at all, just a raw string you pass into create_policy (with policy_type="PUSHDOWN" and database_ids=[…]). Databricks tags never appear in get_tags and do not have a tag_group_id. None of the Tags tools apply to Databricks.
Databricks create_policy requirements. When creating a masking policy for a Databricks metastore, you must pass database_ids as a list — even for a single database (e.g. database_ids=[2167]) — and set policy_type="PUSHDOWN". Omitting database_ids or using policy_type="TAG" will be rejected by the API. Snowflake policies do the opposite: omit database_ids and let policy_type default to TAG.
Data Source Support
Platform setup guides on the ALTR docs site:
- Snowflake
- OLTP databases (PostgreSQL, MySQL, Oracle, SQL Server)
- Databricks
Legend: ✅ Supported ⚠️ Partial ❌ Not supported — Not applicable
Classification processing locations: every scan runs a collection of classifiers, and where it runs depends on the source, as in the console.
Google DLP and Amazon Comprehend conditions in a collection run with ALTR's own services on ALTR Hosted scans, and with the agent's own Google Cloud and AWS credentials on agent scans; In-Warehouse scans skip Google DLP, Content Type and Amazon Comprehend conditions. An agent scan fails at start if the agent isn't configured for a kind its collection has.
Access management policies (Databricks): This MCP server does not currently expose Databricks grant or access management APIs. For Databricks access control, use the Databricks UI or REST API directly.
OLTP refers to relational databases (PostgreSQL, MySQL, Oracle, SQL Server) accessed through a customer-managed ALTR sidecar proxy.
Troubleshooting
Checking which version you are running
This works without credentials. Your AI client also reports the same version as the server version when it connects, which is the quickest way to confirm the client actually picked up an upgrade.
uvx: command not found
Install uv: pip install uv or via the official installer.
Server not appearing in your AI client
Restart your AI client after editing the config file — changes are not picked up automatically.
ERROR: Missing required environment variables
Verify ORG_ID, MAPI_KEY, and MAPI_SECRET are set in the env block of your client config. Variable names are case-sensitive.
Tools returning {"success": false, ...}
A tool is missing from the tool list
Check whether the tool name appears in the RESTRICTED_TOOLS env var in your client config. Restricted tools are hidden from the tool list entirely.
A restricted tool is still exposed
RESTRICTED_TOOLS matches names exactly, so a misspelled or renamed entry restricts nothing. Check the server log for tool_restriction_middleware.unknown_tools, which names any entry that matched no registered tool.
Timeouts on large result sets
Use pagination parameters (limit, offset, or cursor) available on audit, telemetry, and classification tools to reduce response size.
Development
Running Tests
Project Structure
Learn More
Platform setup
- ALTR documentation home
- Snowflake data source
- OLTP data source
- Databricks data source
- Manage API keys
Data access controls
- Tag-based access policy — Snowflake and Databricks
- Column-based access policy — Snowflake
- Masking policies (10000–10009 types)
- Access management policy & Managing Access Requests
Discovery and observability
Protocol
License
Copyright (C) 2026 ALTR Solutions, Inc.
GNU General Public License v3.0 or later (GPL-3.0-or-later). See
LICENSE.md for the copyright notice and the full license text.
來源:README.md,提交 ad997bc
工具
0版本歷史
4- v0.9.0最新Nov 3, 2026
- v0.8.0Oct 26, 2026
- v0.7.1Oct 9, 2026
- v0.6.0Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。