maester-mcp
A reference MCP server that enforces identity-aware tool access using role-based permissions (Reader, Analyst, Auditor) and supports multiple identity routes like Entra RBAC, Copilot Studio, and Okta XAA. It provides read-only access to test evidence with explicit denial paths for unauthorized tools.
README
Access receipt for MCP
A reference lab for enforcing identity-aware tool access in an MCP server.
This is a distilled version of a disposable-tenant lab. The lab question was practical: if an AI agent can reach enterprise security evidence, what proves the caller is allowed to use each tool? The answer here is deliberately plain:
- verify the caller or agent route,
- map identity evidence to local permissions,
- expose only the matching MCP tools,
- test the refusal cases.
This is not a production platform. It is a runnable pattern for access receipts: identity in, scoped tools out, and denial paths that do useful work.
Architecture
identity route -> token / authorization evidence -> verifier -> permissions -> MCP tool tags -> read-only data
The same permission ladder is used for all routes so the interesting variable is the identity plumbing, not the downstream tool contract.
Design constraints:
- the server exposes read-side evidence only,
- no arbitrary SQL tool is published,
- raw evidence is behind
maester.raw, - analysis tools return summary-shaped fields, not raw result payloads,
- Auditor is powerful, not magical; mutation remains denied.
Permission model
| Role | Permissions | Typical tools | Explicit refusals |
|---|---|---|---|
| Reader | maester.read |
whoami, list_runs, get_run_summary |
failed-test analysis, raw detail |
| Analyst | maester.read, maester.analyse |
Reader tools plus get_failed_tests, get_test_history, compare_runs |
raw result detail |
| Auditor | maester.read, maester.analyse, maester.raw |
Analyst tools plus get_result_detail |
mutation, arbitrary SQL |
Negative tests are part of the design, not decoration. If Reader can analyse, Analyst can read raw evidence, or Auditor can mutate tests, the architecture has become a suggestion box.
Routes covered
- Entra RBAC: app roles become local Maester permissions.
- Copilot Studio / Agent ID: the agent route still resolves to backend permissions.
- Okta XAA / ID-JAG: authorization evidence travels to the MCP server and is verified there.
Raw-ish examples
examples/ contains a deliberately small set of sanitised raw lab artefacts. These are the files that help a reader understand the access pattern; the rest of the lab trail was noise with better timestamps.
examples/entra-rbac/
resource-app-create-body.raw.example.json # resource app manifest shape: scopes, app roles, token version
resource-app-current-summary.raw.example.json # resulting resource/service-principal settings
delegated-rbac-setup.raw.example.json # delegated client, consent and role-assignment shape
examples/agent-id/
agent-blueprint-created.raw.example.json # Agent ID / blueprint object shape
connector-oauth-client-created.raw.example.json # OAuth client used by the connector/runtime path
redirect-and-user-role-assignments.raw.example.json
copilot-mcp-connector-created.raw.example.json # Copilot Studio MCP connector shape
examples/okta-xaa/
custom-as-idjag-contract.raw.example.json # authorization-server and ID-JAG contract shape
role-matrix-passed.raw.example.json # Reader / Analyst / Auditor validation result
runtime-real-idjag-reader-smoke.raw.example.json
The examples are not copy-paste deployment recipes. They are shape references: what objects existed, which fields mattered, and where authorization evidence showed up.
Run locally
python -m venv .venv
. .venv/bin/activate
pip install -e '.[dev]'
maester-ingest --source data/source --db data/maester.duckdb
python -m pytest tests -q
python scripts/duckdb/verify_demo.py
Start the MCP server with auth disabled:
MAESTER_MCP_AUTH_PROFILE=none maester-mcp
Or with synthetic local demo tokens:
MAESTER_MCP_AUTH_PROFILE=synthetic maester-mcp
# reader-token, analyst-token, auditor-token are local examples only
Sanitisation
The included data is a sanitised Maester-shaped demo set. The original private seed database is not included. data/maester.duckdb is generated locally from data/source/ and ignored by git.
The sanitisation pass replaces organisation names, user-like values, GUIDs, email-shaped values, local paths and policy names with deterministic demo values. Run the verification gate:
python scripts/duckdb/verify_demo.py
Publishing rule: configuration shape is useful; raw tenant history is not.
What is intentionally absent
- no live tenant credentials,
- no private keys,
- no production evidence,
- no arbitrary SQL tool,
- no write-side Maester controls,
- no historical lab logs, agent transcripts, deployment state, BOX notes or tenant-specific handoffs.
The useful part is the boundary, not the plumbing souvenirs.
Repository map
src/maester_mcp/ FastMCP server, auth verifiers, read-only DuckDB access
tests/ permission, transport, ingestion and denial tests
sql/ schema, views and verification SQL for demo evidence
data/source/ sanitised Maester-shaped source JSON
data/maester.duckdb generated local demo database, ignored by git
examples/ sanitised raw-ish config and lab artefact shapes
Related notes and videos
- Project note: https://iam.felixelliott.com/posts/mcp-reference-architecture/
- Intro: https://youtu.be/mSMquGtJ2Tk
- Entra RBAC: https://youtu.be/8XjDbdLgbRw
- Agent ID: https://youtu.be/vh8lkvPZx0k
- Okta XAA: https://youtu.be/Z7I1Y72CXOc
- Code walkthrough: https://youtu.be/IWNy2_jZ0VQ
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。