Context Fabric MCP

Context Fabric MCP

MCP server that provides local software-system context compilation, exposing indexed code intelligence, dependency resolution, and cross-layer knowledge through the Knowledge API.

Category
访问服务器

README

Context Fabric

Context Fabric is a local compiler for software-system context. Milestones 0 through 10 are implemented and audited against all 175 SRS requirement IDs. See Implementation Status for measured gates and Requirement Coverage for the complete traceability matrix.

Implemented layers include compiler-resolved TypeScript, explicit project-wide JavaScript ESM/CommonJS resolution, syntax-aware Python intelligence, and deterministic PHP symbol/include/call resolution; workspace/framework detection; bounded dependency source roots; HTTP, Confluence, OpenAPI, GraphQL, SQLite, PostgreSQL, external MCP, Figma, and Storybook sources; cross-layer domain concepts with human correction; and design-system intelligence with screenshot evidence.

Project discovery excludes generated dependency and cache trees by default, including JavaScript package/build caches and PHP Composer vendor, PHPUnit cache, Laravel compiled/cache directories, and Symfony var/cache. A separately configured dependency source can still deliberately index a bounded package root. The universal 50 MiB ceiling keeps oversized files metadata-only.

Runtime intelligence ingests OpenTelemetry, HAR, Playwright JSON traces, application and SQL logs, and Istanbul coverage. It keeps static may-call edges separate from observed execution, retains bounded aggregate traces, and exposes generic graph tracing through the shared Knowledge API and MCP.

The Context Engine combines indexed exact/prefix, full-text, graph, concept, and optional local-semantic channels under compact/standard/deep budgets. Evidence strength, confidence, and freshness affect ranking. Optional reasoning providers are disabled by default and persist only grounded proposals with provider/model/task provenance. Production hardening adds WAL, integrity recovery, compaction, bounded background workers with crash detection and capped exponential-backoff restarts, compatibility checks, source/rebuild controls, pipeline metrics, and a 2.25-million-record qualification benchmark.

Run

npm install
npm test
npm run benchmark -- 1000
npm run benchmark:scale
npm run start:headless
npm run start:desktop
npm run start:headless -- index C:\path\to\project
npm run start:headless -- search MySymbol
npm run start:headless -- mcp-stdio
npm run start:headless -- mcp-http 7341
npm run start:headless -- watch C:\path\to\project
npm run package:desktop
npm run package:matrix

The headless runtime, background indexing worker, desktop renderer, and MCP adapters consume the same core services. Plugins receive a validated KnowledgeEmitter; they never receive database write access.

The Electron application automatically runs a read-only MCP Streamable HTTP server for the active project. It binds only to loopback, normally at http://127.0.0.1:7341/mcp; the exact endpoint is shown in Settings. In MCP Inspector, select streamable-http and enter that endpoint. Switching projects restarts it against the newly active Knowledge API, and quitting the app stops it.

The desktop also stays available from the system tray. Closing the dashboard hides it while indexing and MCP continue; hovering the tray icon shows current indexing activity, and its menu can open the dashboard, start an indexing run, restart the application, or close it completely.

Project discovery hard-excludes dotfiles, agent workspace directories (.claude, .agents, .codex, .cursor, and equivalent tool state), and transient *.lock files. Recognized dependency locks such as yarn.lock, Cargo.lock, and composer.lock remain part of the project corpus.

Incremental fingerprinting retains SHA-256 content identities but uses persisted size/index time as a no-read fast path for files that have not changed. Up to 16 bounded read/hash lanes operate concurrently, scaled down against the indexing memory policy and maximum file size. Filesystem watch events force a content hash, and fingerprint activity ends before parsing/extraction begins.

On first launch, the desktop asks for a project working directory before it creates configuration or index data. Settings remembers and can change that directory. Filesystem/drive roots are rejected; choose a bounded repository, monorepo, or project directory. Switching roots closes the previous project runtime and opens the selected root as a separate identity universe. Use Index project to perform the first local sync, or Clear all app data to remove Context Fabric-owned state and return to first-run selection without touching project source files. The Storage location control can move the SQLite index and blob store to a different drive; Context Fabric uses a dedicated per-project subdirectory and migrates existing data before reopening the project.

The desktop Live view streams bounded, real indexing lifecycle events, including an in-place files-scanned count during project discovery, and a clickable recent-connection graph without polling or simulated activity. Its bundled GPU engine can render million-scale graphs, while Context Fabric keeps the richer labeled interactive working set to 100,000 nodes and 200,000 edges; the full graph remains available through bounded Knowledge API pages. Uploads are coalesced so progressive backfill does not repeatedly duplicate the entire working set. The default shadow resource policy lazy-starts the TypeScript parser, releases it after three idle seconds, caps background worker memory, limits foreground concurrency, and lazy-loads heavyweight dashboard projections. Hot per-file signals are sampled at 12 events per second while reporting the exact number of real actions coalesced between visible updates.

The Live view's Boost pill switches the current project between the persistent shadow background profile and performance active profile without restarting the app. Boost uses the project's full configured concurrency while retaining the same worker-memory and file-safety ceilings; the control is locked while an indexing operation is in flight.

Plugin artifact traversal is streamed in small database pages and retains at most 64 MiB of content for legacy bulk consumers. TypeScript deep resolution is isolated in batches of at most 128 files or 8 MiB, with bounded result payloads; generated bundles, minified scripts, and source maps are excluded by default.

Optional OAuth reasoning providers can also be added and signed into from Settings using the provider's device-authorization endpoints and public client ID. Sessions are encrypted with Electron's operating-system credential facility, stored outside project data, refreshed when supported, and removable with Sign out. API-key environment variables remain supported.

package:desktop builds and structurally verifies the current host bundle. package:matrix additionally creates x64 Windows, Linux, and unsigned macOS transfer bundles and writes release/packaging-manifest.json. On Windows hosts without symlink privilege, the macOS bundle uses materialized framework aliases; final macOS execution, signing, and notarization still belong on a macOS runner.

Filesystem discovery applies a built-in global exclusion policy before project rules. Common VCS, dependency, framework output, build, coverage, and cache directories such as .git, node_modules, .next, dist, target, release, .electron-package-cache, __pycache__, and .cache are skipped automatically. Project .gitignore and configured ignore rules are layered on top; dependency trees can still be indexed intentionally by configuring their directory as an explicit bounded dependency root.

Project discovery is additionally capped at 250,000 files by default to prevent an unexpectedly broad tree from exhausting the indexing worker. Set projectSource.maxFiles in .context-fabric/config.json to tune the ceiling (the runtime clamps it to 1–1,000,000).

Individual files are capped at 50 MiB. Larger artifacts are retained as searchable file metadata (path, size, extension, and revision fingerprint), but their bytes are never loaded into the indexing worker. Set projectSource.maxFileBytes to choose a lower limit; configured values are clamped to 64 KiB through the absolute 50 MiB ceiling.

External sources are declared in .context-fabric/config.json. Secret-bearing headers reference environment variables rather than storing values:

{
  "sources": [
    {
      "id": "product-api",
      "type": "openapi",
      "name": "Product API",
      "enabled": true,
      "config": {
        "urls": ["https://example.test/openapi.yaml"],
        "headerEnv": { "authorization": "PRODUCT_API_AUTH" }
      }
    }
  ]
}

PostgreSQL credentials and reasoning-provider credentials are environment references, not stored values. Optional dependencies and local semantic ranking can be enabled independently:

{
  "embeddings": { "enabled": true, "model": "context-local-v1", "dimensions": 384 },
  "dependencySources": [
    { "id": "shared-sdk", "path": "vendor/shared-sdk", "enabled": true, "maxFiles": 10000 }
  ],
  "sources": [
    {
      "id": "commerce-db",
      "type": "postgres",
      "name": "Commerce PostgreSQL",
      "enabled": true,
      "config": { "connectionStringEnv": "COMMERCE_DATABASE_URL", "schemas": ["public"] }
    }
  ]
}

Specification traceability

  • Canonical model and stable IDs: TAS sections 4–18
  • Plugin lifecycle and scoped services: TAS sections 30–37
  • Core-owned scheduling and failure isolation: TAS sections 62–65
  • Candidate validation and identity: TAS sections 67–75
  • SQLite, transactions, and deduplication: TAS sections 86–90
  • Worker/backpressure rules: TAS sections 114–121
  • Milestone 0 scope and exit criteria: SRS section 21
  • Filesystem discovery and snapshots: SRS requirements FR-010–FR-017
  • TypeScript symbols and dependencies: SRS requirements FR-030–FR-036
  • Incremental pipeline and fingerprints: TAS sections 76–80
  • Search and bounded context packs: TAS sections 81–84
  • Milestone 1 scope and exit criteria: SRS section 21
  • SourceProvider lifecycle: TAS sections 38–41
  • Source freshness and caching: SRS requirements FR-010–FR-028
  • Milestones 2–10 scope and exit criteria: SRS section 21
  • Concept identity, claims, annotations, and knowledge gaps: TAS sections 19–24
  • Figma/code ambiguity and rendering reliability: Risks R-027–R-029
  • Runtime incompleteness, volume, and retention: Risks R-020–R-021

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选