Backlot

io.github.brekkylab由 GitHub 帳號 brekkylab 發布v0.1.0更新於 Oct 30, 2026

Local emulator for Slack, Gmail, Drive, GitHub, Jira, Notion, S3 and more, with per-document ACLs

概覽

AI 產生的概覽

Backlot 是本地企業 SaaS API 模擬器(Slack、Gmail、Drive、GitHub、Jira、Notion、S3 等),透過 stdio 以 MCP 工具形式提供給助理使用。

可以做什麼
  • 在單一本機程序中提供 Slack、Teams、Gmail、Drive、GitHub、Jira、Confluence、Notion、Linear、HubSpot、Fireflies 與 S3 的模擬 API
  • 讀寫確定性語料庫中的模擬紀錄,支援依文件的存取控制與依使用者的權杖
  • 以指定使用者身分回應,讓助理只看到該呼叫者有權檢視的內容
  • 若沒有執行中的服務則自動啟動,也可讓廠商自帶的 MCP 伺服器指向它
  • 匯入自訂 JSONL 語料庫並依各服務的 schema 驗證
適用情境
適合在不需要廠商帳號、OAuth 核准或網路連線的情況下,針對廠商形態的 API 行為建置、測試或評估整合、RAG 流程或代理,並需要在本機與 CI 之間維持穩定的 ID 與依 ACL 過濾的檢視。
執行需求
以 stdio 在本機執行,透過 uvx 或 pip 從 PyPI 安裝(MCP 伺服器需要 MCP 附加元件)。不需要廠商帳號、OAuth 或 API 金鑰,Backlot 會自行產生使用者與權杖。HTTP API 會佔用本機連接埠。
安裝前請注意
它模擬 API 而非呼叫真實服務,且只實作文件列出的部分端點。部分廠商支援寫入 API,助理可能改動模擬語料庫,另有端點可將其還原。預設會蒐集使用遙測資料,可在設定中關閉。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Backlot,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Backlot

[GitHub stars] [python] [PyPI] [tests] [License: Apache 2.0]

[Discord] [X]

Run enterprise SaaS APIs locally.

Backlot is a local emulator for Slack, Gmail, Google Drive, GitHub, Jira, Notion, S3 and other enterprise APIs. It reproduces the response shapes, pagination, authentication, errors and per-document access controls an integration has to handle, over a deterministic corpus you control — so you build and test against the official vendor SDKs with no vendor account, no OAuth approval, no secrets in CI and no network.

[Connecting Slack to an app, two ways, side by side. On the left, the real Slack API: create a workspace, register an app, add a bot user, pick OAuth scopes, register a redirect URL, install to the workspace — then wait on an admin to approve it, with still zero API calls made. On the right, Backlot: pip install, backlot serve, and one changed base URL, after which a conversations.history response comes back with the same fields, pagination and per-document ACLs. A day gone, against seconds.]

Try it in 60 seconds

bash
pip install backlotbacklot import --bundled   # a corpus ships with the package; nothing to fetch or writebacklot serve              # every supported API, at http://127.0.0.1:8000

Point an official SDK at it by changing one base URL:

python
from slack_sdk import WebClient  # pip install slack_sdk
slack = WebClient(token="admin-service-token", base_url="http://127.0.0.1:8000/slack/api/")print(slack.conversations_list()["channels"])

The same call targets Slack in production and Backlot in development. Backlot supplies the data and the credentials; your code keeps the vendor's request and response contract.

A test can run its own server instead, on a free port, with nothing to start or clean up:

python
import backlotfrom slack_sdk import WebClient
with backlot.serve() as s:  # no arguments: a tiny hello-world corpus    slack = WebClient(token=s.token, base_url=f"{s.base_url}/slack/api/")    channels = slack.conversations_list()["channels"]

Let your coding agent run Backlot instantly

This repo is its own plugin marketplace, so the agent skill installs with no clone and no pip install first. Or hand the agent every source as MCP tools: backlot mcp starts a server if none is running and serves them all over stdio, with --user <email> answering as that person.

bash
claude plugin marketplace add brekkylab/backlot && claude plugin install backlot@brekkylabcodex plugin marketplace add brekkylab/backlot && codex plugin add backlot@brekkylabpip install "backlot[mcp]" && claude mcp add backlot -- backlot mcp   # every source as MCP tools

and prompt like this:

Mock our Slack workspace with three messages in an #incidents channel, get a server running, then show me what conversations.history actually returns for that channel.

Why not use mocks?

A hand-written mock returns the response your code already expects. Backlot implements the other side of the integration, so it exposes the assumptions a mock would repeat — it is for when the behavior of the API, not just the contents of one response, is what you need to test.

❌ Hand-written mocks✅ Backlot
Test-specific response dictionariesVendor-shaped responses served over HTTP
Usually cover the happy pathPagination, validation, auth and vendor-shaped errors
Custom test helpersOfficial vendor SDKs and ordinary HTTP clients
Little or no identity modelGenerated users, tokens, groups and document ACLs
Fixtures drift between testsOne deterministic corpus, shared locally and in CI
Each API mocked differentlyEvery API served from one process

What it serves

Every source on one local port, each behind the path prefix its own SDK expects, all reading one SQLite corpus.

The corpus defines the facts: messages, files, issues, authors, timestamps, threads, comments, labels, readers. Backlot derives stable ids, users, groups and tokens from them, so every run serves the same records, the same ACL-filtered views and the same pages.

It emulates the documented subset of each API it supports, not every vendor endpoint. The endpoint-by-endpoint matrix says which, and an implemented endpoint that diverges from the real API is a bug.

[Your code on the left, calling the Slack and GitHub SDKs with only their base URL changed. In the middle, one local server on 127.0.0.1:8000, listing the services it answers as and the path prefix each is served under. On the right, the single SQLite corpus behind all of them.]

ServiceBase pathExample, on the official SDK
Slack/slack/apislack.py
Microsoft Teams/msgraph/v1.0msteams.py
Gmail/gmail/v1gmail.py
Google Drive (Docs, Sheets, Slides)/drive/v3 /docs/v1 /sheets/v4 /slides/v1gdrive.py
GitHub/githubgithub.py
Jira/atlassian/rest/apijira.py
Confluence/atlassian/wiki/rest/apiconfluence.py
Notion/notion/v1notion.py
Linear/linear/graphqllinear/
HubSpot/hubspothubspot.py
Fireflies/fireflies/graphqlfireflies.py
Amazon S3/s3s3.py

The roadmap lives in the tracking issue — ask there for the source you need.

When you need this

  • 🔌 Building or upgrading an integration. The cursors, page shapes and error bodies the real API returns, without an account to get them from.
  • 🧪 Testing it, and keeping it tested. One fixture on your laptop and in CI, with no secrets and nothing to flake. Every user in the corpus gets a token, so you can also assert that one caller's documents never reach another.
  • 🤖 Evaluating a RAG pipeline or an agent. The same corpus, the same ids and the same answers on every run, so a score that moves means your code moved. Backlot supports write APIs for some vendors, so an agent that acts rather than only reads can be run here and graded on what it actually did — one endpoint reports it, another puts the corpus back for the next run (docs/write-overlay.md).
  • 🐛 Reproducing a bug in data you can't see. A document inside someone else's workspace breaks your parser. Write one shaped like it, serve it, and keep the failing test.

Bring your own corpus

The bundled corpus covers every supported service, but the main workflow is to serve your own test world: a JSONL file, one source document per line.

jsonl
{"source_type":"slack","channel":"incidents","author_email":"[email protected]","created":"2026-02-10T18:00:00Z","content":"Anyone seeing 502s from the gateway?","replies":[{"content":"Looking now.","author_email":"[email protected]","created":"2026-02-10T18:00:40Z"}]}
bash
backlot import my-corpus.jsonl --dry-run   # validate against each service's schema, touch nothingbacklot import my-corpus.jsonl && backlot serve

Every imported identity gets deterministic credentials, listed at GET /_meta/users; send the same request with another user's token to test what that caller is allowed to see. Preparing a corpus covers schemas, rosters, sharded corpora and public datasets, and Auth and tokens covers each service's authentication style.

Examples

Point this at itRunnable
📦 Official vendor SDKs, one script per serviceexamples/using-official-sdk/
🔗 MCP tools for an agent: backlot mcp, or a vendor's own MCP server pointed at Backlotexamples/using-mcp-with-agents/
🦙 Load it as documents, with the official LlamaIndex readersexamples/using-llamaindex-readers/
🐍 Read it with pandas, pyarrow or dask, over an fsspec filesystemexamples/using-fsspec/
🗂️ Read it with ls, cat and grep, over mirage's virtual filesystemexamples/using-mirage/
📥 Your own corpus, from a JSONL fileexamples/bring-your-own-corpus/

Documentation

Every source Backlot serves, and every endpoint of eachdocs/supported-sources.md
Building a corpus, and public datasetsdocs/corpus.md
Auth schemes and tokensdocs/auth.md
Measuring Backlot against the real APIsdocs/fidelity.md
Writes, and where they godocs/write-overlay.md
Every BACKLOT_* setting, and Dockerdocs/configuration.md
Usage telemetry: why it is collected, what is sent, and how to turn it offdocs/telemetry.md
Notices and trademarksNOTICE.md

Contributing

See CONTRIBUTING.md. Fidelity to the real APIs is the point, so a divergence is a bug — measure against the real service, and bring a test that fails without your fix.

Backlot exists thanks to all the people who contribute.

[Avatars of Backlot's contributors]

License

Apache-2.0. NOTICE.md has the MIT License earlier releases were under.

來源:README.md,提交 5d06ed0

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

1
  1. v0.1.0最新Oct 23, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分