orgintel

orgintel

Analyzes Salesforce permission architecture (profiles, permission sets, groups) to support RBAC remediation. It snapshots the permission model into DuckDB and provides tools for diffs, sensitive access detection, and verified decomposition proposals.

Category
访问服务器

README

orgintel

An MCP server that analyzes Salesforce permission architecture — profiles, permission sets, and permission set groups — to support RBAC remediation. It reads an org, snapshots the permission model into a local DuckDB store, and answers questions about it. Phases 1–4 (acquisition, analysis core, eval harness, agent).

Two hard guarantees, both enforced as mechanism rather than policy:

  • Read-only. orgintel never issues an insert, update, delete, or metadata deploy against any org. Enforced by a transport-layer route allowlist (see clients/transport.py); a non-allowlisted request raises before it is sent.
  • No personal identifiers persisted. The users table has no name, username, or email column — the columns do not exist. soql_query masks identifier columns in its results. See DESIGN-P1.md §2.7.

Why it's built this way

A mid-size org has ~850k FieldPermissions rows — a raw dump is ~20M tokens, ~100× a context window. The model never sees raw API output. Every tool returns an aggregate, a diff, or a bounded slice; the join happens in DuckDB. Every response carries a budget that discloses truncation and how to narrow.

Setup

Requires uv and the Salesforce CLI (sf).

uv sync
uv run pytest        # 51 tests, no org needed

Auth (Phase 1: SFDX token reuse)

orgintel reads the access token from an org you've already authenticated with the Salesforce CLI — zero extra setup. JWT bearer flow is a planned seam, not yet built.

sf org login web --alias my-org      # once
sf org list                          # confirm it's Connected

The subprocess argv is fixed and its output (which contains a live token) is never logged.

Tools

Tool What it returns
snapshot_org(org_alias, scope?) Bulk-fetches the permission model into DuckDB. Returns summary stats only — counts, timing, snapshot_id.
list_snapshots() Available snapshots, newest first.
list_profiles(snapshot_id) Profiles by user count: license, perm cardinality, ModifyAllData flag, unassigned count.
describe_object(org_alias, api_name) Live field list with a sensitivity_guess flag (SSN/DOB/account-number/… from config), sensitive fields first.
permission_diff(snapshot_id, principal_a, principal_b) Symmetric difference of two principals. Differing fields grouped by (a_perm, b_perm) signature. The workhorse.
soql_query(org_alias, query, max_rows=200) Read-only SOQL. SELECT-only parser guard, row cap, identifier columns redacted.
find_sensitive_access(snapshot_id) (P2) Every principal granting read/edit on a name-matched sensitive field, with affected user counts resolved through effective permissions. Recall-first.
verify_decomposition(snapshot_id, proposal) (P2) Formal check that a proposed base-profile + permission-set/group refactor leaves every user's effective permissions unchanged. Returns per-user added/removed grants; an uncovered user fails.
propose_decomposition(snapshot_id, threshold?, target_base_count?) (P4) Computes a thin-base + permission-set decomposition (deterministic) and runs it through verify_decomposition before returning. If it doesn't preserve every user's access, you get the failure, not the proposal. Returns placeholder keys + member names + shared grants for the model to name.

scope defaults to all tables. Apex in SetupEntityAccess is excluded by default (84% of that table, ~noise for RBAC); pass "setup_entity_access:apex" to include it.

Two P2 functions — effective_permissions (union across profile + permission sets + PSG components, minus muting) and cluster_profiles (Jaccard clustering of profiles) — are internal building blocks, not yet exposed as tools. verify_decomposition is the crown jewel: permission-refactor correctness is formally checkable, so "did the refactor preserve access" is a boolean, not a judgement call — and propose_decomposition is gated by it, so an unverifiable proposal is never returned.

Agent (P4)

agent/ is an MCP client that drives these tools via the Anthropic API (claude-opus-5). The division of labor is the whole point: the tools compute and verify; the model orchestrates, names, and judges. propose_decomposition returns a verified structure with placeholder names; the model names each base in the customer's vocabulary and writes the rationale. The model also judges whether an unmatched field name looks sensitive (mbr_num__c, dob_enc__c) — the gap P3 measured as evasive recall.

uv sync --extra agent
orgintel-agent "snapshot appfoliosteph, then propose a decomposition"   # billable

The model call sits behind an LLM protocol, so the loop, tool bridge, and judge are all tested with a scripted fake — no API key, no billing. Only orgintel-agent makes real calls. uv run python -m evals.agent_delta measures the evasive-recall lift the judge buys (0.0 → 1.0 with the offline stand-in; detectable recall held at 1.0).

Register with Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "orgintel": {
      "command": "uv",
      "args": ["run", "orgintel"],
      "cwd": "/Users/shaumikpathak/Downloads/MCP Salesforce"
    }
  }
}

Then in Claude: "Snapshot my-org, then show me the profiles with the most users, then diff the top two."

Eval harness (P3)

The highest-signal artifact in the project: a scoreboard for the deterministic analysis core, built before the agent so it develops against numbers, not vibes.

uv run python -m evals.run      # writes evals/REPORT.md + a run to evals/history/

fixtures/generate.py synthesizes org snapshots with planted ground truth (deterministic given a seed): latent roles, redundant pairs that should collapse, adversarial "do not consolidate" cases, and sensitive fields — some pattern-detectable, some named to evade (mbr_num__c, dob_enc__c). The harness scores cluster purity, sensitive-field recall (detectable target 1.0; evasive recall is the gap the P4 model must close, measured explicitly), and privilege preservation (verify_decomposition must certify a ground-truth decomposition and catch a broken one). Each run diffs against the previous, so a prompt or pattern change that drops recall shows up immediately.

Snapshot store

One DuckDB file, default ~/.orgintel/snapshots.db, override with ORGINTEL_DB. Set it per client engagement to keep each org's data in its own file. A snapshot holds principal/object/field metadata and pseudonymous user ids — re-identification requires authenticated access to the source org. Snapshot files are git-ignored.

Layout

src/orgintel/
  clients/     thin async SF wrappers (REST, Bulk 2.0, SFDX auth) — no DB, guarded transport
  store/       DuckDB schema (SQL migrations), ingest, queries, snapshot loader — no network
  analysis/    pure functions: diff, effective perms, clustering, sensitivity, verify, propose — no I/O
  agent/       MCP client + Anthropic-backed model (LLM protocol), tool loop, field judge
  config/      sensitivity.yaml (patterns + setup-entity scope)
  snapshot.py  the acquisition coordinator (auth -> fetch -> ingest)
  server.py    nine FastMCP tools — thin
fixtures/      deterministic synthetic orgs with planted ground truth (P3)
evals/         scoreboard: run.py (deterministic core) + agent_delta.py (P4 model lift)

See DESIGN-P1.md for the schema rationale and CLAUDE.md for conventions.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选