NeuCharFramework (NCF)
  • NCF - NeuCharFramework
  • Projects

    • Preparation
    • NcfPackageSources Source Guide
    • DynamicWebApiEngine
    • Deployment
    • MCP (Model Context Protocol) Module
    • Senparc.AI
  • AIKernel Local Fine-Tuning
  • 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
    • MCP (Model Context Protocol) Module
    • Senparc.AI
  • AIKernel Local Fine-Tuning
  • Help

    • Online Resources
    • Q&A Community
    • QQ Group (147054579)
    • Senparc WeChat SDK
  • Gitee
  • GitHub
  • English
  • 简体中文
GitHub
  • Source Development

    • NcfPackageSources Beginner Quickstart (60 Minutes)
    • NcfPackageSources Source Guide
    • Project Relationships, Synchronization, and Release
    • Version Upgrade Notes
    • NcfPackageSources_Include_NcfSimulatedSite.sln Project Map
  • XNCF Source Analysis

    • NCF Capability Source Deep Dive (Practical)
    • XNCF Extension Library Guide (Senparc.Xncf.xxx)
    • XNCF Module Documentation Map
    • Senparc.Web and Admin
    • XncfBuilder Isolated Development: Source Analysis
  • Admin Feature Guides

    • Admin help directory and short notes
    • Admin logs and diagnostics
    • AdminChat conversations, Harness and attachments
    • AdminChat Memory and Conversation Settings
    • NeuBell outbound WebHook management
    • NeuCharPivot boards, aggregation and access
    • MCP Manager: published services and client connections
    • AIKernel models, vectors and usage
    • AIKernel Local Fine-Tuning
    • KnowledgeBase ingestion and recall tests
    • PromptRange ranges, testing and model settings
    • Skill import, testing and publication
    • FileManager assets and upload policies
    • AgentsManager agent management
    • AgentsManager 3D Status View
    • AgentsManager: HIL and NeuChar Workflow Integration
    • NeuChar Workflow: Operations and {{= ... }} Expressions
    • Workspace and AdminChat
    • Sandbox session management and environment setup
    • DynamicData tables, layouts and pages
    • SenMapic crawl tasks and results
    • Weixin official accounts and followers
    • Personal Weixin Bot and Admin integration
  • NCF Library Source Analysis

    • 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 Interface Source Analysis

    • IXncfRegister Interface (Current)

IXncfRegister Interface (Current)

This page walks through src/Basic/Senparc.Ncf.XncfBase/Interfaces/IXncfRegister.cs and belongs to source analysis. When developing from a Template, start with XNCF Extension Contracts and Boundaries; the complete internal collaboration is not a prerequisite.

1. Contract Responsibility

IXncfRegister is the module registration contract for each XNCF module. It defines:

  • module metadata (Name/Uid/Version/MenuName/Icon/Description)
  • module lifecycle hooks
  • AutoMapper mapping hooks
  • module thread information
  • MCP enablement and registration hooks

2. Key Properties

bool IgnoreInstall { get; }
bool EnableMcpServer { get; }
string Name { get; }
string Uid { get; }
string Version { get; }
string MenuName { get; }
string Icon { get; }
string Description { get; }
ConcurrentBag<Action<Profile>> AutoMapMappingConfigs { get; set; }
IEnumerable<KeyValuePair<ThreadInfo, Thread>> RegisteredThreadInfo { get; }

3. Key Methods

Task InstallOrUpdateAsync(IServiceProvider serviceProvider, InstallOrUpdate installOrUpdate);
Task UninstallAsync(IServiceProvider serviceProvider, Func<Task> unsinstallFunc);

string GetAreaHomeUrl();
string GetAreaUrl(string path);

IServiceCollection AddXncfModule(IServiceCollection services, IConfiguration configuration, IHostEnvironment env);
void AddAutoMapMapping(Action<Profile> mapping);
void OnAutoMapMapping(IServiceCollection services, IConfiguration configuration);

IApplicationBuilder UseXncfModule(IApplicationBuilder app, IRegisterService registerService);

void AddMcpServer(IServiceCollection services, IXncfRegister xncfRegister);
void UseMcpServer(IApplicationBuilder app, IRegisterService registerService);

4. Implementation Notes (Important)

  • IList<Type> Functions is commented out in the current contract and should not be treated as the primary registration path.
  • The recommended function model is [FunctionRender] scanning on AppService methods.
  • AddXncfModule includes IHostEnvironment env in the method signature.
  • MCP members are part of the contract (EnableMcpServer, AddMcpServer, UseMcpServer).

5. Recommended Implementation Pattern

For new modules, inherit from XncfRegisterBase and override only required points:

  • metadata
  • install/uninstall behavior
  • DI registration in AddXncfModule
  • middleware/static resource registration in UseXncfModule
  • MCP enablement via EnableMcpServer => true when needed
Edit this page on GitHub
Last Updated:
Contributors: Jeffrey Su, JeffreySu