NeuCharFramework (NCF)
  • NCF - NeuCharFramework
  • Projects

    • Preparation
    • NcfPackageSources Source Guide
    • DynamicWebApiEngine
    • Deployment
  • Help

    • Online Resources
    • Q&A Community
    • QQ Group (147054579)
    • Senparc WeChat SDK
  • Gitee
  • GitHub
  • English
  • 简体中文
GitHub
  • NCF - NeuCharFramework
  • Projects

    • Preparation
    • NcfPackageSources Source Guide
    • DynamicWebApiEngine
    • Deployment
  • Help

    • Online Resources
    • Q&A Community
    • QQ Group (147054579)
    • Senparc WeChat SDK
  • Gitee
  • GitHub
  • English
  • 简体中文
GitHub
  • Quickstart And Capability Guide

    • NcfPackageSources Beginner Quickstart (60 Minutes)
    • NcfPackageSources Source Guide
    • NCF Capability Deep Dive (Practical)
    • Version Upgrade Notes
  • XNCF Extension Modules

    • XNCF Extension Library Guide (Senparc.Xncf.xxx)
  • NCF Libraries

    • Senparc.Ncf.Core
    • Senparc.Ncf.Database (Database Foundation)
    • Senparc.Ncf.Repository
    • Senparc.Ncf.Service
    • Senparc.Ncf.SMS
    • Senparc.Ncf.Mvc.UI
    • Senparc.Ncf.Log
    • Senparc.Ncf.Utility
    • Senparc.Ncf.XncfBase
    • Senparc.Ncf.AreaBase
    • Senparc.Ncf.DatabasePlant
  • Core Interfaces

    • IXncfRegister Interface (Current)

Senparc.Ncf.XncfBase

Positioning

Senparc.Ncf.XncfBase is the modular engine foundation of NCF. It defines and implements module registration, scanning, lifecycle management, function discovery, and MCP integration contracts.

Key Types

  • IXncfRegister: module registration contract
  • XncfRegisterBase: default module register base class
  • static Register: global startup and scan entry
  • XncfRegisterManager: module register list manager
  • FunctionRenderCollection: discovered function storage
  • XncfOrderAttribute: loading priority attribute

1. Engine Startup and Scan

Startup entry:

  • Register.StartNcfEngine(IServiceCollection, IConfiguration, IHostEnvironment, string[] dllFilePatterns)

Scan targets:

  • IXncfRegister implementations
  • XncfAutoConfigurationMappingAttribute types
  • [FunctionRender] methods in AppServiceBase descendants

2. Module Lifecycle

Typical module Register.cs implements:

  • InstallOrUpdateAsync(...)
  • UninstallAsync(...)
  • AddXncfModule(...)
  • UseXncfModule(...)

For modules implementing IXncfDatabase, database context wiring and migration hooks are integrated.

3. FunctionRender Model (Current Recommended Path)

In the current version:

  • registration is method-level via [FunctionRender(...)]
  • discovered functions are stored in Register.FunctionRenderCollection
  • query is supported by register type or module UID

Legacy IXncfRegister.Functions list-based registration is no longer the primary pattern.

4. MCP Integration

XncfRegisterBase already includes MCP support:

  • module switch: EnableMcpServer => true
  • service registration: AddMcpServer(...)
  • route activation: UseMcpServer(...)

Default route pattern: mcp-<module-name-lowercase>

5. Threads and Version Helpers

  • Threads/ThreadInfo, XncfThreadBuilder: module thread management
  • VersionManager/*: version utility helpers

Recommendations

  • Keep each module centered around XncfRegisterBase as the single registration root.
  • Standardize function exposure through AppService + FunctionRender for future AI/MCP reuse.
  • Before exposing MCP externally, complete auth, tool allowlisting, and audit design.
Edit this page on GitHub
Last Updated:
Contributors: Jeffrey Su, JeffreySu
Prev
Senparc.Ncf.Utility
Next
Senparc.Ncf.AreaBase