
mcp-architector
io.github.theSharque由 GitHub 帳號 theSharque 發布v1.11.1更新於 Oct 24, 2026
MCP server for architecture and system design. Store and manage project architecture locally.
概覽
本地優先的 MCP 伺服器,讓助理在私有本機儲存中記錄並查詢專案架構、模組、資料流與事實條目。
- 可以做什麼
- 建立、讀取與更新專案架構:模組、描述、輸入輸出、相依關係以及模組間的資料流。
- 儲存、搜尋、列出與刪除單筆事實(條目),例如介面、實體、詞彙表與腳本,並支援批次寫入。
- 依類別讀取這些事實的篩選檢視(切片),例如所有 API 或所有持久化項目,並可儲存自訂篩選切片。
- 驗證已儲存的模型、重建資料流圖與條目索引、修復損毀的目錄檔案,並在重構後預覽或套用路徑與名稱同步。
- 將架構與模組資料以 MCP 資源形式提供存取。
- 適用情境
- 適合讓助理跨工作階段建立並維護一份結構化、可長期保存的程式庫架構圖,或在不重讀整個儲存庫的情況下查找某個介面、實體或模組的位置。由於資料全部留在本機,也適合重視隱私的本地專案。
- 執行需求
- 以本機 stdio 程序執行,從 npm 安裝(全域或透過 npx),需要 Node.js。需加入 MCP 用戶端設定(Claude Desktop、Cursor、Continue.dev)。資料寫入使用者家目錄下依專案劃分的資料夾;除 list-projects 外,每個工具都必須明確傳入專案 ID。選用的 MCP_PROJECT_ID 環境變數僅作為清單提示。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 mcp-architector,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
MCP Architector
Model Context Protocol (MCP) server for architecture and system design
Local-first MCP server that stores and manages project architecture information. All data is stored locally in ~/.mcp-architector for maximum privacy and confidentiality.
📦 Install: npm install -g mcp-architector or use via npx
🌐 npm: https://www.npmjs.com/package/mcp-architector
🔗 GitHub: https://github.com/theSharque/mcp-architect
How to connect to Claude Desktop / IDE
Add the server to your MCP config. Example for claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
For Cursor IDE: Settings → Features → Model Context Protocol → Edit Config, then add the same block inside mcpServers. See the Integration section for more options.
Cursor rule (recommended)
For Cursor IDE and Cursor Cloud Agents, use a phased onboarding rule so the agent does not dump the whole repo into context in one shot.
-
Copy
.cursor/rules/architector-onboarding.mdcinto your project (the repo you are documenting): -
Ensure MCP Architector is connected. The agent must call
list-projectsand passprojectIdon every write — do not rely on omitting it. -
Ask in chat, for example: "Onboard this repo into architector — phase 0 plan first" or "Import architecture module by module".
The rule is alwaysApply: false — Cursor attaches it when the task matches architecture import/onboarding. It enforces: structure → one module per step → validate after each step → compact tools only.
If you develop this server repo, keep the same file here so contributors and Cloud Agents follow the same workflow when updating ~/.mcp-architector/_qs_mcp-architector/.
Overview
Store and manage project architecture, modules, scripts, data flow, and usage examples - all locally with complete privacy.
Features
- Local Storage: All data stored in
~/.mcp-architector(privacy-first) - Project Architecture: Store and retrieve overall project architecture
- Module Details: Detailed information about each module
- Resources: Access architecture data via resources
Storage Structure
Data model
Anti-patterns (no duplication): Do not copy module.description into entry.summary. Link with refs.moduleName. Slices never store item copies—only filters in slices/*.json.
Do not edit ~/.mcp-architector directly — always use MCP tools so timestamps, merge semantics, and dataFlow inverse sync stay consistent.
Agent workflow
list-projects— findprojectIdfor this workspace (query by folder name). Pass it to every other tool. Never omit. Never usedefault-project.- Structure task →
get-project-architecture/set-project-architecture. - Each module →
set-module-detailswithfiles+facts[](endpoints, entities, glossary) in the same call, orset-entries/set-entrywithrefs.moduleName. - Single module graph edge →
set-module-data-flow. - Bulk rebuild flow (many modules) →
rebuild-data-flow. - After edits, verify everything →
validate(summary +issues[]; no full project load). - Need a category (all APIs, all domain terms) →
list-slices→get-slicewithformat=compactortable; useoffsetwhenhasMoreis true. - Find by name →
search-entries→get-entryfor full payload. - After code refactor (same modules) →
refactor-architecture:scan→ dryRun preview → apply withconfirm=true.
Full project picture: modules alone do not populate slices — without http-endpoint (and other kinds) entries, slice api stays empty. New module → add facts or entries in the same step.
Example: set-module-details with facts: [{ kind: "http-endpoint", title: "POST /orders", ... }], then get-slice sliceId=api format=table.
Quick Start
For Users (using npm package)
For Developers
- Clone the repository:
- Install dependencies:
- Build the project:
Usage
Development Mode
Run with hot reload:
Production Mode
Start the server:
MCP Inspector
Debug and test your server with the MCP Inspector:
Integration
Cursor IDE
- Open Cursor Settings → Features → Model Context Protocol
- Click "Edit Config" button
- Add one of the configurations below
Option 1: Via npm (Recommended)
Installs from npm registry automatically:
Option 2: Via npm link (Development)
For local development with live changes:
Requires: cd /path/to/mcp-architector && npm link -g
Option 3: Direct path
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Continue.dev
Edit .continue/config.json:
Using Project ID
projectId is required on every tool except list-projects. There is no default dump project.
- Call
list-projectsfirst (optionally withquery= workspace folder name) - Pass the matching
projectIdto every other tool - If none matches, create one with
set-project-architectureusing a stable id from the workspace path (e.g._qs_my-app)
MCP_PROJECT_ID is only a hint (isCurrent / suggestedProjectId). It is not used as a silent write target. default-project and unsubstituted ${workspaceFolder} ids are forbidden.
Tools
set-project-architecture
Creates or updates the overall architecture for a project. By default merges modules and dataFlow by name; omit dataFlow to preserve existing flow. dependsOn is canonical; providesTo is recomputed on save.
Input:
projectId(required): Project ID fromlist-projects. Never omit.default-projectis forbidden.description: Overall project descriptionmodules: Array of module objects with:name: Module namedescription: Brief description of the moduleinputs(optional): What this module requires to workoutputs(optional): What this module produces or generates
dataFlow(optional): Object describing data flow between modules (omit to keep existing):- Key: module name
- Value: object with:
dependsOn(optional): Array of module names this module depends onprovidesTo(optional): Derived on save from alldependsOnedgesdataTransformation(optional): How data is transformed between modules
replaceModules(optional): Replace entire modules list (defaultfalse= merge by name)replaceDataFlow(optional): Replace entire dataFlow (defaultfalse= merge by module name)
Output:
- Project ID and success message
get-project-architecture
Retrieves the overall architecture of the project.
Input:
projectId(required): Project ID fromlist-projects. Never omit.default-projectis forbidden.
Output:
- Complete project architecture
list-projects
Lists all projects in local storage (~/.mcp-architector). Call this first. Match the current workspace by folder name, then pass projectId to every other tool.
Input:
query(optional): Filter by substring in projectId or description (case-insensitive)
Output:
projects[]:projectId,description,moduleCount,updatedAt,isCurrent(hint fromMCP_PROJECT_ID),forbidden(default-projectand unsubstituted workspaceFolder dumps)suggestedProjectId: currentMCP_PROJECT_IDwhen it is a valid id, elsenullreminder: always passprojectId; never usedefault-project
Entries and slices
Built-in sliceId values: api, persistence, events, domain, flows, integrations, config, runtime, decisions, scripts.
search-entries
Compact navigation search—returns enough context to pick a hit, then call get-entry for full payload.
Input: query (required), moduleName, kind, tags, limit (default 10, max 50), offset (default 0)
Output: summary, total, returned, offset, hasMore, results[] with snippet, matchedIn, slices, moduleName plus legacy summary, tags, refs
Recommended kind examples (any string allowed):
set-module-details
Creates or updates detailed information about a module. Slices read entries, not module text — pass facts[] to create linked entries in one call.
Input:
projectId(required): Project ID fromlist-projectsname: Module namedescription: Detailed description of the moduleinputs: What the module accepts as inputoutputs: What the module produces as outputdependencies(optional): List of module dependencies (syncs todataFlow.dependsOnwhen provided)files(optional): List of files belonging to this modulefacts(optional): Array of horizontal facts (kind,title,summary, …) — each upserted as entry withrefs.moduleName= module nameusageExamples(optional): Array of usage examples with fields:title: Example titledescription(optional): Description of the examplecommand(optional): Command or code snippetinput(optional): Input dataoutput(optional): Expected outputnotes(optional): Additional notes about the example
notes(optional): Additional notes
Output:
- Module ID and success message
set-module-data-flow
Patches dataFlow for a single module without sending the full architecture.
Input:
projectId(required): Project ID fromlist-projectsmoduleName: Module namedependsOn(optional): Modules this module depends on (canonical)dataTransformation(optional): How data is transformedsyncInverse(optional): RecomputeprovidesTo(defaulttrue)
Output:
- Module name and success message
rebuild-data-flow
Rebuilds dataFlow for all modules from module file dependencies or existing dependsOn edges. Replaces bulk manual edits to architecture.json.
Input:
projectId(required): Project ID fromlist-projectssource(optional):module-dependencies(default) ordataFlow-dependsOnsyncInverse(optional): RecomputeprovidesTo(defaulttrue)pruneOrphans(optional): Remove invalid module references (defaulttrue)
Output:
edgesAdded,edgesRemoved,modulesUpdated, message
validate
Primary post-edit check. Read-only validation with a compact agent-friendly report. Does not modify data.
Checks (only rules we can verify from stored JSON):
- dataFlow: inverse drift, dangling
dependsOn/providesTo, orphan flow keys module.dependenciesvsdataFlow.dependsOn- entries:
entries-without-modules,entry-unlinked,orphan-entry-module,module-no-entries,module-missing-api/module-missing-persistence,entry-slice-orphan,module-too-many-entries,module-too-few-entries - storage: missing
modules/{id}.json, orphan module files, entry index drift - slices: empty built-in
api/domain/persistencewhen modules exist
Input: projectId, checkInverse, checkModuleDeps, checkEntryCoverage, checkStorage, checkEmptySlices, checkSliceCoverage, checkModuleEntryCounts, moduleEntryMax (default 50), moduleEntryMin (optional; omit to disable min check) — all boolean flags default true unless noted
Output: valid, issueCount, summary, stats, issuesByKind, issues[], coverage, checksRun
fix-data
Run when catalog JSON is corrupt (for example list-modules / validate fail with extra data after JSON). Trims leftover bytes after the first valid JSON object in architecture.json, modules/, entries/, and slices/; removes leftover .tmp files; rebuilds the entry index. Does not delete facts. Catalog writes use temp+rename so this leftover cannot recur.
Input: projectId, dryRun (optional, default false)
Output: summary, scanned, repaired, unreadable, tmpRemoved, indexItemCount, files[] (repaired/unreadable only)
refactor-architecture
Preview or apply in-architector sync after a code refactor when module boundaries stay the same. Agent is the source of truth — no workspace or git access. Default dryRun=true.
Workflow: (1) scan with file or text → compact hits, (2) build mutation ops, (3) dryRun preview, (4) apply with dryRun=false and confirm=true.
Operations (max 10 per call): scan, move-file, replace-path-prefix, rename-text, patch-entry, merge-files, remove-file-ref.
Scope (optional): moduleName, kinds, tags — limits which entries/modules are touched.
Orphan entries with empty refs.files and no refs.entryIds are deleted after file operations.
Input: projectId, operations[], scope, dryRun (default true), confirm (required when applying), limit, offset
Output: summary, stats, hits (scan) or paginated changes, warnings, hasMore
validate-architecture
Same as validate (legacy alias). Prefer validate after edits.
Output:
valid(boolean),issuesarray
get-module-details
Retrieves detailed information about a specific module.
Input:
projectId(required): Project ID fromlist-projectsmoduleName: Name of the module to retrieve
Output:
- Complete module details
list-modules
Lists all modules in the project architecture.
Input:
projectId(required): Project ID fromlist-projects
Output:
- Array of module summaries
delete-module
Deletes a module from the project architecture.
Input:
projectId(required): Project ID fromlist-projectsmoduleName: Name of the module to delete
Output:
- Success message
Resources
architecture
Provides access to project architecture as a resource.
Usage:
Access via URI: arch://{projectId}
module
Provides access to module details as a resource.
Usage:
Access via URI: module://{projectId}/{moduleId}
Development
Project Structure
Project ID
The server stores each project in ~/.mcp-architector/{projectId}/. projectId must be passed explicitly on every tool except list-projects.
- Call
list-projects(withquery= workspace folder name) to find the id MCP_PROJECT_IDis only a listing hint (isCurrent/suggestedProjectId), not a silent write targetdefault-projectand unsubstituted${workspaceFolder}ids are forbidden
To start a new project, pass a stable id derived from the workspace path (e.g. _qs_my-app) to set-project-architecture.
Extending the Server
To add new tools, resources, or prompts, edit src/index.ts:
License
MIT
來源:README.md,提交 cf3776f
工具
0版本歷史
2- v1.11.1最新Sep 27, 2026
- v1.11.0Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。